Combine the programs from
Total number of scores
Total number of each letter grade
Percentage of total for each letter grade
Range of scores: lowest and highest
Average score
As before, enter a negative score as a sentinel value to end the data input and display the statistics.
Trending nowThis is a popular solution!
Chapter 4 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Python (4th Edition)
Electric Circuits. (11th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
- Problem Definition Task. Your task is to develop a python program that reads input from text file and finds if the alphanumeric sequence in each line of the provided input file is valid for Omani car license plate. The rules for valid sequences for car plates in Oman are as follows: Each sequence is composed of 1 to 5 digits followed by one or two letters. Digits cannot start with 0, for instance, 00, 011, or 09 are not valid digit sequences. The following list are the only valid letter combinations: ['A','AA','AB','AD','AR','AM','AW",'AY"', 'B', BA','BB','BD',"BR','BM',"BW',"BY', 'D','DA','DD','DR','DW','DY', 'R','RA','RR','RM','RW','RY', 'S','SS', 'M','MA','MB','MM','MW','MY", "W',"WA',WB',"wW', Y,YA','YB','YD','YR','YW',YY] Program Input/Output. Your program should read input from a file named plates.txt and write lines with valid sequences to a file named valid.txt. Any line from the input file containing invalid sequence should be written to a file named invalid.txt. Each line…arrow_forward2. Write a general program that creates a table as seen below. Your program should calculate the grade average. You can only use integer or character multi-dimensional arrays to store or calculate data values. You are only allowed to use loops to calculate and print the table. All calculation and printing should be made in gradecalculator function. Data should be taken in the main function. Names Homework Midterm 1 Midterm 2 Final Grade 10% 20% 20% 50% average Ali 89 70 61 60 Ahmet 78 60 59 88 Ayse 99 70 77 66 Есе 100 68 55 72 Selen 80 55 30 82arrow_forwardTransient PopulationPopulations are affected by the birth and death rate, as well as the number of people who move in and out each year. The birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. Write a program that displays the size of a population for any number of years. The program should ask for the following data: The starting size of a population P The annual birth rate (as a percentage of the population expressed as a fraction in decimal form)B The annual death rate (as a percentage of the population expressed as a fraction in decimal form)D The average annual number of people who have arrived A The average annual number of people who have moved away M The number of years to display nYears Write a function that calculates the size of the population after a year. To calculate the new population after one year, this function should use the formulaN = P + BP - DP + A - Mwhere N is the…arrow_forward
- Assignment Write a program that moves a forester unit and a desert corps unit to a given target location and prints the number of hours it took for each unit to reach the target. First, the user will give the starting X and Y positions of the forester unit as well as its base speed (all ints). Then, the starting X and Y positions of the desert corps unit as well as its base speed (all ints). Finally, the target X and Y positions (both ints) and the terrain type (std::string). Speeds are given as distance traveled in one full day (i.e., 24 hours) and is affected by the terrain type using a multiplier over the base speed. Also, after 1 full day, each unit rests for a certain number of hours. Speed multiplier and rest amount of each type of unit depending on the terrain type are as below. Speed Multiplier Rest Duration After 1 day Terrain type Forester Desert Corps Forester Desert Corps Forest 1.3 0.6 4 12 Desert 0.4 1.2 15 6 Hills 0.7 0.8 6 8 Others 1.0 0.8 8 6 After getting all this…arrow_forwardQuestion 3 The results from the mayor's race have been reported by each precinct as follows: Table 2: Results of mayor's race Precinct Candidate A Candidate B Candidate C Candidate D 1 192 48 206 37 147 90 312 21 186 12 121 38 4 114 21 408 39 267 13 382 29 Write a program to do the following: (a) Display the table with appropriate labels for the rows and columns. (b) Compute and display the toral number of votes received for each precinct. (c) The program displays the highest votes among the precinct. (d) The program displays the total number of votes for Candidate A.arrow_forwardSection: Algorithm 7. s] A transport consultant has created a file of information about trips collected from individuals who have participated in a survey. This information includes start_time and end_time variables. One of the items contained in the file is the duration of each trip (that is, end_time – start_time) in minutes. The consultant is trying to work out how to calculate the number of trips with duration greater than 60 minutes (that is, how many trips take longer than an hour) and requires your assistance to develop an algorithm. You can assume that the durations are read one at a time and should only be read until EOF (end of file) is reached. i. ] *Develop a flowchart to show your algorithm, using the diagrammatic conventions described in the lecture. s] What is the likely complexity of your program using big-O notation? ** 11. Clearly point out what the primary parameters are and define your terms.arrow_forward
- Please help me write the code using PYTHONarrow_forwardPython coding exercise: please include comments to further my understanding Goal #1: import financial data given into your program provided to you as a CSV formatted text file Use the following data for testing (the following is only a sample of the data; there are over 4000 rows of data):*Note: The data you will read in is linear by date (but, non-contiguous due to holidays and weekends,) reflecting a timeline of stock performance in chronological order; however your program should run through the days in the data from the earliest date to the most recent Date Open High Low Close Adj Close Volume 1/3/2000 3.745536 4.017857 3.631696 3.997768 2.69592 1.34E+08 1/4/2000 3.866071 3.950893 3.613839 3.660714 2.468626 1.28E+08 1/5/2000 3.705357 3.948661 3.678571 3.714286 2.504751 1.95E+08 1/6/2000 3.790179 3.821429 3.392857 3.392857 2.287994 1.92E+08 1/7/2000 3.446429 3.607143 3.410714 3.553571 2.396373 1.15E+08 Write the code in the clearest and most efficient way possible…arrow_forwardAll in one filearrow_forward
- Task 2: Using Function-Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is: 5 C = (F-32) Where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named Celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of Fahrenheit temp. 0 through 20 and there Celsius equivalents. The program should display the number of numbers found in the file, the sum of the numbers, and the average of the numbers.arrow_forward: Animating a Plot Problem: The MATLAB code with the initial conditions and one dimensional motion equation are given in the MProject2_Assignment1_base.m file. Modify the code to explore how to animate the plot, use functions to create plot functionarrow_forwardAir Pacific Limited, Fiji's international airline, operates international and domestic services around the Pacific and to North America and Hong Kong. It has its head office at the Air Pacific Maintenance & Administration Centre in Nadi. You are required to write a program that passengers can use to chose seats for aircraft FJ501. The aircraft has 13 rows with 5 seats in each row. Rows 1 to 4 are first class, the remaining rows are economy class. The program should display the seating plan for the aircraft. Empty seats are shown with x and the seats that are booked will have the passenger name (first name plus initials of other names) on it. To reserve a seat, they have to provide their ticket type (First Class or Economy Class), the seat they prefer and their name (first name plus initials of other names). The program verifies that the seat is empty then only bookings are done. Passengers are also allowed to check the seats they are booked for by providing the passenger name (first…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr