subject

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?

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:00, Julianhooks
State 7 common key's for every keyboard
Answers: 1
image
Computers and Technology, 23.06.2019 04:10, cvbnkifdfg
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
image
Computers and Technology, 23.06.2019 11:00, jolleyrancher78
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
image
Computers and Technology, 23.06.2019 21:40, jeovontamarley
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
You know the right 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
History, 01.09.2019 04:50