Programming Assignment
Programming Assignment
Instructions
Write comment to make your programs readable.
Use descriptive variables in your programs (Name of the variables should show their
purposes)
Submission form: in hard or soft copy
Submission date: 13 April 2024 GC
1. A store sells carpets for $2.75 per meter. If a customer buys more than 10 m of carpet,
they get a discount of 15% on every additional meter of carpet they purchase. Write a
program that inputs the carpet length that a user wishes to buy, stores the value in a
double variable, and then calculates and outputs the total cost of the carpet. Below is a
snapshoot how your program is supposed to work.
2. If ages of Abebe, Yonatan and Aklesia are input through the keyboard,
write a program to determine the youngest of the three.
Page 1 of 2
3. Write a c++ program that will determine a person’s Body Mass Index
Usethe following formulas for calculating BMI:
BMI = Weight in kg / (height in m)
2
Page 2 of 2