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
tino4ka555 [31]
3 years ago
9

3. Write a method squareOfAsterisks that displays a solid square (the same number of rows and columns) of asterisks whose side i

s specified in integer parameter side. For example, if side is 4, the method should display **** **** **** **** Incorporate this method into an application that reads an integer value for side from the user and outputs the asterisks with the squareOfAsterisks method.
Computers and Technology
1 answer:
iren2701 [21]3 years ago
8 0

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

void squareOfAsterisks(int x) //defining method squareOfAsterisks

{

   int i,j; //defining integer variable

   for(i=1;i<=x;i++) //defining loop to print column value

   {

   for(j=1;j<=x;j++) //defining loop to print row value

   {

   cout<<"*"; //print value

   }

   cout<<endl; //for line break

   }

}

int main() //defining main method

{

int x; //defining integer variable

cout<<"Enter any number: "; //print message

cin>>x; //input value from user

squareOfAsterisks(x); //calling the method and pass the value

return 0;

}

Output:

Enter any number: 4

****

****

****

****

Explanation:

The description of the above program can be given as follows:

  • In the given program a method "squareOfAsterisks" is declared, that accepts an integer value "x" in its arguments, inside the method two integer variable I, j is used, that uses a to print the given pattern.
  • In the main method, an integer variable x is declared, which takes input from the user end, and then calls the method, that is "squareOfAsterisks" and passes its value.
You might be interested in
What is the output from main (below) after the following function is called. void calculateCost(int count, double&amp; subTotal,
GalinKa [24]

Answer:

     

Explanation:

7 0
3 years ago
Why would a user want to compress a large file before sending it as an email attachment?
Afina-wow [57]

to reduce the file size of the attachment

7 0
3 years ago
Read 2 more answers
What is software piracy
Tju [1.3M]
Software piracy is the illegal copying, distribution, or use of software.
8 0
3 years ago
Read 2 more answers
There are 2048bytes in4megabytes true or false​
ollegr [7]

Answer:

Explanation:

bonjour,

1 MB =  1 000 000 B (bytes)

4 MB = 4 000 000B

=> false

5 0
2 years ago
I know I should add Family and food by default (and I will) But I wanna hear some more from other peoples perspective
lidiya [134]

Answer:

you could say something like your friends or your pets if you have any pets you could say something like you are grateful that we now have 3 vaccines for the Coronavirus or like you are grateful for your hobbies because it gives you something to do in your free time.

Explanation:

i hope this helps.

7 0
3 years ago
Read 2 more answers
Other questions:
  • A ________ is hardware or software that acts as a filter to prevent unwanted packets from entering a network.
    9·2 answers
  • . char values are surrounded by _____ quotes
    15·1 answer
  • The code segment below uses the procedure IsPartOf (list, item), which returns true if item appears in list and returns false ot
    13·1 answer
  • Micheal has increased the contrast of the given picture. Which feature or menu option of a word processing program did he use? A
    15·1 answer
  • Advertising is organized around four distinct groups. The _____ group includes the photographers, the illustrators, video produc
    9·1 answer
  • Exampels of semantic tags ?​
    7·1 answer
  • Thomas drew a rectangle with an area of 6 square cm what is the greatest possible perimeter of this rectangle
    5·1 answer
  • Let's go! About to hit 40k!!! Glad to help on Brainly®!!!
    11·1 answer
  • Write a program in c++ that plays a number guessing game with a Human user. The Human user will think of a number between 1 and
    7·2 answers
  • 1. Fill in the blanks with appropriate word. 5°1-5 is a collection of raw unprocessed facts, figures, and symbols ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!