Problem

(Modify) Rewrite the following programs to conform to good programming practice and correc...

(Modify) Rewrite the following programs to conform to good programming practice and correct syntax:

a.

#include  using namespace std;int main(){cout <<“The time has come”; return 0;}

b.

#include using namespace std;int main(     ){cout << “Newark is a city\n”;cout <<“in New Jersey\n”; cout <<“It is also a city\n”; cout << “in Delaware\n”; return 0;}

c.

#include using namespace std;int main() {cout << Reading a program\n”;cout <<“is much easier\n”; cout << “if a standard form for main is used\n”; cout<<“and each statement is written\n”;cout<<          “on a line by itself\n”; return 0;}

d.

#include using namespace std;int main(     ){ cout << “Every C++ program”; cout<<“\nmust have one and only one”;cout << “main function”;cout <<“\n The escape sequence of characters”); cout <<“\nfor a newline can be placed anywhere”; cout<<“\n in the message passed to cout”; return 0;}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2.2
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT