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
We begin with a computer implemented in a single-cycle implementation. When the stages are split by functionality, the stages do
Anika [276]

Answer:

3.1 ns ; 1.25 ; 3.097

Explanation:

Given :

IF, 3 ns;

ID, 2.5 ns;

EX, 2 ns;

MEM, 3 ns;

WB, 1.5 ns.

Use 0.1 ns for the pipelineregisterdelay

maximum time required for MEM = 3 ns

Pipeline register delay = 0.1 ns.

Clock cycled time of the pipelined machine= maximum time required + delay

3ns+0.1 ns = 3.1 ns

2.) for stall after every 4 instruction :

CPI of new machine :

(1 + (1 /4)) = 1 + 0.25 = 1.25

3.)

The speedup of pipelined machine over the single-cycle machine is given by :

Average time per instruction of single cycle ÷ average time per instruction of pipelined

Clock time of original machine = 12ns

Ideal CP1 = 1

CPI of new machine = 1.25

Clock period = 3.1 ns

(12 * 1) / (1.25 * 3.1) = 12 / 3.875

= 3.097

D. Speed up will equal the number of stages in the machine

8 0
3 years ago
Josephine is in the process of creating ads within her Standard Display campaign. She finds that there are two main ad formats t
Furkat [3]

Answer: B and E

Responsive display ads and uploaded image ads

Explanation:

A responsive display ad is an advert that can automatically adjust its size and format to suits any available ad space. Responsive display ads are the default ad type for the Google Display Network.

While the uploaded image ads AMPHTML (Accelerated Mobile Pages) is just perfect for mobile devices as it loads faster than other type of ads.

4 0
3 years ago
Sample outputs with inputs 9 5 2 -1 in python.
Nezavi [6.7K]
Sorry phsnjajajajqjkakw
7 0
3 years ago
Select all the sets that are countably infinite. Question 3 options: the set of real numbers between 0.1 and 0.2 the set of all
timama [110]

Answer:

1.  the set of real numbers between 0.1 and 0.2

2. the set of all negative integers greater than negative 1 trillion

3.  the set of all java and C programs

Explanation:

A set is countable if it is either finite or has the same cardinality as the set of positive integers. The inverse of this set type is uncountable.

The set of real numbers between 0.1 and 0.2, all negative integers greater than negative 1 billion, and a set of java and C programs are all countable sets, so are considered countably infinite.

5 0
3 years ago
Write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs the smalle
almond37 [142]

Answer:

Check the explanation

Explanation:

10

5

3

21

2

-6

the output will be somthing like this:

2 21

You can then suppose that the list of integers will contain at least 2 values.

4 0
3 years ago
Other questions:
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • Which element of presentation software can you use to add callouts and banners?
    5·2 answers
  • HELP 10 POINTS AND BRAINLIEST FOR BEST ANSWER! EASY I PROMISE! HELPFUL ANSWERS ONLY PLEASE HURRY!
    14·2 answers
  • Although you can use a dialog box to indent paragraphs, word provides a quicker way through the ____.
    7·1 answer
  • nswer the following questions concerning chapter 1:1.1 Which pair of layers are NOT peer layers?a.Transport layer in the sender
    9·1 answer
  • Click on the _____ tab on the ribbon to open the backstage view.
    7·1 answer
  • The function below takes one parameter: a list of strings (string_list). Complete the function to return a new list containing o
    13·1 answer
  • DTE just installed 500kW of solar capacity on the MCCC campus. the cost of the installation was about $3 million. what was the c
    10·1 answer
  • Partes de la ventana principal de Microsoft excel 2013 con sus respectivas funciones
    14·1 answer
  • Question #5
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!