Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program name manageweight.cpp to read a list of names and their weights in pounds, store them in 2 lists and process them

image text in transcribedimage text in transcribed

Write a C++ program name manageweight.cpp to read a list of names and their weights in pounds, store them in 2 lists and process them based on the following requirements: - Write a function to prompt the user to enter a filename, read the list of integer numbers and names(1 name and weight per line) each corresponding to a person's weight in pounds and their name. Store all weights and names in 2 arrays. Assume there are no more than 10 elements (name and weight) in the file, but could be less. Make your array size 10. The function updates teh arrays and return the number of elements read from the file. File Format: Name Weight Sample file: \begin{tabular}{lr} Joe & \multicolumn{1}{c}{67} \\ Nancy & 123 \\ Allen & 234 \end{tabular} Requirements - Add a function to calculate and store the weights in kilograms in a float array, each kilogram is 2.2lbs. - Add a function to find the highest, lowest weight, and average of the weight and send them back to the caller. - Add a function to print the lists of names, weights. see sample below. - Add a function to sort lists (names and weights) based on weights from least heavy to heaviest weight. - Add the main function to call the functions and produce the following output. - Add main function to perform the following tasks: - Declare arrays and any variable you need - Call readData function - Call printData function - Call processData function (to find, high, low and average of weights - Print high, low and average (see format below) - Call sort function - Call printData function Sample output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

=+8.3(i)). If j is transient, then fi= C PH) /(1+2 Pc)

Answered: 1 week ago

Question

4. Choose appropriate and powerful language

Answered: 1 week ago

Question

2. Choose an appropriate organizational pattern for your speech

Answered: 1 week ago