Question: Step 1: Remove average.cpp from the project and add findErrors.cpp to the project. Here is a copy of the source code. 1 // findErrors.cpp 2

Step 1: Remove average.cpp from the project and add findErrors.cpp to the project. Here is a copy of the source code.

1 // findErrors.cpp 2 // This program has one syntax error and one logic error. Find and fix them. 3 // PUT YOUR NAME HERE. 4 #include 5 using namespace std 6 7 int main () 8 { 9 double length = 0, // Length of a room in feet 10 width = 0, // Width of a room in feet 11 area; // Area of the room in sq. ft. 12 13 // Get the room dimensions 14 cout << "Enter room length (in feet): "; 15 cin >> length; 16 17 cout << "Enter room width (in feet): "; 18 cin >> length; 19 20 // Compute and display the area 21 area = length * width; 22 cout << "The area of the room is " << area << " square feet." << endl; 23 24 return 0; 25 }

Step 2: Put your name on line 3. Then compile the program. It contains one syntax error and one logic error.

Step 3: Use the compiler error message to help you locate the syntax error and fix it.

Step 4: Once the program compiles with no errors, run the program, and examine the output. Analyze what is going wrong so you can find and fix the logic error in the program. Once you have it running correctly the output should look like the following:

Enter room length (in feet): 15

Enter room width (in feet): 10

The area of the room is 150 square feet.

Step 5: Follow the instructions your professor gives you to print the final, correct findErrors.cpp source code and the output the program displays when it runs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!