0% found this document useful (0 votes)
7 views2 pages

Programming Assignment

The document outlines an individual assignment worth 30% of the total grade, requiring students to write programs in C++. The tasks include calculating the total cost of carpet with a discount, determining the youngest among three ages, and calculating Body Mass Index (BMI) with specific output conditions. The assignment must be submitted by April 13, 2024, in either hard or soft copy format.

Uploaded by

Erdey Syoum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Programming Assignment

The document outlines an individual assignment worth 30% of the total grade, requiring students to write programs in C++. The tasks include calculating the total cost of carpet with a discount, determining the youngest among three ages, and calculating Body Mass Index (BMI) with specific output conditions. The assignment must be submitted by April 13, 2024, in either hard or soft copy format.

Uploaded by

Erdey Syoum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Individual Assignment (30 %)

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

Print “Underweight” if the BMI result is less than 18.5


Print “Normal” if the BMI result is between 18.5 and 24.9
Print “Overweight” if the BMI result is between 25 and 29.9 Print
“Obese” if the BMI result is 30 or greater

Page 2 of 2

You might also like