Display a list of distinct numbers in the input

Assignment Help Computer Engineering
Reference no: EM132200857

Question :

Write a Java program called Histogram.java that reads integer values from a user. Your program should display a list of distinct numbers in the input and the occurrence of each distinct value.

After that, your program should draw a vertical bar for the occurrences. In the program, you can assume that the number of input values from a user is less than or equal to 30. Additionally, you can assume that the input number itself is between 0 and 9.

A sample run of your program should be like below:

How many input values [max: 30]?
5
Enter 5 numbers.
2
1
2
0
2
Number Occurrence
0 1
1 1
2 3
========= Vertical Bar ========
| 3 | -------- *
| 2 | ---------*
| 1 | -----* * *
===============================
| No | 0 1 2 3 4 5 6 7 8 9
===============================

The vertical bar will be a representation of the histogram and how many occurences. without the dashes(ex. ---) on the vertical scale.

Reference no: EM132200857

Questions Cloud

Prompt the user to enter a regular expression : Write a Java program that prints all strings defined by a regular expression up to a given length.
Write a program that reads ten characters into a linked list : Write a java program that reads ten characters into a linked list and displays them in the reverse of the order in which they were read.
Write a java program with two checkboxes : Write a Java program with two checkboxes, one labeled BLUE and the other labeled ORANGE.
Reverse the order of words and displays on the console : Write a Java program that reads a file, reverses the order of words and displays on the console. The words can be on the same or separate lines.
Display a list of distinct numbers in the input : Display a list of distinct numbers in the input and the occurrence of each distinct value.
Demonstrate that the algorithm works using two threads : Use threads to implement Peterson's algorithm for mutual exclusion. Demonstrate that the algorithm works using two threads.
Write a java program that creates a one-dimensional array : Write a JAVA Program that creates a one-dimensional array and fills it with the following numbers in this given order.
What role do portals play in : Are they still as relevant as they were a few years ago? More relevant? Support your conclusion with additional research on the web.
A program to calculate rectangular and right triangles : Write a java program that calculates of rectangular and right triangles. The main function then only outputs the areas of the two calculated areas.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Determine whether it is possible to exit the maze

Write a program to determine whether it is possible to exit the maze from a given starting point.

  What books are associated with each publisher

How many books are sold each month by the publisher? This is important because quantity discounts are available from the publisher.

  Write a code program with a loop that lets the user enter

Write a java code program with a loop that lets the user enter a series of positive integers.

  Write an inequality that represents the cardinality

Write an inequality that represents the cardinality of any proper subset of A. Let's say the cardinality of the subset is C.

  What constraints did you experience and how did you handle

What constraints did you experience and how did you handle them? If you had to do the same project again, what changes will you recommend?

  Describes a set of firewall rules

Section 9.10.1 describes a set of firewall rules that limit outside access to only three services. Describe another set of rules that you can add to this firewall to further restrict access to these services.

  Compare stateless firewall rules with an acl

Compare stateless firewall rules with an ACL. Explain why using proxy servers helps with securing web traffic. Describe site-to-site and client-to-site VPN.

  Write a program that reads an integer and displays

Write a program that reads an integer and displays all its smallest factors, also known as prime factors.

  Review the different digital forensics tools and hardware

From the second e-activity describe two devices that are available from leading computer manufacturing companies

  Create a web page that provides five helpful facts

Create a Web page that provides five helpful facts about copyright and the Web. Provide the URLs of the Web sites you used as resources.

  Select an employee from the employee table

Choose a job_title_code in the job_title table. Increase the Minimum_salary and Maximum_salary for this job_title_code.

  What is the maximum number of memory location

With an instruction format having two register address fields, one 3-bit addressing mode field, and one 8-bit immediate operand, what is the maximum number of op-codes possible

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd