Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. For the following, how do I find the error and translate it into C++? a) Module main() Declare Real mileage Call getMileage() Display You've

1. For the following, how do I find the error and translate it into C++?

a)

Module main()

Declare Real mileage

Call getMileage()

Display "You've driven a total of ", mileage, " miles."

End Module

Module getMileage()

Display "Enter your vehicle's mileage."

Input mileage

End Module

b)

Module main()

Call getCalories()

End Module

Module getCalories()

Declare Real calories

Display "How many calories are in the first food?"

Input calories

Declare Real calories

Display "How many calories are in the second food?"

Input calories

End Module

------------------------------

Here is my progress so far.

image text in transcribed

main.cpp saved #include 4 using namespace std; 6 duuble germileaget 8 double mileage; 9 cout> mileage ; 11 return mileage; 12 13 14 int main() 15 16 getMileage) 17 double mileage; 18 cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

ISBN: 061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago