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 NEED HELP SOMEONE HELP ME PLEASE
kirill115 [55]
1. non photorealistic rendering
2. siftables
3. spherical audio
4. blu ray
7 0
2 years ago
Why might a peer-to-peer network not be the best choice for a large corporate office setting?
omeli [17]

Answer:

a it is less private

Explanation:

8 0
3 years ago
IDENTIFYING VERBS THAT AGREE IN NUMBER WITH THEIR SUBJECTS For each of the following sentences, write the correct form of the ve
Novay_Z [31]

Hey there!

  • The word "<u>verb</u>" simply means <em>'description of an action, assert, or event that is made into the main purpose of your predicate in your judgement' </em>
  • Now that we have the definition of the word verb we can answer your question
  • "<em>Has</em>" is past tense but it is THIRD person present
  • "<em>Have</em>" is when you own something
<h2>Answer: HAS ✅</h2>

BECAUSE "I SAW last night"

Note: usually people read the sentence to themselves until it makes easier sense to them or use context clues in the sentence to answer the particular question(s)

Good luck on your assignment and enjoy your day!

~LoveYourselfFirst:)

6 0
3 years ago
Read 2 more answers
An electronic cover letter should be
Lunna [17]
A cover letter is a document sent with your resume to provide additional details about you. The cover letter is what introduces your resume and you. 
<span>A few short tips for writing cover letters. i dont know if thats the answer you looking for</span>
3 0
2 years ago
Read 2 more answers
You received an email from someone who claims to be a representative from your school. The email asked you to click on a link to
Sergeeva-Olga [200]

Answer:

Phishing

Explanation:

Phishing = Link to a site, usually a fake replica of a legitimate site but with added implements that can be used to spy on you (how people become victims of identity theft

6 0
3 years ago
Other questions:
  • What feature of Windows Server allows for agentless authentication?
    7·1 answer
  • The small company where you work needs to implement a second server for its accounting system, but does not have the funds to pu
    11·1 answer
  • This problem has been solved!
    8·1 answer
  • For each 8-bit data frame the layer uses a generator polynomial G(x) = x4+x2+ x+1 to add redundant bits. What is the sequence of
    11·1 answer
  • SummaryIn this lab, you complete a partially written C++ program that includes a function named multiplyNumbers() that multiplie
    13·1 answer
  • What is an advantage of storing data in a Data Lake, without applying a specific schema to it initially?
    10·1 answer
  • Write the implementation of a class Cse20 Topic that represents a topic in the cse20 class. The class should implement the init
    13·1 answer
  • What code would you use to create the login button?
    11·1 answer
  • Which of the following is a key aspect of any IT position? installation of fiber optic cables
    14·2 answers
  • How to install an older version of prettier on yarn
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!