Question: In c + + A manufacturer needs a program to determine the total cost of producing some number of different types of cylindrical machine parts.
In c
A manufacturer needs a program to determine the total cost of producing some number of different
types of cylindrical machine parts.
The cost for one machine part is the cost of one square centimeter of the materials times the number of
square centimeters in the total surface area of the container.
The machine parts are open on one end, so the total surface area is the surface area of the base plus the
surface area of the cylinder.
Each part type has the following data to describe it:
the name of the part
the cost of the materials required
the radius of the base
the height of the cylinder
Your program should define four vectors to hold the data for several parts name cost radius, and
height These vectors will be parallel structures which together hold all of the information for multiple
parts.
For example, after your vectors are defined and populated, their contents might look like this, where the
same position in each vector holds the data for one part. So Short costs per sq cm and has a
base with radius cm and a height of cm
vector name;
Short
Medium
Tall
vector cost;
vector radius;
vector height;
Part A of your program is to input the data to describe a set of parts.
Declare your vectors
Loop and input data for each part until a user indicates that all part data is entered, storing the
data for each part in the vectors
Part B of your program is to show a user a menu of parts and allow them to see how much the cost will
be for some number of parts of a type.
Loop and output the part descriptions as a numbered list along with an Exit option and ask the
user to enter an option
After parts A and B your
output should look like
this:
Part C of your program is to allow a user to enter an amount of the selected parts to see the cost for
that number of parts.
Prompt for and input the amount of parts for the selected type
Use the amount and calculate the total cost based on the stored cost, radius, and height
Output the amount and redisplay the options
After part C your output
should look like this:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
