You are on page 1of 4

National University of Computer & Emerging Sciences – FAST (CFD)

Department of Computer Science: Programming Fundamentals - Lab

National University of Computer and Emerging Sciences

Lab # 07
For

Programming Fundamentals Lab


Lab Instructor(s) Mr. Mughees Ismail
Semester Fall 2022

FAST School of Computing

Page 1|4
National University of Computer & Emerging Sciences – FAST (CFD)
Department of Computer Science: Programming Fundamentals - Lab

Instructions:

1. Make a word document with the convention “SECTION_Lab#_ROLLNO” and put all
your source code and snapshots of its output in it.
2. Plagiarism is strictly prohibited, do not copy anything from internet, or any of your friend
else your assignment will be marked 0.
3. Do not discuss solutions with one another.
4. Write the code with proper dialogues to improve the user interaction with your program.

Task 01:
Write a C++ program that takes a number input from user and prints if it’s greater than 10 or not.

Task 02:
You have several pictures of different sizes that you would like to frame. A local picture framing
store offers two types of frames—regular and fancy.
The frames are available in white and can be ordered in any color the customer desires.
Suppose that each frame is 1 inch wide. The cost of coloring the frame is $0.10 per inch.
The cost of a regular frame is $0.15 per inch, and the cost of a fancy frame is $0.25 per
inch. The cost of putting a cardboard paper behind the picture is $0.02 per square inch,
and the cost of putting glass on top of the picture is $0.07 per square inch. The customer
can also choose to put crowns on the corners, which costs $0.35 per crown.
Write a program that prompts the user to input the following information and then output
the cost of framing the picture:
a. The length and width, in inches, of the picture
b. The type of the frame
c. Customer’s choice of color to color the frame
d. If the user wants to put the crowns, then the number of crowns

Task 03:
Write a C++ program that inputs a number and if it’s less than 5, print “Red”, if it’s greater than
5 and less than 10, print “Green”, and if it’s greater than 10 but less than 15 print “Blue”.

Task 04:
Write a C++ program, that inputs two numbers and prints their binaries. After printing their
binaries, print the and (&) operator result of their binaries. The input must be between 0-9.

Page 2|4
National University of Computer & Emerging Sciences – FAST (CFD)
Department of Computer Science: Programming Fundamentals - Lab

Task 05:
Input a 5-digit number from user and check if it’s palindrome or not. For example, if input is
12321, it’s Palindrome.

Task 06:
Write a C++ program that,
1. Reads marks from the user.
2. Prints “A+” if marks are greater than 90.
3. Prints “A” if marks are greater than equal to 80 and less 90.
4. Prints “B+” if marks are greater than equal to 70 and less than 80.
5. Prints “B” if marks are greater than equal to 60 and less than 70.
6. Prints “C” if marks are greater than equal to 55 and less than 60.
7. Prints “D” if marks are greater than equal to 50 and less than 55.
8. Prints “F” if marks are less than 50.

Task 07:
This programming example demonstrates a program that calculates a customer’s bill for
a local cable company. There are two types of customers: residential and business.
There are two rates for calculating a cable bill: one for residential customers and one for
business customers. For residential customers, the following rates apply:
• Bill processing fee: $4.50
• Basic service fee: $20.50
• Premium channels: $7.50 per channel.
For business customers, the following rates apply:
• Bill processing fee: $15.00
• Basic service fee: $75.00 for first 10 connections, $5.00 for each additional connection
• Premium channels: $50.00 per channel for any number of connections
The program should ask the user for an account number (an integer) and a customer
code. Assume that R or r stands for a residential customer, and B or b stands for a
business customer
Input
The customer’s account number, customer code, number of premium channels to which
the user subscribes, and, in the case of business customers, number of basic services
connections.
Output
Customer’s account number and the billing amount.

Page 3|4
National University of Computer & Emerging Sciences – FAST (CFD)
Department of Computer Science: Programming Fundamentals - Lab

Task 08:
Write a C++ program that inputs a character and checks whether it’s vowel or not.

Task 09:
Write a C++ program that inputs a character and checks whether it’s capital letter or small letter.
If its capital letter changes it into small letter, if it’s small letter change it into capital letter.

Best of luck

Page 4|4

You might also like