Question: Where is the syntax and/or logical errors? comment that line of code out, but leave the original code so we can see the mistake. Then,
Where is the syntax and/or logical errors?
comment that line of code out, but leave the original code so we can see the mistake. Then, type in a correct line of code "below" the line you are correcting that fixes the error. Next, explain your correction with a correctly placed and formatted C++ comment.
find as many lines of code that you can, that have an error in them. Next, comment that line of code out, but leave the original code so we can see the mistake. Then, type in a correct line of code "below" the line you are correcting that fixes the error. Next, explain your correction with a correctly placed and formatted C++ comment.
1 // findErrors.cpp
2 / This program has several syntax and logic errors.
3
4 #include iostream
5 using namespace std
6
7 int main
8 {
9 doubl length = 0, // Length of a room in feet
10 width = 0; // Width of a room in feet
11 area == 0; // 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 cin << "Enter room width (in feet): ";
18 cout >> legth;
19
20 // Compute and display the area
21 width = length + area;
22 cout << "The area of the room is " << area " square feet." << endline;
23
24
25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
