Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
23 views4 pages

ICT122 Lab Exams

The document outlines a series of programming assignments for students in the Department of Information Technology Education at Akenten Appiah-Menka University. Each assignment involves designing C++ programs to solve various mathematical and practical problems, such as calculating sales commissions, areas of shapes, and converting units. The tasks aim to enhance students' programming skills and understanding of fundamental concepts in computer science.
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)
23 views4 pages

ICT122 Lab Exams

The document outlines a series of programming assignments for students in the Department of Information Technology Education at Akenten Appiah-Menka University. Each assignment involves designing C++ programs to solve various mathematical and practical problems, such as calculating sales commissions, areas of shapes, and converting units. The tasks aim to enhance students' programming skills and understanding of fundamental concepts in computer science.
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/ 4

AKENTEN APPIAH-MENKA UNIVERSITY OF SKILLS TRAINING AND

ENTREPRENEURIAL DEVELOPMENT
FACULTY OF APPLIED SCIENCES AND MATHEMATICS EDUCATION
DEPARTMENT OF INFORMATION TECHNOLOGY EDUCATION
LAB ASSIGNMENTS: ANSWER ALL IN YOUR LAB MANUAL

1. One large chemical company pays its salespeople on a commission basis. The salespeople
each receive $200 per week plus 9 percent of their gross sales for that week. For example, a
salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of
$5000, or a total of $650. Develop a C++ program inputs each salesperson's gross sales for
last week and calculates and displays that salesperson's earnings. Process one salesperson's
figures at a time

2. Write a program that computes the area of a circular region (the shaded area in the
diagram) given the radius of the inner and the outer circles, ri and ro, respectively.

ri ro

We compute the area of the circular region by subtracting the area of the inner circle from the
area of the outer circle.
3. Develop a simple application using switch….case to calculate the area of the following
shapes: Square, Rectangle and Triangle. The user should be able to perform any of the
calculation and also press a key to terminate the program.

4. A company has determined that its annual profit is typically 23 percent of total sales.
Design a program that asks the user to enter the projected amount of total sales, and then
displays the profit that will be made from that amount.
Hint: Use the value 0.23 to represent 23 percent

1
5. One acre of land is equivalent to 43,560 square feet. Design a program that asks the user to
enter the total square feet in a tract of land and calculates the number of acres in the tract.
Hint: Divide the amount entered by 43,560 to get the number of acres.
6. A customer in a store is purchasing five items. Design a program that asks for the price of
each item, and then displays the subtotal of the sale, the amount of sales tax, and the total.
Assume the sales tax is 6 percent.

7. Design a modular program that asks the user to enter a distance in


kilometers, and then converts that distance to miles.
The conversion formula is as follows: Miles = Kilometers x0.6214

8. Design a program that calculates the total amount of a meal purchased at a restaurant. The
program should ask the user to enter the charge for the food, and then calculate the amount
of a 15 percent tip and 7 percent sales tax. Display each of these amounts and the total.

9. Design a program that converts Celsius temperatures to Fahrenheit temperatures. The


formula is as follows:

9
f = c+32
5

The program should ask the user to enter a temperature in Celsius, and then display the
temperature converted to Fahrenheit.

10. Many financial experts advise that property owners should insure their homes or buildings
for at least 80 percent of the amount it would cost to replace the structure. Design a
modular program that asks the user to enter the replacement cost of a building and then
displays the minimum amount of insurance he or she should buy for the property.

11. Design a program that prompts the user to enter a number within the range of 1 through 10.
The program should display the Roman numeral version of that number. If the number is
outside the range of 1 through 10, the program should display an error message.

12. The area of a rectangle is the rectangle’s length times its width. Design a program that asks
for the length and width of two rectangles. The program should tell the user which
rectangle has the greater area, or whether the areas are the same.

2
13. Scientists measure an object’s mass in kilograms and its weight in Newtons. If you know
the amount of mass of an object, you can calculate its weight, in Newtons, with the
following formula:
Weight = Mass × 9.8
Design a program that asks the user to enter an object’s mass, and then calculates its weight. If
the object weighs more than 1,000 Newtons, display a message indicating that it is too heavy. If
the object weighs less than 10 Newtons, display a message indicating that it is too light.

14. The colors red, blue, and yellow are known as the primary colors because they cannot be
made by mixing other colors. When you mix two primary colors, you get a secondary
color, as shown here:
 When you mix red and blue, you get purple.
 When you mix red and yellow, you get orange.
 When you mix blue and yellow, you get green.
Design a program that prompts the user to enter the names of two primary colors to
mix. If the user enters anything other than “red,” “blue,” or “yellow,” the program
should display an error message. Otherwise, the program should display the name of
the secondary color that results.

15. Serendipity Booksellers has a book club that awards points to its customers based on the
number of books purchased each month. The points are awarded as follows:
 If a customer purchases 0 books, he or she earns 0 points.
 If a customer purchases 1 book, he or she earns 5 points.
 If a customer purchases 2 books, he or she earns 15 points.
 If a customer purchases 3 books, he or she earns 30 points.
 If a customer purchases 4 or more books, he or she earns 60 points. Design a
program that asks the user to enter the number of books that he or she has
purchased this month and displays the number of points awarded.

16. The area of a rectangle is calculated according to the following formula:


Area = Width × Length
Design a function that accepts a rectangle’s width and length as arguments and returns the
rectangle’s area. Use the function in a program that prompts the user to enter the rectangle’s
width and length, and then displays the rectangle’s area.

3
17. The Fast Freight Shipping Company charges the following rates:
Weight of Package Rate per Pound
2 pounds or less $1.10
Over 2 pounds but not more than 6 pounds $2.20
Over 6 pounds but not more than 10 pounds $3.70
Over 10 pounds $3.80
Design a program that asks the user to enter the weight of a package and then displays the
shipping charges.

18. The BMI is often used to determine whether a person with a sedentary lifestyle is
overweight or underweight for his or her height. A person’s BMI is calculated with the
following formula:
2
BMI =Weightx 703 /Height
Design a program that calculates and displays a person’s body mass index (BMI) and
displays a message indicating whether the person has optimal weight, is underweight, or
is overweight. A sedentary person’s weight is considered to be optimal if his or her BMI
is between 18.5 and 25. If the BMI is less than 18.5, the person is considered to be
underweight. If the BMI value is greater than 25, the person is considered to be
overweight.

You might also like