Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

no break or continue statements only use these prepossor directives #include #include only use a while loop. The First Program: cargo.c This program will first

image text in transcribed

no break or continue statements

only use these prepossor directives #include #include only use a while loop.

The First Program: cargo.c 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

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_2

Step: 3

blur-text-image_3

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

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

=+ Are they breakable for any reason?

Answered: 1 week ago