Write down a function that uses a switch statement

Assignment Help Computer Engineering
Reference no: EM1336950

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.

Reference no: EM1336950

Questions Cloud

Write a function that uses a switch statement : Write down a function that uses a switch statement to determine the number of the nearest cross street for a given address and avenue number according to the preceeding alogorithm. Then write a program to test your function.
In a monopolistically competitive marketplace : In a monopolistically competitive marketplace, a firm has market power because it produces a differentiated product. This means that the firm earns positive economic profit in the long run.
Calculating annual holding cost rate : Calculate the annual holding cost rate for FFF?
Can the brand of products impact buyers attitude : Can the BRAND of products from certatin countries impact buyers attitude towards the goods or services? Explain you answer with examples.
Write down a function that uses a switch statement : An airline vice president in charge of operations needs to find out 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 larg..
Question on capital structure and leverage : Millman Electronics will produce 60,000 stereos next year. Varibable costs will equal 50% of sales-what price must each widget be sold for the company to achieve an EBIT
Suppose that the accident at chernobyl had no effect : You should suppose that the accident at Chernobyl had no effect on the price of hot dogs or Jane's preference of caviar.
Article of medical negligence online : Find a published case or article of Medical Negligence online. Research and 2 pages double space report. Must include the following guidelines in the research: Was there an apparent failure for the medical care practitioner to provide services rend..
Calculating completion time for the project : Calculate the completion time for the project. (Completion time = weeks)

Reviews

Write a Review

Computer Engineering Questions & Answers

  Show the corresponding number

Using a loop and a single printlng statement, show all of the values (both strings and integers) in a table.

  How to identify a task you perform regularly

define the architectural differences between the object-oriented and structured designs. Which of the designs makes more sense to you? Why?

  How the main memory address format look

How the main memory address format look.

  This database file should be saved as a zip file

Professional Litigation User Services (PLUS) is a company that designs all types of visual aids for judicial proceedings. Clients are usually private law firms, although the District Attorney's office has occasionally contracted for its services.

  Creating a source documents on access 2010

Explain how to generate a source documents on the access 2010 with the information to involve the password, user ID, name, telephone, address, item number, e-mail address, bid offered, and method of payment.

  What is mno

What is MNO.

  How to calculate the area of a circle

Your employer has requested the development of a software application to compute the area of a circle. The application must accept only one value (i.e., the radius), and it must display the result in decimal value.

  Evaluates and contrast tcp and ud

Describe the need for the Transport Layer. Recognize the role of the Transport Layer as it provides the end to end transfer of data between applications.

  What is the variety of addresses available in each networks

What is the variety of addresses available in each  networks

  Would it always be the result of one''s experience

How do you envision the ways program verification and performance tuning will be accomplished in the future? Will it still be a work of art? Will it always be the result of one's experience? Or do you forecast more and more automatic ways (algorit..

  How pert may be used for strategic decision making

Based on the article "One Application for Using PERT Methodology in Strategic Decisions," write down a memo to your CIO recommending how PERT may be used for strategic decision making and assisting project managers who need to deal with complex pr..

  Define a point made by a classmate

What rights to privacy do people have while using the Internet at home? Are their privacy rights limited? Do those same rights and limits exist at work? Explain your answer.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd