Write a program that determines which of a company's four divisions (Northeast, Southeast, Northwest, and Southwest)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that determines which of a company's four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for a quarter. It should include the following two functions, which are called by main: double getSales () is passed the name of a division. It asks the user for a division's quarterly sales figure, validates the input, then returns it. It should be called once for each division. void findHighest () is passed the four sales totals. It determines which is the larg- est and prints the name of the high-grossing division, along with its sales figure. Input Validation: Do not accept dollar amounts less than $0.00. EX #2 Write a program that determines which of five geographic regions within a major city (north, south, east, west, and central) had the fewest reported automobile accidents last year. It should have the following two functions, which are called by main: int getNumAccidents() is passed the name of a region. It asks the user for the number of automobile accidents reported in that region during the last year, vali- dates the input, then returns it. It should be called once for each city region. void find Lowest() is passed the five accident totals. It determines which is the smallest and prints the name of the region, along with its accident figure. Input Validation: Do not accept an accident number that is less than 0. EX #3 When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d = 1/2gt² The variables in the formula are as follows: d is the distance in meters, g is 9.8, and f is the amount of time, in seconds, that the object has been falling. Write a function named falling Distance that accepts an object's falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 through 10 as arguments and displays the return value. Write a program that determines which of a company's four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for a quarter. It should include the following two functions, which are called by main: double getSales () is passed the name of a division. It asks the user for a division's quarterly sales figure, validates the input, then returns it. It should be called once for each division. void findHighest () is passed the four sales totals. It determines which is the larg- est and prints the name of the high-grossing division, along with its sales figure. Input Validation: Do not accept dollar amounts less than $0.00. EX #2 Write a program that determines which of five geographic regions within a major city (north, south, east, west, and central) had the fewest reported automobile accidents last year. It should have the following two functions, which are called by main: int getNumAccidents() is passed the name of a region. It asks the user for the number of automobile accidents reported in that region during the last year, vali- dates the input, then returns it. It should be called once for each city region. void find Lowest() is passed the five accident totals. It determines which is the smallest and prints the name of the region, along with its accident figure. Input Validation: Do not accept an accident number that is less than 0. EX #3 When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d = 1/2gt² The variables in the formula are as follows: d is the distance in meters, g is 9.8, and f is the amount of time, in seconds, that the object has been falling. Write a function named falling Distance that accepts an object's falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 through 10 as arguments and displays the return value.
Expert Answer:
Related Book For
Auditing a business risk appraoch
ISBN: 978-0324375589
6th Edition
Authors: larry e. rittenberg, bradley j. schwieger, karla m. johnston
Posted Date:
Students also viewed these computer network questions
-
Write a program that determines which of a companys four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for a quarter. It should include the following two...
-
Write a program that determines which of the 6 states had the most traffic tickets last year. The 6 states are California, Georgia, Alabama, Illinois, Michigan, and Florida. The program should have...
-
Question 4 Tic-tac-toe (also known as noughts and crosses) is a game for two players, X and O, who take turns marking the spaces in a 3x3 grid. The player who succeeds in placing three of their marks...
-
Two crates, A and B, sit at rest side by side on a frictionless horizontal surface. The crates have masses mA and mB. A horizontal force F is applied to crate A and the two crates move off to the...
-
How does the efficient set change when riskfree borrowing and lending are introduced into the Markowitz model? Explain with words and graphs.
-
Are the input specifiers for scanf() identical to the output specifiers for printf()?
-
(EPS with Convertible Bonds and Preferred Stock) On January 1, 2010, Lindsey Company issued 10-year, $3,000,000 face value, 6% bonds, at par. Each $1,000 bond is convertible into 15 shares of Lindsey...
-
. Do policies exist within the Linux workstation or server environment? If so, what are they? . Are there ways that Windows policies can be leveraged to enhance corporate or security policy?
-
For each of the following three employees calculate gross earnings, CPP contributions, EI premiums, income taxes, and net pay after these statutory withholdings. All employees are in British...
-
Congratulations on your appointment as manager of operations for Trans-Global Corporation in Vancouver. The date is January 5, 2020. As you settle into your new office, your secretary tells you that...
-
a. What kinds of damage are included in the category of environmental hazards? b. What control plans are designed to prevent such hazards from occurring? c. What control plans are designed to limit...
-
Develop a research paper on the use of the Internet to support EDI between companies. Your paper should consider how companies set up communications over the Internet to maintain the same security...
-
What is the purpose of testing the entire system as opposed to testing part of the system?
-
Briefly discuss the cumulative distribution function of the uniform distribution presented in Fig. 9.2. Fig. 9.2 1.0 .9 .8 .7 .6 .5 .4 .3 .2 .1 P(X x) TT 0 A 5 B 10 15 D 20 Se
-
What is an entity in an entity-relationship model (E-R model)? How does it differ from the concept of entity used in creating data flow diagrams?
-
Hanbridge Inc. observes a mixed cost at two activity levels. The cost is $2000 when 100 units are produced and $3000 at 200 units. What is the variable cost per unit? A. $5 B. $10 C. $15 D. $20...
-
Complete the equations for the following equilibria and calculate Keq where the Keq expression includes [HO]. Be sure to enter Keq in proper scientific notation. (a) ammonia (acting as a base) reacts...
-
A staff auditor of Earache & Diamond, CPAs, has prepared the following draft of an audit report on cash basis financial statements: Accountants Report to the Shareholders of Halon Company: We have...
-
Dot-com companies grew rapidly in the late 1990s. Many opened up shopping malls through which they serve as a portal into several different companies. The SEC has expressed concerns about revenue...
-
What words and phrases in an unqualified audit report imply that there is a risk that the financial statements may contain a material misstatement?
-
Consider the following time series data. a. Construct a time series plot. What type of pattern exists in the data? b. Show the four-quarter and centered moving average values for this time series. c....
-
The following table reports prices and usage quantities for two items in 2009 and 2011. a. Compute price relatives for each item in 2011 using 2009 as the base period. b. Compute an unweighted...
-
Refer to exercise 35. a. Deseasonalize the time series using the adjusted seasonal indexes computed in part (c) of exercise 35. b. Using Minitab or Excel, compute the linear trend regression equation...
Study smarter with the SolutionInn App