Code should be in Python, please
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.
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 a list of strings. Store the integer components of the data points in a list 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 field width value of 33. Column 1 has a minimum field width value of 20. Column 2 has a minimum field width value of 23. (example in image)
6. Output the information as a formatted histogram. Each name is right justified with a minimum field width value of 20. (example in image)
Trending nowThis is a popular solution!
Step by stepSolved in 10 steps with 8 images
- Complete the following statement to create a table named Country. Choose data types based on the following requirements: • ISOCode3 stores the country's code, consisting of one to three letters. Name stores the country's name up to 52 characters. /* Your code goes here */ ( ISOCode 3 /* Your code goes here */ /* Your code goes here */ ); Name Enter a statement to delete the above table. /* Your code goes here */ ;arrow_forwardMenu option C The program reads in data from HowManyHours.txt, displays a report header with the report creator’s name, employee id, and department and who they created the report for. The body of the report displays the total number of students who used the program, the average credits taken, and the average study hours. In the following format –STUDY HOURS REPORT Created for Dr. Payne, A004567893 Dept: Computer Science Created By: Karen Smith, A00494928Dept: Advising Total Students: 3Average Credits: 9.00Average Study Hours: 20.00Menu option DThank the user for using the programTerminates the programarrow_forwardTwitter Data: twitter_url = 'https://raw.githubusercontent.com/Explore-AI/Public-Data/master/Data/twitter_nov_2019.csv'twitter_df = pd.read_csv(twitter_url)twitter_df.head() Question: Write the Number of Tweets per Day Write a function which calculates the number of tweets that were posted per day. Function Specifications: It should take a pandas dataframe as input. It should return a new dataframe, grouped by day, with the number of tweets for that day. The index of the new dataframe should be named Date, and the column of the new dataframe should be 'Tweets', corresponding to the date and number of tweets, respectively. The date should be formated as yyyy-mm-dd, and should be a datetime object. Hint: look up pd.to_datetime to see how to do this.arrow_forward
- Test 9 > run Enter x and y coordinates of the 1st circle: 1.5 0.25 Enter radius of the 1st circle: 1.2 Enter x and y coordinates of the square: 0.3 -2.5 Enter width of the square: 5 Enter x and y coordinates of the 2nd circle: 1.6 -1.1 Enter radius of the 2nd circle: 0.5 Enter x and y coordinates of the query point: 1.6 -1.55 2nd circle and square contain point (1.6, -1.55). Test 10 > run Enter x and y coordinates of the 1st circle: 1.5 0.25 Enter radius of the 1st circle: 1.2 Enter x and y coordinates of the square: 0.3 2.5 Enter width of the square: 5 Enter x and y coordinates of the 2nd circle: 1.6 -1.1 Enter radius of the 2nd circle: 0.5 Enter x and y coordinates of the query point: 1.55 -0.85 Both circles contain point (1.55, -0.85). TASK 1: Study the lecture notes (Powerpoint slides and pre-recorded lectures) and assigned readings on Selection before you start. TASK 2: Replace "??" with your name, creation date, and a description of the program (synopsis). NOTE: DO NOT…arrow_forwardThe Movie table has the following columns: ID - positive integer Title - variable-length string Genre - variable-length string RatingCode - variable-length string Year - integer Write ALTER statements to make the following modifications to the Movie table: Add a Producer column with VARCHAR data type (max 50 chars). Remove the Genre column. Change the Year column's name to ReleaseYear, and change the data type to SMALLINT.arrow_forwardE MyS Mura 04- S Visu: Blac 9 Sign N Hom MyS y goog y! Exer SN c.blackboard.com/ultra/courses/_207342_1/cl/outline Completion Your answers are saved automatically. * Question Completion Status: QUESTION 1 Exercise: Create a statement that will make a copy of the vendors table. The name of the copy should be vendors QUESTION 2 Exercise: Create a statement that will delete the vendors archive table you created in the previous exercise. QUESTION 3 Exercise: Create a statement that will add the following row to the vendor_contact table Click Save and Submit to save and submit. Click Save All Answers to save all answers.arrow_forward
- prepare a flowchart please # inside data sub subarray[serial, name, amount]; # My data; data = [['01','A',4000],['02','B',8000],['03','C',10000],['04','D',12000],['05','E',16000]] serial = 0 name = 1 amount = 2 #update.... total = 0; for i in data: total = total+i[amount] print(f"The total amount is: {total}")arrow_forwardwhich keyword describes fixed sequence of columns and a varifying set of rows.a) rowb) columnc) recordd) tablearrow_forwardMonthly Sales Create a program that allows you to view and edit the sales amounts for each month of the current year. Example COMMAND MENU add - Add sales for specified month view - View sales for specified month edit - Edit sales for specified month totals - View sales summary for year exit - Exit program Command: add Three-letter Month: jan Sales Amount: 10317 Sales amount for Jan is 10,317.00. Command: add Three-letter Month: feb Sales Amount: 15293 Sales amount for Jan is 15,293.00. Command: view Three-letter Month: jan Sales Amount: 14317 Sales amount for Jan is 14,317.00. Command: edit Three-letter Month: jan Sales amount for Jan is 14,317.00. Command: totals Yearly total: 29,610.00 Monthly average: 14,805.00 Command: view Three-letter Month: july Invalid three-letter month. Command: exit Bye! Specifications The program should use a list to store the sales data for each month with the three-letter abbreviation for the month (Jan,…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY