Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing this C++ code for my CS homework, I've already tried it myself but am having no luck. Summary: compute wing loading

I need help writing this C++ code for my CS homework, I've already tried it myself but am having no luck.

Summary: compute wing loading value based on aircraft's weight and wing area

An important design factor in aeronautical engineering is wing loading, defined as the weight of an airplane divided by its wing area. Low wing loading provides more maneuverability, but a bumpier, less comfortable flight; hang gliders have low wing loading. High wing loading is more fuel efficient and provides a more comfortable ride, but the plane is less maneuverable; commercial jetliners have high wing loading.

Write a C++ program to input two values, the weight of an airplane followed by its wing area, compute the wing loading value, and output two results: (1) the wing loading value, followed by (2) low, average, or high low if the wing loading value is less than 20.0, high if the wing loading value is greater than 600.0, otherwise average. Assume the input units are kilograms for the weight, and meters squared for the area.

Example: suppose the inputs to the program are the following (weight then wing area):

130.6 13.7 

The output should be:

9.53285: low 

There is one space following the ":", and the output should appear on a line by itself (i.e. follow with endl). It is possible for one or both inputs to be negative, in which case the computation makes no sense --- in this case output "invalid data!" at most once. For example, suppose the inputs are

1200.50 -10.00 

The output should be

invalid data! 

This implies the program has exactly one output: either "invalid data!", or the wing loading value followed by low, average, or high.

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

Step: 3

blur-text-image

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

Have roles been defined and assigned?

Answered: 1 week ago