Checkout
checkout
view
Your Cart Your Cart: item(s)
Subjects -> Computer Science -> Other -> Posting #31585
Add to Shopping Cart
$2.19 Instant Download
Computer Science, Other
Year 3

Programming Problem (Selection)


An airline vice president in charge of operations needs to determine whether the current estimates of flight times are accurate.  because there is a larger possiblity of variations due to wether and air traffic in the longer flights, he allows a larger error in the time estimates for them.  He compares an actual flight time with the estimated flight time and considers the estimate to be too large, acceptable, or too small, depending on the following table of acceptable error margins:

Estimated flight time in minutes           Acceptable error margin in minutes
0-29                                                    1
30-59                                                  2
60-89                                                  3
90-119                                                4
120-179                                               6
180-239                                               8
240-359                                              13
360 or more                                        17

For example, if an estimated flight time is 106 mins, the acceptable error margin is 4 mins.  Thus, the estimated flight time is too large if the actual flight time is less than 102 mins, or the estimated flight time is too large if the actual flight time is greater than 110 mins; otherwise, the estimate is acceptable.
Write a function that uses a switch statement to determine the acceptable error for a given estimated flight time, according to this table.  Use the function in a program that reads an estimated flight time and an actual flight time and then determines whether the estimated time is too large, acceptable, or too small.  If the estimated flight time is too large or too small, the program should also print the amount of the overestimate or underestimate.

By OTA:  Joe Lee, MS

OTA Rating:  4.6/5

Your Price:  $2.19  (original value ~$7.98)

What's included:

  • Plain text response
  • Attachment(s):
    • switch.cpp
$2.19 Download Add to Cart

Add to Shopping Cart
$2.19 Instant Download
Programming Problem (Selection) - Given: To locate the nearest numbered cross street for a given avenue address, the following algorithm can be used: cancel the last diget of the address, divide by 2, and add or subtract the number given in the following abbreviated table: 1st Ave. add 3 2nd Ave. add 3 3rd Ave. ...
Programming Problems (Selection) - Write a function convertLength() that receives a real value and two strings inUnits and outUnits, then converts the value given in inUnits to the equivalent metric value in outUnits and displays this value. The function should carry out the following conversions: inUnits outUnits I c (inches to centimeters; 1 in. = ...
Functions - The graph of a person's emotional cycly y=f(x) is a sinc curve having an amplitude of 1 and a period of 28 days. On a given day, the person's emotional index is f(age), where age is his or her age in days. Similarly, the physical and intellectual cycles are sine curves having an amplitude of 1 and periods of 23 and 33 days, respectively. Write a function that receives a person's a...
Files and Streams - People from three different income levels, A, B, and C, rated each of two different products with a number 0 through 10. Construct a file in which each line contains the income level and product rankings for one respondent. Then write a program tht reads this information and calculates the following: a. for each income bracket, the average rating for product 1; b. the numbe...
Using Classes - Revernd Zeller developed a formula for computing the day of the week on which a given date fell or will fall. Suppose that we let a, b, c, and d be integers defined as follows: a = the number of a month of the year, with March = 1, April = 2, and so on, with January and February being counted as months 11 and 12 of the preceeding year. b = the day of the month c = the year of t...

Page generated in 0.0574 seconds

About Us ·  Contact Us ·  Samples ·  Solutions ·  Legal Terms and Conditions ·  Privacy Policy

©2008 SolutionLibrary.com

Search for Solutions About Us Samples