Asked Jan 28, 2020

// This pseudocode is intended to compute the number
// of miles per gallon you get with your automobile.
   input milesTraveled
   input gallonsOfGasUsed
   milesPerGallon = milesTraveled + gallonsOfGas
   output milsperGallon


Expert Answer

Step 1

The given pseudocode to compute the number of miles per gallon is wrong.

The corrected pseudocode is as follows:


input milesTraveled
input gallonsOfGasUsed
set milesPerGallon = milesTraveled / gallonsOfGasUsed
output milesPerGallon



Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in


Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: Users can request certificates that aren't configured for autoenrollment by using the Certificates s...

A: The given statement is true i.e. By using the snap-in Certificates, users can request certificates t...


Q: Write a Python if expression that evaluates as True if num is an exact multiple of 7.

A: In this question following variables and condition is required to solve :Variables: numCondition: if...


Q: im not knowin the meaning of derived attribute and identifying atrribute

A: Entities are defined by their properties, called attributes. All attributes have meanings, such as t...


Q: In C++: Menu driven conversion program. Write a menu-driven program to convert measurements from mil...

A: Program Algorithm-STARTStep1 Import essential headers.Step2 Define main functionStep3 Declare variab...


Q: Write a program in Python that lets the user enter the total rainfall for each of 12 months into a l...

A: Program Instructions:Declare a list with months and use this list to get rainfall for each month.App...


Q: Create a class of students that should contain fields like rollno,name,subject and marks?

A: Programming language assumed is C++:Class:A C++ class is the building block, which contributes to th...


Q: IS THERE AN IMPORT.JAVA."SOMETHING"  for /= or /+ ++ that works for java besides math for math, like...

A: “No”, the statement import java.“SOMETHING” does not exist in Java.


Q: Which accounts look like administrative accounts but aren’t actually administrative accounts? Group...

A: Honeytoken: Honeytoken account is a fake account or non-interactive account. In Active Directory, yo...


Q: C++ please

A: Program Instructions:Create function NumOfNodesDivisibleBy3() that takes the root node and returns t...