Prompt the user for the headers of two columns of a table

Assignment Help Computer Engineering
Reference no: EM132105114

This is the problem in steps the final output is at the bottom.

Program: Data visualization (Java)

(1) Prompt the user for a title for data. Output the title.

Ex: Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored

(2) Prompt the user for the headers of two columns of a table. Output the column headers.

Ex: Enter the column 1 header: Author name You entered: Author name Enter the column 2 header: Number of novels You entered: Number of novels

(3) Prompt the user for data points. Data points must be in this format: string, int. Store the information before the comma into a string variable and the information after the comma into an integer. The user will enter -1 when they have finished entering data points. Output the data points.

Store the string components of the data points in an ArrayList of strings. Store the integer components of the data points in a second ArrayList of integers.

Ex:

Enter a data point (-1 to stop input): Jane Austen, 6 Data string: Jane Austen Data integer: 6

(4) Perform error checking for the data point entries. If any of the following errors occurs, output the appropriate error message and prompt again for a valid data point.

If entry has no comma

Output: Error: No comma in string.

If entry has more than one comma

Output: Error: Too many commas in input.

If entry after the comma is not an integer

Output: Error: Comma not followed by an integer.

Ex:

Enter a data point (-1 to stop input): Ernest Hemingway 9 Error: No comma in string. Enter a data point (-1 to stop input): Ernest, Hemingway, 9 Error: Too many commas in input. Enter a data point (-1 to stop input): Ernest Hemingway, nine Error: Comma not followed by an integer. Enter a data point (-1 to stop input): Ernest Hemingway, 9 Data string: Ernest Hemingway Data integer: 9

(5) Output the information in a formatted table. The title is right justified with a minimum of 33 characters. Column 1 is left justified with a minimum of 20 characters. Column 2 is right justified with a minimum of 23 characters.

Ex:

Number of Novels Authored Author name | Number of novels -------------------------------------------- Jane Austen | 6 Charles Dickens | 20 Ernest Hemingway | 9 Jack Kerouac | 22 F. Scott Fitzgerald | 8 Mary Shelley | 7 Charlotte Bronte | 5 Mark Twain | 11 Agatha Christie | 73 Ian Flemming | 14 J.K. Rowling | 14 Stephen King | 54 Oscar Wilde | 1

(6) Output the information as a formatted histogram. Each name is right justified with a minimum of 20 characters.

Ex:

Jane Austen ****** Charles Dickens ******************** Ernest Hemingway ********* Jack Kerouac ********************** F. Scott Fitzgerald ******** Mary Shelley ******* Charlotte Bronte ***** Mark Twain *********** Agatha Christie ************************************************************************* Ian Flemming ************** J.K. Rowling ************** Stephen King ****************************************************** Oscar Wilde *
This is the preloaded code:

import java.util.Scanner;
import java.util.ArrayList;

public class DataVisualizer {
public static void main(String[] args) {
/* Type your code here. */

return;
}
}

This is in a Java learnig program not an Java IDE. This question has been answered on Transtutors before but that code doesn't work, I has multiple errors acourding to the learning program. can someone please help me out with this. Thank you.

The code needs to output exactly as it shows above or it is considered incorrect.

Reference no: EM132105114

Questions Cloud

Good approaches for documenting the entire project : When abruptly terminating a project, what are some good approaches for documenting the entire project?
How can you tell which way is better : How can you tell which way is better? Evaluate your Java code using both experimental studies and asymptotic analysis.
Abruptly terminated project : Why is it considered a best practice to properly close a project how is it different from an abruptly terminated project?
Analyze the components of the interpersonal skills : Analyze the components of the interpersonal skills in the multimedia assignment this week, and the planning components from a buyers and sellers perspective.
Prompt the user for the headers of two columns of a table : Prompt the user for the headers of two columns of a table. Output the column headers.
What is a exception report : Why are these reports are important and can you explain a example of when these reports are useful.
Required resources for project : In case the company doesnt have required resources for project, please advise strategies that we can do to obtain those resources.
Create a domain model using uml class diagrams : Create a domain model using UML class diagrams to represent the relationships between the main entities in the domain.
Develop a wbs and wbs dictionary : We have budgeted $150,000 for the project and have given 4 months to complete. How do I develop a WBS and WBS Dictionary for this?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a program that creates a histogram

Write a program that creates a histogram that allows you to visually inspect the score distribution of a set of students. The program should prompt the user.

  What is the value of the given twos complement number

What is the value of the following 2's complement number? Express the base 10 number 2110 as a base 4 number_________.

  Will line-of-sight transmission possible between two tower

Will line-of-sight transmission be possible between the two towers? Justify your answer. Describe an engineering solution to obtain line-of-sight transmission.

  Describe resources you found that might provide insight

Conduct research and describe resources you found that might provide insight into measuring the likelihood that some of the threats would actually occur.

  Describe real-life applications you can imagine for needs

List and describe real-life applications you can imagine/develop for your personal needs, at your work or any other practical use.

  What materials will you use in the study

What materials will you use in the study? Will you use an interview protocol? If so, then provide the protocol that you will use for a qualitative study

  Discuss how to protect computer systems

There are a number of tools that have been designed to help protect computer systems, and the data stored on them

  Find all irreducible polynomials

The best approach for doing this is to consider all polynomials of lower degree and check whether they are factors. Please note that we only consider monic irreducible polynomials, i.e., polynomials with the highest coefficient equal to one.

  What information is omitted

What is good about this article. What are its strengths. What are its weaknesses. What is not correct

  Develop a complete disaster recovery plan to your company

Using an organization of your choice: Develop a Complete Disaster Recovery Plan to be submitted to the executive board of your company.

  Write down a windows application which randomly generates a

write a windows application that randomly generates a number from 0 through 100. prompt the user to guess the number.

  What is meant by atm having classes of service

What is meant by ATM having classes of service? Describe some applications that incorporate computer-telephony integration.

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