Question: c programming language This program will first input the total capacity weight of a cargo ship that is being loaded. Then the program will input

c programming language
This program will first input the total capacity weight of a cargo ship that is being loaded. Then the program will input the weights of shipping containers being loaded onto a ship. You must keep track of the total weight that has been loaded, the number of containers that have been loaded. Also, you must make sure that the total weight loaded does not exceed the weight capacity of the ship. Note: weight units are tons and all weight data is floating point data . . . Requirements: Follow documentation and style guidelines for the course (see PA 1). Input the ship's total capacity weight. Input the shipping container weights one at a time. If the input weight is negative or zero, ignore it. Do not use the weight in calculations and do not print an error message. If the input weight will cause the total to exceed the ships weight capacity, do not use the weight in calculations. Display the message "The ship is full." You must use a while loop. DO NOT use the break or continue statements. When the ship is full, display the 1) ship's weight capacity 2) number of containers loaded 3) total weight loaded Remember to include meaningful text with all output. Testing Suggestions: Create a data file named containers.txt (or whatever you want to call it). When you run your program, use input redirection. ./cargo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
