Recent Feedback
Objective: Use your knowledge of C++ to identify and correct the syntax and formatting errors in the following C++ code:/******************************************************************* Programmer: [put your name here]** Date: [put the current date here]** Course: COMP 220** Assignment: Correcting syntax errors and program formatting** Description: this program display a menu and allows the * user to select an item from the menu* * Assumptions: Assumes that the user enters a valid number corresponding* to a menu item * * Input: keyboard - enter an integer. * * Output: screen - display the users menu selection * ********************************************************************/ #include main ( )} int usersChoice = menu(); cout << "\n You Choose " <> "Choose From Martha's Menu:/n" cout << "1 - Dinner" cout << endln << 2 - Lunch"; cout << endln << "3 - Breakfeast";cout << "Enter a number:"int choice = 0;cin << Choicereturn choice;} //end menu Steps:Create a new Visual Studio project and source code file. Copy and paste the code above into the source code file. Correct the syntax errors and properly format the code. Submit your corrected source code.Exercise 2: Identifying and Correcting Logical Errors (20 points) Objective: Use the Visual Studio debugger to identify and correct the logical errors contained in the following program:/******************************************************************* Programmer: [put your name here]** Date: [put the current date here]** Course: COMP 220** Assignment: Identification and correction of logical errors** Description: this program prints a triangle with a base of five asterisks * * Output: screen - displays a triangle * ********************************************************************/ #include int drawBar(int);int main(){ std::cout << std::endl <= triangleBase ; i--) { drawBar(i); } return 0;} //end mainint drawBar(int barSize) {//draws a line of asterisks//the number of asterisk drawn equals barSize int theCounter = 0; while (theCounter >= barSize) { theCounter--; std::cout << '*'; } std::cout << '\n'; return 0;} //end drawBar Steps:Create a new Visual Studio project and source code file. Copy and paste the code above into the source code file. Correct the Logical errors in the code so that the output of the program appears as such: ***************
Optional Information: Browser: IE Programming Language: C++
Hi ,Welcome and Thank you for posting your question at Justanswer.I will assist you in this.Thanks,Ramesh
ok thanks, XXXXX XXXXX hours from now will be good if you can, thanks!
yes sure. I am done with first program and now working on second program of triangle.I will post the answer in next 2 hours or less.
Hi ,I am done with both the programs.1] this program display a menu and allows the user to select an item from the menuAns:Please download the corrected source code of the triangle program from below download url:http://wikisend.com/download/854900/menu.cpp2] this program prints a triangle with a base of five asterisks Ans: Please download the corrected source code of the triangle program from below download url:http://wikisend.com/download/523578/triangle.cppThanks,Ramesh
Experience: MCA, 3+ years of experience in Asp.Net, C#, SSIS, VB.Net, Ms-SqlServer2005, MySql, Javascript,