Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

Objective Use your knowledge of C++ to identify and correct

 
Ramesh Patil's Avatar
  • Answered by:Ramesh Patil
  • Computer Software Engineer
  • Positive Feedback: 100.0 %
  • Accepted Answers: 405
Verified Expert
in Programming

Recent Feedback

Positive
This is awesome. It works perfectly and just as I had hoped. Thanks for the...
Positive
awesome response time and help
Positive
very helpful
Positive
QUICK RESPONSE & ANSWER! THANK YOU!
Positive
Excellent!!!
Positive
Rames you are a very good programmer i really trust your experince
Positive
YOU CREATED EXACTLY WHAT I WANTED. MANY THANKS
Positive
Thanks. Sorry for the late response.
Positive
Thanks. This will help a lot.
Positive
This worked. Thanks

Customer Question

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 << Choice

return 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 main

int 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++

Submitted: 804 days and 4 hours ago.
Category: Programming
Value: $23
Status: CLOSED
Picture
Expert:  Ramesh Patil replied804 days and 3 hours ago.


Hi ,

Welcome and Thank you for posting your question at Justanswer.
I will assist you in this.

Thanks,
Ramesh

Customer replied804 days and 2 hours ago.

ok thanks, XXXXX XXXXX hours from now will be good if you can, thanks!

 

Picture
Expert:  Ramesh Patil replied804 days and 2 hours ago.



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.

Accepted Answer

Picture
Expert:  Ramesh Patil replied804 days and 2 hours ago.


Hi ,

I am done with both the programs.

1] this program display a menu and allows the user to select an item from the menu

Ans:
Please download the corrected source code of the triangle program from below download url:
http://wikisend.com/download/854900/menu.cpp


2] 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.cpp




Thanks,
Ramesh

Expert TypeComputer Software Engineer
Category: Programming
Pos. Feedback: 100.0 %
Accepts: 405
Answered: 3/6/2011

Experience: MCA, 3+ years of experience in Asp.Net, C#, SSIS, VB.Net, Ms-SqlServer2005, MySql, Javascript,

Ask this Expert a Question >
 
Tweet

Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
Microsoft Visual Basic 2010 Programming Exercise 5/16/2013
I am programming and auto reply macro and Outlook 10 that is 5/16/2013
Hello. I really need help with C Programming. I need a program 5/15/2013
I need to make the submit button bigger 5/15/2013
"For Jatechexpert" Part 1Programming Exercise 2—Calories 5/14/2013
INSTRUCTIONS: VERY IMPORTANT, THIS IS TO BE DONE USING MICROSOFT 5/13/2013
I have a JavaScript programming question. I have a form and 5/13/2013
Need a java programming to fulfill the following requirements: 1. 5/13/2013
I. Overview: Welcome to the CIT216 Practice Final 5/13/2013
Please help with this project https://www.dropbox.com/s/vs 5/12/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

JustAnswer in the News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
120 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us | Our Network
© 2003-2013 JustAnswer LLC
  • Pearl.com
  • JustAnswer UK
  • JustAnswer Germany
  • JustAnswer Spanish
  • JustAnswer Japan