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

  Design c++ program with 4 classes called a,b,c and d

Write down a C++ program with 4 classes called A,B,C and D. D should inherit C, C should inherit B and B should inherit A. All classes should have 1 data member of type int, 1 constructor and 1 function called print.

  How locks could be used in order to qualify data transaction

Describe how locks could be used in order to qualify data transactions and enhance concurrency control. Suggest two business scenarios that would benefit.

  You are a networking intern at richman investments you

you are a networking intern at richman investments. you recently developed a design for a remote access control policy

  Find what is the running time of your algorithm

Design an algorithm that tests whether two given ordered trees are isomorphic. What is the running time of your algorithm?

  Name the guidelines and additional decisions which can be

question 1 which of the guidelines and additional decisions can be incorporated in an automatic statistical thesaurus

  The ajax extensions tab of the toolbox

Inside the ContentTemplate element of the UpdatePanel server control add the standard RadioButtonList server control, Label server control and Button server control.

  Evaluate the coding artifacts in mpeg encoding

Evaluate the coding artifacts (showing up as video noise) in MPEG encoding. Provide the following details: (i) the signal characteristics of video noise (ii) the causes of the video noise, and, (iii) suggest methods to reduce the video noise.

  Create a program to find the number of intersecting pairs

Create a program to find the number of intersecting pairs among a set of N random lines, each line generated with random integer coordinates between 0 and 1000.

  What is the intended meaning of the given queries

Write a PROLOG program which checks if a list contains another as a sublist. What is the intended meaning of the given queries?

  Write a program that simulates a very simple hr application

Write a program that simulates a very simple HR application for a company. You will need to create a class to instantiate a Person object (or Employee object).

  Database saves the state of washington medicaid dollars

Database saves the state of Washington Medicaid dollars, Consider a degree program or your selected industry

  Data representation and logic

Representing Text and Numbers, Binary Arithmetic, Interpreting Logical Statements, Logic Puzzle, Binary and Algorithms.

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