Programming Fundamentals (Assignment # 02)
Programming Fundamentals (Assignment # 02)
02
Total Marks: 10
Semester: Fall 2022 Due Date: December 22, 2022
Programming Fundamentals
NOTE: Submit your assignment to your class representative in hard form well before the deadline. The submitted file must
contain the program source code along with output screenshot.
PRACTICAL
Question # 01: Write a program that takes length as input in feet and inches. The program should then convert the lengths
in centimeters and display it on screen. Assume that the given lengths in feet and inches are integers.
To calculate the equivalent length in centimeters, you need to multiply the total inches by 2.54. Instead of using the value
2.54 directly in the program, you will declare this value as a named constant. Similarly, to find the total inches, you need
to multiply the feet by 12 and add the inches. Instead of using 12 directly in the program, you will also declare this value
as a named constant. Using a named constant makes it easier to modify the program later.
Question # 02: Write a C++ program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and
Computer. Calculate percentage and grade according to following:
Question # 03: Write a C++ program to input electricity unit charges and calculate total electricity bill according to the
given condition:
Question # 05: What will be the output of the following program? (Dry Run the code and create table to illustrate the
steps).
#include <iostream>
#include <string>
int main() {
return 0;
Question # 06: Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of
the number is equal to the number itself, then the number is called an Armstrong number.
************************************************
Best of Luck