There are three versions of this project.
Version 1 (all interactive). Write a
The output should correctly label the months.
There are a variety of ways to deal with the month names. One straightforward method is to code the months as integers and then do a conversion before doing the output. A large switch statement is acceptable in an output function. The month input can be handled in any manner you wish, as long as it is relatively easy and pleasant for the user.
After you have completed this program, produce an enhanced version that also outputs a graph showing the average rainfall and the actual rainfall for each of the previous 12 months. The graph should be similar to the one shown in Display 7.8, except that there should be two bar graphs for each month and they should be labeled as the average rainfall and the rainfall for the most recent month. Your program should ask the user whether she or he wants to see the table or the bar graph and then should display whichever format is requested. Include a loop that allows the user to see either format as often as the user wishes until the user requests that the program end.
Version 2 (combines interactive and file output). For a more elaborate version, also allow the user to request that the table and graph be output to a file. The file name is entered by the user. This program does everything that the Version 1 program does but has this added feature. To read a file name, you must use material presented in the optional section of Chapter 5 entitled “File Names as Input.”
Version 3 (all I/O with files). This version is like Version 1 except that input is taken from a file and the output is sent to a file. Since there is no user to interact with, there is no loop to allow repeating the display; both the table and the graph are output to the same file. If this is a class assignment, ask your instructor for instructions on what file names to use.
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (8th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
SURVEY OF OPERATING SYSTEMS
Starting Out with Python (4th Edition)
Degarmo's Materials And Processes In Manufacturing
Elementary Surveying: An Introduction To Geomatics (15th Edition)
- Write a program in Python that will store the schedule for a given day for a particular TVstation. The program should ask the user for the name of the station and the day of the weekbefore asking for the name of each TV Program and the Start and Finish times. Once theschedule is complete it should be displayed as a table.as per Figure 3 below.arrow_forwardPython For this lab, you will use a tuple to represent a student record. A student record consists of the student’s name, year, and GPA. For example, (“John”, “Senior”, 3.7) is a record for John who is a senior with a 3.7 GPA. You will write a program that prompts the user for the number of records to enter. Then it reads input from the user for each record. Remember that each record consists of a student’s name, year, and GPA. It then prints the record of each student as shown below. Functions: You will write the following functions: read_records(n) Read n number of records and return a list of records. print_records(records) Takes in a list of records and print each one. main() Prompts the user for the number of records to read, get a list of records from the user, and print the records. Optional: print the average GPA of the students. Sample run: How many students record to enter: 2 Enter student's name: John Enter student's year: junior Enter…arrow_forwardwrite a program that displays, in ascending order,the first names of those students who have attended more than one day of the course.If there are students with the same first name, display their first and last names.arrow_forward
- USING PYTHON, write a program that calculates the total salary of an employee if he or she earns one penny the first day, two pennies the second day and they keep doubling the pay each day. The program should ask the user for the number of days. Then display a table showing what the salary is for each day then show the total pay at the number of days he or she worked for.arrow_forwardmade this program in C++arrow_forwardwrite a program that read an excel sheet that contains some animals' information. The information consists of animal name, its weight in N, its height in m, and its availability in Iraq. The program will ask the user to select one of the available animals, then print the corresponding .informationarrow_forward
- Given a square matrix with the elements 0 or 1, write a program tofind a maximum square submatrix whose elements are all 1s. Your programshouldprompt the user to enter the number of rows in the matrix. The program then displaysthe location of the first element in the maximum square submatrix and thenumber of rows in the submatrix. Here is a sample run: Enter the number of rows in the matrix: 5 ↵EnterEnter the matrix row by row:1 0 1 0 1 ↵Enter1 1 1 0 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵Enter1 0 1 1 1 ↵EnterThe maximum square submatrix is at (2, 2) with size 3 Your program should implement and use the following method to find the maximumsquare submatrix:public static int[] findLargestBlock(int[][] m)The return value is an array that consists of three values. The first two values arethe row and column indices for the first element in the submatrix, and the thirdvalue is the number of the rows in the submatrix.arrow_forwardits supposed to be written in pythonarrow_forwardYou are given a table, hotel_ratings, where each row takes the form [hotel_name, number_of_reviews, rating). You are tasked with finding the number of hotels with a rating over three, and has been reviewed at least 30 times. Write a Python code that calculates the number of hotels satisfying above conditions.arrow_forward
- In pythonarrow_forwardIn Python using the Pandas Module: Find the Player with the Highest Batting Average from 2019, only if their number of plate appearances (PA) >= 250. Plate Appearances (Pl_App), calculated as: Pl_App = HBP + SH + SF + AB + BB + Batting Average (B_AVG) is the ratio of Hits to at Bats. So B_AVG = H / AB, and is reported to three decimal points. Show code and output to prove functionality. Below is 3 years of player data: player year team lg G AB R H HR BB SO IBB HBP SH SF Alan J. 2020 NYA AL 2 0 0 0 0 0 0 0 0 0 0 Barry B. 2020 HOU AL 4 0 0 0 0 0 0 0 0 0 0 Michael J. 2020 CHA AL 60 240 43 76 19 18 59 1 3 0 1 Jim R. 2020 ATL NL 46 160 46 40 14 38 60 2 4 0 0 Nolan R. 2020 TBA AL 54 185 29 48 8 20 74 0 0 0 0 Sammy S. 2020 CHN NL 13 0 0 0 0 0 0 0 0 0 0 Frank T. 2020 SDN NL 3 1 0 0 0 0 1 0 0 0 0 Alan J. 2019 KCA AL 6 0 0 0 0 0 0 0 0 0 0 Barry B. 2019 ATL NL 16 49 4 9 2 2 18 0 0 0 0 Michael J. 2019 LAA AL 38 124 9 20 3 7 55 0 1 0 0 Jim R. 2019 MIN AL 44 89 10 17 0…arrow_forwardThe language is Java. The chapter it is in is on Looping.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning