For this lab, you will need to create a c++ program for calculating disaster survivors.
Include a multi-line comment at the top of the .cpp file with the assignment title, your name , and some words about what features are going in to this project. Also, at the bottom of the .cpp file, include your program output as a multi-line comment or paste it into the submission window.
The program must have two functions:
calculatePct: This function will calculate the percentage of people who survived a disaster. This function must include:
calculateTotal: This function will calculate the total number of people who survived a disaster. This function must include:
The main function must test both of these functions with three different arguments (run both functions three times with different values each time). The main function should display each of the return values.
Example:
If you call calculatePct and provide 100 as the value of people in the disaster zone and 25 as the number of people killed, the function should return .75 as the percentage of people who survived.
If you call calculateTotal and provide 100 as the value of people in the disaster zone and .25 as the percentage of people killed, the function should return 75 survivors.
Note: You will be using these functions in a larger program for the next lab, so to save yourself time later, make sure to put all cout statements in the main function, do not put cout statements in the calculatePct or calculateTotal functions. While it is perfectly legal to do so, you will just have to remove them for lab 4.
Grading:
No credit if the program does not run or does not meet the requirements. No credit if sample run does not match the program
7 points for the required functions with the correct parameters and return values
3 points for main function test run that calls each function 3 times each with different arguments and displays the return values.
1 points for complete heading multi-line comment
2 points for included sample run as a multi-line comment or pasted into the submission window.
Get Free Quote!
416 Experts Online