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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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