Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 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); }   
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;     cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote