do the following: - A or a to add a container. - D or d to delete a container. - R or r to retrieve the information of one container. - T or t to retrieve the
Create a program in C that stores the information of up to 25 containers loaded on ship.
Ask the user for the number of containers to be loaded. If the user enters a number of containers
greater than 25 or less than 3, then re-prompt for the container number until an acceptable number is
entered.
Create an array of floats with six rows and a number of columns equal to the number of containers
provided by the user
Display a menu to do the following:
- A or a to add a container.
- D or d to delete a container.
- R or r to retrieve the information of one container.
- T or t to retrieve the information of all containers.
- W or w to retrieve the total weight of the loaded containers.
- C or c to retrieve the total cubic volume of the containers loaded on the ship (array).
- V or v to retrieve the total value of the containers loaded on the ship.
- X or x to exit the program
Option A: for this option check if the array has an empty column to enter the information for a
container, if not, output a message indicating that array is full. If array is not full, ask the user for the ID
number, length in meters, width in meter, height in meters, weight in Kg, and value in dollars of the
container and store them in the first available column in the array.
Option D: Ask the user for the ID of the container to be deleted. If the ID exist in the array then set all
the values in the corresponding column to zero. If the ID does not exist in the array, output an
appropriate msg.
Option R: Ask the user for the desired ID number to be searched. If found, output the ID number, length
in meters, width in meter, height in meters, weight in Kg, and volume in cubic meters of the container
each on a line. If not found, display a message to that effect.
Container ID: 1234
Length: 6.50 meters
Width: 3.65 meters
Hight: 4.00 meters
Weight: 3282.58 Kg
Volume: 94.90 meters cube
info retrieved and calculated should be the same as the above step.
Option W: display the total weight of all the containers in the array.
Option C: display the total volume of all the containers in the array.
Option V: display the total value of all the containers in the array.
Option X: Exit the program
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images