Computers and Technology

For this Assignment you will attach ONE file, your program file (the .cpp file). DO NOT cut and paste your code into the Add Comments section of the Assignment or email your program, your program will NOT be graded and you will receive a zero for the assignment. If program does not compile you will automatically lose -10.
PROBLEM: Hospital Baby Weights. (20 pts)
Write a program that allows you to enter five baby weights. Your program will determine which baby’s weight was the lowest, which was the highest and what the average baby’s weight was. Your program MUST validate the baby’s weight (see Input Validation below). If there is a Tie for the lowest birth or highest birth weight then display a message saying that there is no lowest or highest for Today.
Input Validation: The program must check to see if the user enters a valid baby weight. A number greater than zero must be entered. If the user does not enter a valid value, display an error message and continue to ask the user to enter the value again until a valid value is entered.
SAMPLE OUTPUT:
COP2000 HOMEWORK ASSIGNMENT 5B 1
Homework Assignment 5 Pool
PSEUDO-CODE for main function:
Declare and Initialize Variables to Store Baby Weights and Average
Call welcome() to display the program description
Call getBabyWeight () for baby1
Call getBabyWeight () for baby2
Call getBabyWeight () for baby3
Call getBabyWeight () for baby4
COP2000 HOMEWORK ASSIGNMENT 5B 2
Homework Assignment 5 Pool
Call getBabyWeight () for baby5
Call findLowest (baby1, baby2, baby3, baby4, baby5)
Call findHighest(baby1, baby2, baby3, baby4, baby5)
Call weightAverage (baby1, baby2, baby3, baby4, baby5) - Don't forget to capture the
returned value
Output the Average Baby Weight
CONSTRAINTS:
NO GLOBAL VARIABLES ALLOWED. (Automatic -10)
You must use: int main()
No Arrays or Vectors
The program must use local variables. (2 pts)
All functions MUST be called by main. (3 pts)
Output must be formatted properly and correct. (3 pts)
Include a comment at the beginning of the program stating the purpose of the program,
your name, the date, and your class (1pt is for code organization and use of whitespace).
(3 pts)
This program MUST use the following functions: (9 pts)
NAME YOUR FUNCTIONS AS SHOWN BELOW (- 10 if not named correctly ):
void getBabyWeight(double &) - (2 pts) is passed the weight of the baby by reference. This function must ask the user for the baby’s weight. You must validate the input for baby’s weight (See Input Validation above). This function returns no value.
void findLowest (double, double , double , double, double) - (2 pts) is passed the five baby weights and finds the lowest weight and displays this value. The output must be formatted properly.
void findHighest (double, double , double , double, double) - (2 pts) is passed the five baby’s weights and finds the highest weight and displays this value. The output must be formatted properly.
void welcome() - (1 pts) is NOT passed any values and returns no value. This function outputs a description of the program and the developer's name (i. e. YOUR name). Your function MUST display the following text and fill in your name as the developer's name (i. e. replace "PUT YOUR NAME HERE" with your name).
COP2000 HOMEWORK ASSIGNMENT 5B 3
Homework Assignment 5 Pool
BABY WEIGHT PROGRAM
Please Enter the Five Baby Weights
Please enter a real number Weights (Must be > 0).
Program Developed by: "PUT YOUR NAME HERE"
double weightAverage(double , double , double, double, double) - (2 pts) The five baby weights are passed to this function and the function averages the weights, the average calculation is then RETURNED to main. The average result is then OUPUT in the mainfunction.
WRITE THE PROGRAM:
Write the program according to your Algorithm or Pseudo Code for the Problem above. CHECK THE PROGRAM:
Does the program meet the Constraints stated above?
Is the program displaying the correct output?
Is the program formatted correctly?

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, karleebowling316
Asuccessful format string attack attempted to steal user account information by reading from unauthorized memory. answer the followings with proper explanation a)this attack will lead to violation of which security policies?
Answers: 2
image
Computers and Technology, 22.06.2019 02:30, quesorules7101
Larry sent an email to andy. andy didn't open larry's email but still understood what the message was. how did andy determine the message without opening the email?
Answers: 1
image
Computers and Technology, 22.06.2019 10:30, ilovepickles930
What can tanya do now to start preparing for the college and scholarship application process? think about her grades, activities in which she can get involved, possible part-time jobs at which she can work, and standardized tests she can take. (10 points) apex
Answers: 2
image
Computers and Technology, 22.06.2019 12:00, savjk74
Which of the following “invisible” marks represents an inserted tab?
Answers: 1
Do you know the correct answer?
For this Assignment you will attach ONE file, your program file (the .cpp file). DO NOT cut and past...

Questions in other subjects:

Konu
Mathematics, 07.12.2020 16:30