Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

Define Administration and Management

Answered: 1 week ago

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago