write this program Al's Last Chance Gas station sits on Route 190 on the edge of Death
Fantastic news! We've Found the answer you've been seeking!
Question:
write this program
Transcribed Image Text:
Al's Last Chance Gas station sits on Route 190 on the edge of Death Valley. There is no other gas station for 200 kilometers. You are to write a program to help drivers decide if they need gas or if it is safe to carry on. The program asks for: • The capacity of the gas tank in liters a double value. The car's mileage (kilometers per liter) a double value An integer value for determining the amount of gas currently in the gas tank as follows: (100- gas tank is full, 75 - the gas tank is three quarters full, 50 - the gas tank is half full, 25- the gas tank is quarter full and 0 - if the gas tank is almost empty). Based on what the user's input above, the program then writes out "Get Gas" or "Safe to Proceed" depending on if the car can travel the 200 kilometers with the gas remaining in the tank. Sample Run: Enter Your tank capacity in liters: 12 Enter Your car's mileage (kilometers per liter): 30 Enter Gas remaining in tank as a percent: 50 Distance the car will travel before it runs out of gas is: 180 km. >>>> YOU SHOULD GET GAS <<<< Al's Last Chance Gas station sits on Route 190 on the edge of Death Valley. There is no other gas station for 200 kilometers. You are to write a program to help drivers decide if they need gas or if it is safe to carry on. The program asks for: • The capacity of the gas tank in liters a double value. The car's mileage (kilometers per liter) a double value An integer value for determining the amount of gas currently in the gas tank as follows: (100- gas tank is full, 75 - the gas tank is three quarters full, 50 - the gas tank is half full, 25- the gas tank is quarter full and 0 - if the gas tank is almost empty). Based on what the user's input above, the program then writes out "Get Gas" or "Safe to Proceed" depending on if the car can travel the 200 kilometers with the gas remaining in the tank. Sample Run: Enter Your tank capacity in liters: 12 Enter Your car's mileage (kilometers per liter): 30 Enter Gas remaining in tank as a percent: 50 Distance the car will travel before it runs out of gas is: 180 km. >>>> YOU SHOULD GET GAS <<<<
Expert Answer:
Answer rating: 100% (QA)
C program to input the tank capacity car mileage and current gas remaining and display a message bas... View the full answer
Related Book For
Microeconomics
ISBN: 9781464146978
1st Edition
Authors: Austan Goolsbee, Steven Levitt, Chad Syverson
Posted Date:
Students also viewed these programming questions
-
Write an outline for this section of the training program Be sure to address the characteristics of the perceiver the target and the situation as well as any barriers that might need to be considered
-
write this program in python example Project 1 *ensure you have read course policies in D2L shell Required python aspects for this project Pseudocode Submission of code in D2L (pseudocode is in a...
-
Write a computer program that will calculate the optimum value of the orbital exponent k for the H+2 trial function (13.54) for a given R value. Have the program calculate W1 + 1/R [where W1 is given...
-
What are conjugate faults, and what stress information do they give?
-
Why should auditors develop an understanding of a client's control environment as it affects the accounts in the revenue cycle?
-
The water in a 25-m-deep reservoir is kept inside by a 150-m-wide wall whose cross section is an equilateral triangle, as shown in Fig. P11??49. Determine (a) The total force (hydrostatic +...
-
The account balances for the year ended December 31,2010, for Williams Industries are listed next: Requirements 1. Calculate the gross profit percentage for Williams Industries for the year. 2. The...
-
The financial statements of Marks and Spencer plc (M&S) are available at the books companion website or can be accessed at corporate.marksandspencer....
-
2. Full-service financial firms provide a wide variety comprehensive financial services, including retail and commercial banking, insurance, and investment banking, etc. In the past 90 years, the...
-
Meg McIntyre opened a public relations firm called Pop Chart on August 1, 2024. The following amounts summarize her business on August 31, 2024: During September 2024, the business completed the...
-
You know the prices of the following bonds, each of which pays coupons annually, and each of which will pay its next coupon in exactly one year: Name Coupon Maturity Price (years) A 1% 4 92.57 B 5% 4...
-
1. Given the following NFA over the alphabet = {a,b}, a) Convert it into its equivalent DFA. b) Give an informal description in English of what language these finite automata accept. a a 3 a,b 2
-
York's outstanding stock consists of 90,000 shares of cumulative 7.0% preferred stock with a $5 par value and also 160,000 shares of common stock with a $1 par value. During its first four years of...
-
Given the following compressed HTML, would applying position:relative; to the first div, after rendering, change the layout rendering in any way?...
-
Evaluate the integral. (Use C for the constant of integration.) 1 dx (+2 +4x+5)
-
Q4. Let m(t) = rect (9t) +2 cos(6mt) to be carried to fe = 100Hz. Sketch the magnitude spectrum of the modulated signal when the following schemes are used: (a) Classical AM (b) DSB-SC (c) SSB-SC...
-
If a tenant has a termination option is it better for the LANDLORD for that right to be Rolling or One Time? a)Rolling b)One Time If a tenant has a termination option is it better for the TENANT for...
-
In Exercises evaluate the limit, using LHpitals Rule if necessary. lim 07x cos x X
-
In the early days of navigation, sailors had a tough time figuring out exactly where they were. Pinpointing latitude was easy enough with a sextant, but because the earth was constantly spinning,...
-
The graph below depicts the market for aloe vera gel. The left-hand panel depicts market demand and industry supply; the right-hand panel depicts the long-run cost curves for a representative firm in...
-
Malachi only consumes 2 goods: DVD rentals and coffee. His utility function is U(R,C) = R0.75C0.25 where R is the number of rentals and C is cups of coffee. Malachi has $16 in his pocket right now,...
-
A shaft running at \(500 \mathrm{rpm}\) carries a pulley \(1 \mathrm{~m}\) diameter and drives another pulley by means of ropes with a speed ratio of 2:1. The drive transmits \(200 \mathrm{~kW}\)....
-
A flat belt drive is required to transmit \(20 \mathrm{~kW}\) at \(300 \mathrm{rpm}\) of \(2 \mathrm{~m}\) diameter pulley. The angle of contact is \(170^{\circ}\) and coefficient of friction between...
-
If the difference between tight and slack side tensions for a leather belt does not exceed \(100 \mathrm{~N} / \mathrm{cm}\) of width for a belt \(5 \mathrm{~mm}\) thick, find the maximum stress in...
Study smarter with the SolutionInn App