Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are bugs in these 3 programs, find the errors in each and tell me how you fixed them. Send a fixed program of each

There are bugs in these 3 programs, find the errors in each and tell me how you fixed them.

Send a fixed program of each in the end. Thanks:)

1st code:

#include  int main() { cout < "!!!Hello World!!!" < endl; // prints !!!Hello World!!! return 0; }

2nd code:

#include  using namespace std; int main() { string age; cout << "Please enter your name: "; cin >> userName; cout << "Hello " << userName << ", how are you?" << endl; cout << "Please enter your age: "; cin >> age; cout << "Here is your age doubled: " << age*2 << endl; return 0; } 

3rd code:

#include  using namespace std; int main() { int largeInteger = 34389340934938; int result; int choice; string resultString = ""; cout << "The value of largeInteger is: " << largeInteger << endl; cout << "Please choose from one of the following options and enter your choice (1, 2, or 3). "; cout << "1: divide largeInteger by 2. "; cout << "2: divide largeInteger by 3. "; cout << "3: mod the largeInteger by 9. "; cout << "Enter choice: "; cin >> choice; switch(choice){ case 1: result = largeInteger/2; resultString = "Your result after dividing by 2: "; case 2: result = largeInteger/3; resultString = "Your result after dividing by 3: "; case 3: result = largeInteger%9; resultString = "Your result after moding by 9: "; } cout << resultString << result << endl; return 0; } 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

2. What potential barriers would you encourage Samuel to avoid?

Answered: 1 week ago