Overview:

Many times, it is necessary to create an interface where the user selects or chooses from a menu or predetermined configuration of products. For example, the cost of a pair of shoes based on size and color, a car based on model and option packages or a can of paint based on quantity and type. Typically, a menu of preconfigured options is presented to the user and then a selection is made with many of the necessary details predefined. This is an ideal situation to use a SWITCH statement, as a matter of reliability and maintainability.

In this assignment, the ACME Widget Parts Company is now offering ball bearings, in 3 sizes (small, medium and large) and offering 3 different materials (copper, gold and silver) of composition.

The director of distribution has presented an idea to use a menu system to aid in the distribution and handling process. Additionally, the output desired needs to be in a form that will aid in the processing as well. Her ideas are presented in the specifications and exhibits.

Objective:

Using your textbook, notes and personal research material, program a solution utilizing the attached proposals and using the C Programming language that will display the desired input selection and output on the command screen per the specifications provided. NOTE: Your source code/program should be well documented as outlined in Handout #2. It MUST contain a SWITCH statement.

Specifications:

1. Sizes offered are as follows:

a. Small: 0.25 inches diameter

b. Medium: 0.50 inches in diameter

c. Large: 1.0 inches in diameter

2. Materials offered are:

a. Copper

b. Gold

c. Silver

3. User Input:

a. Quantity of bearings

b. Selection of size and material combination

4. Cost of Shipping/Handling is:

a. $3.50 per pound for copper

b. $4.50 per pound for Gold and Silver

Instructions

1. Develop and test the program such that it:

a. Generates the desired input screen as proposed by the distribution director. (See exhibit A).

b. Clears the display screen after the data from the user is gathered. (use the command: system(cls); from library stdlib.h)

c. Display the output per the screen proposed by the distribution director. (see exhibit B)

2. Document your code and include your source information for the density values of the materials used (copper, gold and silver).

3. Include the necessary error checking. If an error is detected, display an error message stating the issue, such as ERROR Invalid quantity! or ERROR Invalid Selection!

EXHIBIT A Proposed Input

** ACME WIDGET PARTS COMPANY **
** Distribution Department **
** Bearing Selection Program **
** SELECT Option Number **

1) Copper: Small
2) Copper: Medium
3) Copper: Large
4) Gold: Small
5) Gold: Medium
6) Gold: Large
7) Silver: Small
8) Silver: Medium
9) Silver: Large

Input Selection Number >
How Many Require Shipping? >

See figure: see image.

EXHIBIT B Proposed Output

** ACME WIDGET PARTS COMPANY **
** Distribution Department **
** Bearing Selection Program **
** SHIPPING COST DISPLAY **

Quantity of bearings shipped: XXXX
Size and material of bearings is: Size Material
Shipping cost of item selected is: $xxxxx.xx
Total Weight of this order is: XXXXX.XX pounds

See figure: see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.