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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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