You are on page 1of 1

INFO 1112

Lab #4
Mar. 6, 2024

Due: Tue. Mar. 13, 2024 at 23:00

Create a new Project for each of the following:

1. Refer to the given problem and the example program given on pages 340 – 342 (10th edition of
textbook). Note the algorithm design, the hierarchy chart, the use of functions, and the comments
in the program. Note the program style and comments.

Design and write a program similar to the one given in the textbook to convert a weight from
kilograms to pounds. Functions will be used, and comments will be included in the program. Each
function will have a block comment before the function header. The functions will be well
documented. The program will display an appropriate heading and instructions for the user. The
output will be well formatted. Consider a good set of data to test the program.
Display your name before the program ends.
Run the program several times using appropriate test data, and obtain the screenshots. Write the
documentation.

2. Write the following functions and add them in a program to calculate and display an employee’s
pay:
a) Write a function prototype and function definition DisplayHeading to display a heading.
b) Write a function prototype and function definition CalcPay with two parameters, to calculate an
employee’s pay. This function will receive the number of hours worked and the hourly pay rate.
The calculated pay will be returned to function main.
c) Write a function prototype and function definition DisplayPay with one parameter, to display
the employee’s pay with appropriate messages. This function will receive the pay and display it.
The output should be well formatted.
d) Call the functions from the function main. Declare any variables used. Prompt the user to enter
the number of hours worked and the hourly pay rate, and read the numbers.
Write the required comments. Each function will have a block of comments before the function
header.
Display your name before the program ends.
Run the program several times using appropriate test data, and obtain the screenshots. Write the
documentation.
Submit the following:
.cpp file and .exe file for the conversion program
.cpp file and .exe file for the pay program
One Word document with appropriate layout for the documentation of the conversion program and
followed by the documentation of the pay program.

You might also like