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

  Compute the decimal value of this number

Compute the decimal value of this number using the exponent and significand from the previous part; show your work.

  How the "right" database design can rarely be decided

The "right" database design can rarely be decided on the basis of normalization principle alone. Do you agree or disagree? explain.

  Discuss appropriate security awareness training

Discuss social engineering attacks based on the provided techniques. Discuss appropriate security awareness training that will offset the identified attacks.

  Design a uml diagram for a grade class

Design a UML diagram for a Grade class with the following private data members.

  Describe an application life cycle management product

Using Google or another search engine, Describe an Application Life Cycle Management product which could meet the needs of Sifers-Grayson.

  Generate a scatter plot containg the information

Add code that will automatically generate a scatter plot containg the following information: -N data points -the best-fit line -labels for the x and y axis .

  Write a program that displays all integers

Write a program that displays all integers between low and high that are the sum of the cube of their digits.

  How does inline functions affect performance

Why do we write const keyword in function headers e.g. double getWidth() const;

  Testing assignment - research on smart homes

IT355 Software Quality Documentation and Testing Assignment - Research on Smart Homes. Introduction to Smart Homes with at least one citation to academic source

  Give a paragraph or two explaining the ethical use of a

question 1.provide a paragraph or two describing the ethical use of a packet sniffer. what are its legitimate uses?

  Create a package diagram of the problem domain layer

Create a package diagram of the problem domain layer using the communication diagrams and the CRUDE matrix through the use of graphical tools in Microsoft Word.

  Questionwrite down program for a bank account starts out

questionwrite down program for a bank account starts out with user selectable .interest is compounded monthly at user

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