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
List the general steps that are used to configure a soho router and set up the network
marusya05 [52]
Configure the Internet connection. 

Configure the wireless router. 

Enable NAT. 

Configure DHCP

Secure the SOHO network.
7 0
3 years ago
Help?!<br> Does anyone know how to use Adobe SoundBooth?
Mandarinka [93]
Never heard of that but it probably just have the kind of use of abobe flash
7 0
3 years ago
Read 2 more answers
explain in detail how such a company can improve the focus and relationship with customers, and what they will benefit from this
Reil [10]
Advertisement maybe
6 0
3 years ago
Ill give 100 points to whoever gives me the CORRECT answer. I keep getting syntax errors when I do the "add:" part. Can someone
Olin [163]

Answer:

sorry but there is not enough information to complete this

Explanation:

6 0
3 years ago
Read 2 more answers
1. In which generation were semiconductor memories used for the first time:
Llana [10]

1: D. Third Generation

2: C. 10

4 0
3 years ago
Other questions:
  • The checksum doesn't compute for a packet sent at the Internet Protocol (IP) level. What will happen to the data?
    14·1 answer
  • What does snap do need the answer now
    10·2 answers
  • How can our perceptions help us to choose the channel for our message?
    5·1 answer
  • If K is a foreign key in relation R1, then
    10·1 answer
  • You are given two int variables j and k, an int array zipcodeList that has been declared and initialized, an int variable nZips
    10·2 answers
  • Suppose that your application uses a loop that isn't producing the intended results. The best way to analyze what’s going on in
    13·1 answer
  • Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hou
    12·1 answer
  • You must. place a child in a federally approved child restraint device. if the child is
    5·2 answers
  • A Java programmer has developed a GUI with several different fields for inputting values and indicating choices via buttons, all
    15·1 answer
  • Why would someone make a histogram instead of a bar chart?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!