Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* ----------------------------------------------------------- ----------------------------------------------------------- The program below prompts the user to enter a value for x that is below 10. It then displays the character 'A'

/* ----------------------------------------------------------- -----------------------------------------------------------

The program below prompts the user to enter a value for x that is below 10. It then displays the character 'A' for 10-x times using a do-while loop.

However, the program contains some error(s). You have to correct the error(s), so that it will behave like in the sample runs below.

You have to maintain using the do-while loop structure.

=============================== Sample Run: Enter x (below 10): 6 AAAA =============================== Sample Run: Enter x (below 10): 1 AAAAAAAAA =============================== -----------------------------------------------------------*/

#include using namespace std;

int main() { int x = 0;

cout << "Enter x (below 10): "; cin >> x;

// Only make changes after this line: // You have to maintain using the do-while loop structure. do { cout << "A"; } while(x < 10)

cout << endl;

return 0;

}

Solve the program in C++ language

Thankyou in advance

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

Step: 3

blur-text-image

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago