The MidAmerica Bus Company charges fares to passengers based on the number of travel zones they cross.
Question:
The MidAmerica Bus Company charges fares to passengers based on the number of travel zones they cross. Additionally, discounts are provided for multiple passengers traveling together. Ticket fares are shown in Table 8-5.
Develop the logic for a program that accepts the number of passengers and zones crossed as input. The output is the ticket charge.
Transcribed Image Text:
Passengers 1 2 3 4 Table 8-5 0 7.50 14.00 20.00 25.00 Bus fares Zones Crossed 2 12.00 22.00 32.00 36.00 1 10.00 18.50 21.00 27.50 3 12.75 23.00 33.00 37.00
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 63% (11 reviews)
if zonesCrossed 0 if passengers 1 SystemoutprintlnThe fare is ...View the full answer
Answered By
Dennis Nyangau
I have been tutoring for several years now, and I absolutely love it! I love being able to help students one-on-one and see them succeed. It is so gratifying to see a student understand a concept that they were struggling with before. I also enjoy getting to know my students and helping them to reach their full potential.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
The base ticket price for Cloudliner Airlines is determined by the distance traveled and the day of the week a passenger is traveling. In addition, the airline adjusts its ticket prices based on a...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
ABC Company produces and sells I product. Once the products are produced, they are sold, and there is no work-in- process, no any inventory in stock. Company uses standard costing method in its...
-
A paint manufacturer is experimenting with an additive that might make the paint less chalky. To ensure that the additive does not affect the tint, a quality-control engineer takes a sample from each...
-
On the same figure, graph national saving and investment as fractions of real GDP, using quarterly U.S. data since 1947. (Note that national saving is called gross saving in the FRED database.) How...
-
Hooke's law is obeyed up to the (a) Yield point (b) Ultimate point (c) Breaking point (d) Limit of proportionality
-
The Rustic Welt Company is proposing to replace its old welt-making machinery with more modern equipment. The new equipment costs $10 million and the company expects to sell its old equipment for $1...
-
On April 30, 2025, the market price of Seabury Occupational Therapy, Inc.'s common stock was $13 per share and the company declared a 5% stock dividend. The stock was distributed on May 15. Read the...
-
Tory Enterprises pays $238,400 for equipment that will last five years and have a $43,600 salvage value . By using the equipment in its operations for five years, the company expects to earn $88,500...
-
In golf, par represents a standard number of strokes a player needs to complete a hole. Instead of using an absolute score, players can compare their scores on a hole to the par figure. Families can...
-
a. The Palmertown Elementary School has 30 classrooms. The children in the school donate used books to sell at an annual fundraising book fair. Write a program that accepts each teachers name and the...
-
You are excited because your employer has offered you a promotion, with an increased salary. But it will mean you must relocate to Vancouver and you are concerned because you have heard a lot about...
-
Student, Inc. had $330,000 in 2023 taxable income. Using the graduated rate table\ below,\ a. Calculate Student, Inc.s income tax liability.\ b. What is Student, Inc.s average tax rate?\ c. What is...
-
1. Calculate the density of a rock that weights 4.56grams and has a volume of 2.88 cm 3. 2. A nail weighing 7.88 grams is placed in a graduated cylinder containing 22.35 mL of distilled water. When...
-
Charlize Theron and her daughter are on a seesaw in the park. How far from the center must 111 lb Char- lize sit in order to balance the 48 lb daughter sitting 5 ft from the center? Answer in units...
-
As a strategist you are required to undertake a task and submit a consultancy paper to the Board of Directors of a Multinational Company that seeks to learn strategy lessons from the Ghanaian...
-
The following income statement items appeared on the adjusted trial balance of Schembri Manufacturing Corporation for the year ended December 31, 2024 ($ in thousands): sales revenue, $18,300; cost...
-
Draw a diastereomer for each of the following a. b. c. d. CH H-OH 8 CH3CH2 CH3 H3C CH3 -
-
For the following exercises, find the inverse of the function and graph both the function and its inverse. f(x) = 4 x 2 , x 0
-
Suppose you have declared an array as follows: int[] creditScores = {670, 720, 815}; What is the value of creditScores.length? a. 0 b. 1 c. 2 d. 3
-
If a class named Student contains a method setID() that takes an int argument, and you write an application in which you create an array of 20 Student objects named scholar, which of the following...
-
A parallel array is one that ____________. a. Holds values that correspond to those in another array b. Holds an even number of values c. Is placed adjacent to another array in code d. Is placed...
-
The increasing volatility in the global economy has caused investors to seek out safer investments alternatives. Risk is inevitable in all investments. A capital budget is used to help investors plan...
-
You invest 50% of your financial assets in the Vanguard Total Stock Market ETF (VTI) and 50% in the Vanguard Total Bond Market ETF (BND). VTI has an expected return of 8% and a standard deviation of...
-
You have found the car you would like to purchase. The negotiated price = $57,500 and you are taking out a loan with a 7.5% APR compounded monthly for 6 years. What are your monthly payments? Car...
Study smarter with the SolutionInn App