1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Radda [10]
4 years ago
15

Given input of a number, display that number of spaces followed by an asterisk. (1 point) Write your solution within the existin

g supplied function called problem2() and run the Zybooks test for it before continuing on to the next problem. Hint: Use the setw() command to set the field width. Alternatively, you could again use a loop.
Computers and Technology
1 answer:
Naddika [18.5K]4 years ago
7 0

Answer:

Following is the program in C++ language

#include <iostream> // header file

#include <iomanip> // header file  

using namespace std; // namespace std;

void problem2() // function definition  

{

int num ; // variable declaration  

cout << "Enter the Number: ";

cin >> num; // Read the input by user

cout << "Resulatant is:";

for(int k = 0; k <num; k++) // iterarting the loop

{

std::cout << std::setw(num); // set width

std::cout <<"*"; // print *

}

}

int main() // main function

{

problem2();// function calling

return 0;

}

Output:

Enter the Number:  3

Resulatant is:    *   *   *

Explanation:

Following is the description of program

  • Create a function problem2().
  • Declared a variable "num" of "int" type .
  • Read the input in "num" by the user .
  • Iterating the for loop and set the width by using setw() and print the asterisk.
  • In the main function  calling the problem2().
You might be interested in
Which computers were the first PCs with a GUI<br> MS-DOS <br> Linux<br> Windows<br> Mac
sergeinik [125]

Answer:

The first computer with a GUI were linux, microsoft and apple.

Explanation:

I think this is right. Hope it helped <3

8 0
3 years ago
Read 2 more answers
Amelia is going to school to get a degree in Early Childhood Education. She wants to open her own daycare after she graduates. W
Yanka [14]
She could volenteer at a day care at the weekend or study child development/care whilst she is still at school.
8 0
3 years ago
What does D'Artagnan discover about Milady? d. That she has the mark of a criminal, the fleur- c. That she is secretly working f
Setler79 [48]
The answers is b .....
6 0
3 years ago
Read 2 more answers
Which of the following most closely illustrates the correct format of the comparison in a conditional statement?
hoa [83]
Answer should be if (thisString = "What is your quest?")
6 0
3 years ago
A database is helpful when you have large amounts of information that you wish to
vodomira [7]
Lets see, database contains a large portion of information in one area. While you can edit and send information. These are generally used to organize the data inside.
4 0
4 years ago
Other questions:
  • Copying and pasting from the internet can be done without citing the internet page, because everything on the internet is common
    13·1 answer
  • The device used to attach a microphone to a lectern is called a ____.
    10·1 answer
  • ________-generation languages use symbols and commands to help programmers tell the computer what to do.
    11·2 answers
  • Part cost Calculator Modify the GUI in your program to look like the following GUI. To do that you need to add the following to
    13·1 answer
  • Which of the following would be considered the highest risk portfolio?
    9·1 answer
  • In cell B13, create a formula without a function using absolute references that subtracts the values of cells B5 and
    13·1 answer
  • Midday is a good time to take a portrait outside.<br> true or false?
    8·1 answer
  • SLA:
    14·1 answer
  • I need help with computer science<br> the quiz on e2020 is on hackers and unauthorized access
    15·2 answers
  • Which programming language in order takes the most lines code​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!