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
Learning Task 2: Identify what is being asked. Write your answers on your notebook 1. What Microsoft Office program is used for
GenaCL600 [577]

Answer:

hi how are you Good afternoon

3 0
3 years ago
What is the purpose of a format painter in Word?
Bond [772]

Answer:

The format painter lets you copy all of the formatting from one object and apply it to another one – think of it as copying and pasting for formatting. Select the text or graphic that has the formatting that you want to copy. Note: If you want to copy text formatting, select a portion of a paragraph

Explanation: pls mark my answer as brainlist

3 0
2 years ago
Read 2 more answers
According to the video, which tasks do Police Patrol Officers perform? Select all that apply.
krek1111 [17]

Answer:

The answer is B, E, and F

Explanation:

4 0
2 years ago
Read 2 more answers
What could have made you redesign your plan? Select 3 options.
Masteriza [31]

Answer:

so that their username will still be used and so the can renember the username

Explanation:

that is why

5 0
2 years ago
Which of the following are techniques that companies use to influence consumers demand for their goods and services
Lesechka [4]
A. Turning luxuries into necessaties
5 0
3 years ago
Read 2 more answers
Other questions:
  • Explaim Why the shape of a cell is hexagonal
    15·1 answer
  • The purpose of hazard lights is to
    7·2 answers
  • What is an advantage of sharing documents in PDF format instead of Word format?
    6·2 answers
  • If you want to learn more about a command, point to its button and wait for the ____ to appear.
    13·1 answer
  • .____________ is a way to identify and differentiate goods andservices through use of a name or distinctive design element.
    10·1 answer
  • 5. Which one of the following statements is true for spell checkers? A. Most spell checkers flag inappropriate word usage. B. A
    5·1 answer
  • You are planning a program to find the maximum heart rate recommended for patrons of a gym where you have a part-time job. One f
    13·1 answer
  • ¿Cuál es la diferencia entre una plataforma educativa y una tutoría?
    7·1 answer
  • You need to update your router settings, so you log into the administration panel, Whose Internet protocol (IP) address is 192.1
    5·1 answer
  • Which is an example of machine-to-machine communication?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!