For Exercises 3.16-3.20, perform each of these steps:
- Read the problem statement.
- Formulate the
algorithm using pseudocode and top-down, stepwise refinement. - Write a C
program . - Test, debug and execute the C program.
(Gas Mileage) Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording miles driven and gallons used for each tankful. Develop a program that will input the miles driven and gallons used for each tankful. The program should calculate and display the miles per gallon obtained for each tankful. After processing all input information, the program should calculate and print the combined miles per gallon obtained for all tankfuls. Here is a sample input/output dialog:
Learn your wayIncludes step-by-step video
Chapter 3 Solutions
C How to Program (8th Edition)
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Concepts of Programming Languages (11th Edition)
Starting out with Visual C# (4th Edition)
Starting Out With Visual Basic (7th Edition)
Problem Solving with C++ (9th Edition)
Starting Out with Python (4th Edition)
- (General math) The value of p can be approximated by this series: 4(113+1517+....) Using this formula, write a program that calculates and displays the value of , using 2, 3, and 4 terms of the series.arrow_forward9. Given a list daily temperatures for a certain number of days, design an algorithm to determine the maximum temperature. The first input is the number of days. a) Identify the input-process-output (IPO) for this problem. b) Write a pseudo code to demonstrate the step-by-step process of the algorithm.arrow_forwardUSE PYTHON PLEASE (give the same output as the instruction given) Program Specifications Write a program to calculate a course grade given points for homework, quizzes, practice question, and Survey. Grades are calculated differently for undergrads, grads and distance learners.Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.Step 1 Read from input student status (str). If input is not one of "UG" (undergrad), "G" (grad), or "DL" (distance learner), print an error message and exit the program. Otherwise read from input floats for homework points, quiz points, Practice score, and Survey score. Calculate each category's average using maximum points for homework (800), quizzes (400), Practice question (150), and Survey (200). Output category averages as a percentage using print(f"Homework: {homework:2.1f}%"). Submit for grading to confirm two…arrow_forward
- c program with algorithm and flowchart to calculate the energy bill. read the starting and ending meter reading.the charges are as follows no; of units consumed - rate in rupees 1.) 200-500 3.50 2.)100-200 2.50 3.) 0-100 1.50arrow_forward3 This is Discreet math please answer questions with proper formatting for proofsarrow_forwardfill in the blanks a) The solution to any problem involves performing a series of actions in a specific …….b) A synonym for procedure is ……..c) A variable that accumulates the sum of several numbers is a ……..arrow_forward
- How to fix?arrow_forwardIdentify which type of algorithmic operation each one of the following steps belongs to a Get a value for x from the user. b. Test to determine if x is positive. If not, tell the user that he or she has made a mistake. c. Take the cube root of x. d. Do Steps 1.1, 1.2, and 1.3 x times.arrow_forwardMake a flowchartarrow_forward
- Please solve it, I have to turn in my homework in an hourarrow_forwardC# Program, Thank youarrow_forwardProblem 2: Multiple stages There are only two rest days in the Tour de France. You will now write a program to calculate the remaining distance before the rest day after each stage. Riders will rest after they finish the fifth stage.Your program will read five distances AS INTEGERS, one for each stage in order. After, you will read the total time of all five days. You will then print how many kilometres are left after each stage and the rider's average speed (in km/h) after all inputed stages, according to the example below.InputYou will read from the use the following (in order):• 5 distances one of each stage• The rider's total time across all stagesOutputEnd of first stage, {distance}km left until rest dayEnd of second stage, {distance}km left until rest dayEnd of third stage, {distance}km left until rest dayEnd of fourth stage, {distance}km left until rest day--REST--Average speed across the five days: {speed} km/hExample:Input Output…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning