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
hammer [34]
3 years ago
5

One interesting application of computers is to display graphs and bar charts. Write an application that reads five numbers betwe

en 1 and 30. For each number that’s read, your program should display the same number of adjacent asterisks. For example, if your program reads the number 7, it should display *******. Display the bars of asterisks after you read all five numbers.
Computers and Technology
1 answer:
Nezavi [6.7K]3 years ago
3 0

Answer:

The answer to this question can be given by program that  are as follows

import java.util.*;

//import package for taking input from user.

public class Main   //define class

{

public static void main (String ag[] )   //define main function

{

 int number;

 Scanner input = new Scanner(System.in);

 for (int i = 0; i < 5; i ++)                       //loo for input.

 {

  System.out.print ("Enter a number between 1 - 30:  ");

  number = input.nextInt();          //input number by the user.

 

 }

 asterisk();           //calling function.

 }

public static void asterisk()          //defination of function.

{

    //body of function.

    int n;                   //local variable.

 for (n= 0; n <= 30; n++)                  //using loop for print asterisk

 {

 if (n !=0)

 //printf used for print value.

 System.out.printf("*", n );                  //print value.

 }

 

  for (n= 0; n <= 30; n++)         //using loop for print asterisk

  {

 if (n !=0)

 //printf used for print value.

 System.out.printf("*", n );     //print value.

 }

 

  for (n= 0; n <= 30; n++)          //using loop for print asterisk

  {

 if (n !=0)

 //printf used for print value.

 System.out.printf("*", n );          //print value.

 }

  for (n= 0; n <= 30; n++)            //using loop for print asterisk

 

 {

 if (n !=0)

 //printf used for print value.

 System.out.printf("*", n );               //print value.

 }

 

  for (n= 0; n <= 30; n++)             //using loop for print asterisk

  {

 if (n !=0)

 //printf used for print value.

 System.out.printf("*", n );             //print value.

 }

}

}

Output:

Enter a number between 1 - 30: 2

Enter a number between 1 - 30: 2

Enter a number between 1 - 30: 1  

Enter a number between 1 - 30: 3

Enter a number between 1 - 30: 4

*******************************************************************************

Explanation:

In this program we take 5 time input from the user and print the value in the form of (*) that can be explain in above output section.In that program we use printf method that is also used for print the value.

You might be interested in
I'm surprised I haven't even got a single warning yet lol
dangina [55]

Answer:

Thats good

Explanation:

Thanks for the points~! ;)

7 0
2 years ago
Which of the following is NOT an example of editing?
Genrish500 [490]

Answer:

ang answer po at proofreading written

content

Explanation:

if I wrong please correction me!

8 0
2 years ago
Which of the following are advantages of cloud computing?
Leona [35]
Hahahahaha lawllakad
7 0
3 years ago
Read 2 more answers
Question 83 :Which type of fiber optic connector connects to a terminating device by pushing the connector into the terminating
STALIN [3.7K]

The Lucent connector(LC) is a type of fiber optic connector used here.

Explanation:

A Lucent connector (LC) is a type of fiber optic connector connects to a terminating device by pushing the connector into the terminating device and can be removed by depressing the tab on the connector and pulling it out of the terminating device.

It is a standard ceramic Ferrule connector and has good performance and is favored for single mode.

LC is a latched connector which have same handling capacities like SC. They have small flange on top similar to an RJ-45 connector that aids secure connection. It has a smaller connector housing and a smaller 1.25 mm ferrule.

3 0
3 years ago
When a computer is the.................of an attack, it is used as an active tool to conduct the attack
BARSIC [14]

Answer:

Attack is an intentional or unintentional act that causes damage or compromises information of systems supporting it.When a computer is the subject of an attack, it is used as an active tool to conduct the attack.

On the other hand, when a computer is the entity being attacked, it is the object of an attack.

3 0
2 years ago
Other questions:
  • What auto-generated elements can be added to the header and footer? A. Charts and Images B. Theme and Font Selection C. Author a
    8·2 answers
  • Describe how one device can send a bit to another device.
    9·1 answer
  • Describe Network in terms of the classroom computer lab
    14·1 answer
  • What is the difference between primary storage,secondary storage and offline storage what type of storage can be
    6·2 answers
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • In which of the following situations should you expect to provide your Social Security number?
    13·1 answer
  • The purpose of multivariate analysis in index construction is to discover the simultaneous interaction of the items to determine
    12·1 answer
  • 9. Select the correct answer.
    6·1 answer
  • Difference between a port and a connector
    10·1 answer
  • How to give a file name as an argument in function in python.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!