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
Why are large commercial companies interested in developing mobile apps for smartphones?
loris [4]
Because they can make a lot of money if they create a popular application.
7 0
3 years ago
A circuit has a resistance of 300 ohm and a current of 0.024 A. What is the voltage in the circuit?
fomenos
**Formula

If u want to calculate voltage:
Current x Resistance

so the answer is D

Current:
Voltage ÷ Resistance

Resistance:
Voltage ÷ Current
7 0
3 years ago
What types of activities are ideal for a robot to perform?
LUCKY_DIMON [66]

The type of activities that are ideal for a robot to perform are; Repetitive tasks

Robots are machines that are programmable by a computer which have the capacity of automatically carrying out a complex series of actions.

Now, robots are used in a wide array of industries which include manufacturing, assembly and packaging, transport, earth and space exploration, e.t.c.

The most common use are found primarily in the automobile industry where they are used to carry out repetitive tasks and those that are difficult or hazardous for humans.

Read more about robots at; brainly.com/question/9145476

3 0
3 years ago
What does DHCP stand for?
Lisa [10]
Domain host control protocol is the answer
4 0
4 years ago
Read 2 more answers
write the class definition of a subclass of square called fancysquare that has a method called getdiagonal. the getdiagonal meth
Harman [31]

Answer:x squared

Explanation:

3 0
3 years ago
Other questions:
  • What does the hard disk drive do?
    9·2 answers
  • Successful Web sites such as StumbleUpon ( www.stumbleupon) and Digg ( www.digg) use ____ by inviting their visitors to vote on
    8·1 answer
  • Which of the following is NOT part of the Ethernet standards? O 1.802.3 O 2.802.2 O 3 LLC O4 pPp
    12·1 answer
  • Five aplications of ict​
    10·1 answer
  • What is the current when the voltage is 18 volts and the resistance is 6 ohms?
    7·1 answer
  • Where are options to add a border around the outside of a chart found?
    9·2 answers
  • Traditionally, remote administrative access on routers was configured using Telnet on TCP port 23. However, Telnet was developed
    8·1 answer
  • Read the Python program below: num1 = int(input()) num2 = 10 + num1 * 2 print(num2) num1 = 20 print(num1) Question 1 When this p
    6·1 answer
  • What information most likely presents a security risk on your personal
    6·1 answer
  • Which communication network pattern offers a fairly even flow of information, but two people interact with only one other?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!