Debugging a C++ program Program Name: pgm1a.cpp Details: The source code (pgm1a.
ID: 3611691 • Letter: D
Question
Debugging a C++ program Program Name: pgm1a.cpp Details: The source code (pgm1a.cpp), which is in the"~/cs201mp/lib/prog1" directory and shown below, has syntax errorsand logic errors. Modify the source code so that it displays thefollowing outputs on the screen without any error. (Source Code) //------------------------------------------------------------------------------------- // FILE NAME : pgm1a.cpp // PURPOSE : Thisprogram is for debugging exercise. // Yourtrack is to debug the syntex and logic errors // in the code. // AUTHOR :Put your name here // DUE DATE : 01/23/2009 //------------------------------------------------------------------------------------- # include < iostream > using namespace std; { int main ( ) cout << " n"Some websites that youcan find good deals" " << endl; cout << " twww.slickdeals.net"; cout << " www.spoofee.com" ; cout << " www.dealspl.us"; cout << " www.deals2buy.com"; cout << " (Your instructor is notadvertising these websites.) "; cout << " (You should be responsiblefor using these websites.)" << endl; return 0; } (expected output on the screen) "Some websites that you can find good deals" www.slickdeals.net www. spoofee.com www. dealspl.us www.deals2buy.com (Your instructor is not advertising these websites.) (You should be responsible for using these websites.) Note: There are two blank lines (i.e., oneabove "Some..." line and one below"You...websites.)" line). Debugging a C++ program Program Name: pgm1a.cpp Details: The source code (pgm1a.cpp), which is in the"~/cs201mp/lib/prog1" directory and shown below, has syntax errorsand logic errors. Modify the source code so that it displays thefollowing outputs on the screen without any error. (Source Code) //------------------------------------------------------------------------------------- // FILE NAME : pgm1a.cpp // PURPOSE : Thisprogram is for debugging exercise. // Yourtrack is to debug the syntex and logic errors // in the code. // AUTHOR :Put your name here // DUE DATE : 01/23/2009 //------------------------------------------------------------------------------------- # include < iostream > using namespace std; { int main ( ) cout << " n"Some websites that youcan find good deals" " << endl; cout << " twww.slickdeals.net"; cout << " www.spoofee.com" ; cout << " www.dealspl.us"; cout << " www.deals2buy.com"; cout << " (Your instructor is notadvertising these websites.) "; cout << " (You should be responsiblefor using these websites.)" << endl; return 0; } (expected output on the screen) "Some websites that you can find good deals" www.slickdeals.net www. spoofee.com www. dealspl.us www.deals2buy.com (Your instructor is not advertising these websites.) (You should be responsible for using these websites.) Note: There are two blank lines (i.e., oneabove "Some..." line and one below"You...websites.)" line). //------------------------------------------------------------------------------------- // FILE NAME : pgm1a.cpp // PURPOSE : Thisprogram is for debugging exercise. // Yourtrack is to debug the syntex and logic errors // in the code. // AUTHOR :Put your name here // DUE DATE : 01/23/2009 //------------------------------------------------------------------------------------- # include < iostream > using namespace std; { int main ( ) cout << " n"Some websites that youcan find good deals" " << endl; cout << " twww.slickdeals.net"; cout << " www.spoofee.com" ; cout << " www.dealspl.us"; cout << " www.deals2buy.com"; cout << " (Your instructor is notadvertising these websites.) "; cout << " (You should be responsiblefor using these websites.)" << endl; return 0; } (expected output on the screen) "Some websites that you can find good deals" www.slickdeals.net www. spoofee.com www. dealspl.us www.deals2buy.com (Your instructor is not advertising these websites.) (You should be responsible for using these websites.) Note: There are two blank lines (i.e., oneabove "Some..." line and one below"You...websites.)" line).Explanation / Answer
#include < iostream>
using namespace std;
int main ( )
{
cout << " Some websites that you can findgood deals" << endl;
cout << " www.slickdeals.net"<<endl ;
cout << " www.spoofee.com"<< endl;
cout << " www.dealspl.us"<<endl;
cout << " www.deals2buy.com"<<endl;
cout << "(Your instructor is notadvertising these websites.) "<< endl;
cout << "(You should be responsible forusing these websites.)" <<endl;
return 0;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.