Getting the errors: 29 C:\\Dev-Cpp\\main_pp4_1.cpp expected unqualified-id befor
ID: 3617011 • Letter: G
Question
Getting the errors: 29 C:Dev-Cppmain_pp4_1.cpp expected unqualified-id before'{' token 29 C:Dev-Cppmain_pp4_1.cpp expected `,' or `;' before '{'token C:Dev-CppMakefile.win [Build Error] [main_pp4_1.o] Error 1Here is the program:
#include <iostream>
using namespace std;
double const LIT = 0.264179; double mpg(int miles, int litres);
int main () { char choice; int litres, miles; do { cout << "Enter amount of Gasoline inLitres: "; cin >> litres; cout << "Enter the distance travelledby the car in miles: "; cin >> miles; cout << "The number of miles pergallon the car delivered is " << mpg(miles, litres) <<endl; cout << "Press 'q' to repeatcalculations. "; cin >> choice; } while (choice =='q' || choice =='Q'); system("PAUSE"); return 0; } double mpg(int miles, intlitres); { double gallons; gallons = LIT * litres; return (miles/gallons); }
29 C:Dev-Cppmain_pp4_1.cpp expected unqualified-id before'{' token 29 C:Dev-Cppmain_pp4_1.cpp expected `,' or `;' before '{'token C:Dev-CppMakefile.win [Build Error] [main_pp4_1.o] Error 1
Here is the program:
#include <iostream>
using namespace std;
double const LIT = 0.264179; double mpg(int miles, int litres);
int main () { char choice; int litres, miles; do { cout << "Enter amount of Gasoline inLitres: "; cin >> litres; cout << "Enter the distance travelledby the car in miles: "; cin >> miles; cout << "The number of miles pergallon the car delivered is " << mpg(miles, litres) <<endl; cout << "Press 'q' to repeatcalculations. "; cin >> choice; } while (choice =='q' || choice =='Q'); system("PAUSE"); return 0; } double mpg(int miles, intlitres); { double gallons; gallons = LIT * litres; return (miles/gallons); }
Here is the program:
#include <iostream>
using namespace std;
double const LIT = 0.264179; double mpg(int miles, int litres);
int main () { char choice; int litres, miles; do { cout << "Enter amount of Gasoline inLitres: "; cin >> litres; cout << "Enter the distance travelledby the car in miles: "; cin >> miles; cout << "The number of miles pergallon the car delivered is " << mpg(miles, litres) <<endl; cout << "Press 'q' to repeatcalculations. "; cin >> choice; } while (choice =='q' || choice =='Q'); system("PAUSE"); return 0; } double mpg(int miles, intlitres); { double gallons; gallons = LIT * litres; return (miles/gallons); }
Here is the program:
#include <iostream>
using namespace std;
double const LIT = 0.264179; double mpg(int miles, int litres);
int main () { char choice; int litres, miles; do { cout << "Enter amount of Gasoline inLitres: "; cin >> litres; cout << "Enter the distance travelledby the car in miles: "; cin >> miles; cout << "The number of miles pergallon the car delivered is " << mpg(miles, litres) <<endl; cout << "Press 'q' to repeatcalculations. "; cin >> choice; } while (choice =='q' || choice =='Q'); system("PAUSE"); return 0; } double mpg(int miles, intlitres); { double gallons; gallons = LIT * litres; return (miles/gallons); }
#include <iostream>
using namespace std;
double const LIT = 0.264179; double mpg(int miles, int litres);
int main () { char choice; int litres, miles; do { cout << "Enter amount of Gasoline inLitres: "; cin >> litres; cout << "Enter the distance travelledby the car in miles: "; cin >> miles; cout << "The number of miles pergallon the car delivered is " << mpg(miles, litres) <<endl; cout << "Press 'q' to repeatcalculations. "; cin >> choice; } while (choice =='q' || choice =='Q'); system("PAUSE"); return 0; } double mpg(int miles, intlitres); { double gallons; gallons = LIT * litres; return (miles/gallons); }
Explanation / Answer
#include using namespace std; double const LIT = 0.264179; double mpg(int miles, int litres); int main () { char choice; int litres, miles; do { cout > litres; cout > miles; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.