2. The manager of a basketball stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets – box, sideline, premium, and general admission. After each game data is stored in a file in the following forms: ticketPrice numberOfTicketsSold Sample data are shown below: 250 5750 100 28000 50 35750 25 18750 The first line indicates that the box ticket price is 250 pesos and that 5750 Tickets were sold at that price. Output the number of the tickets sold and the total sale amount. Format your output with two decimal places.
Q: A straight line can be defined by a pair of points pi(x1, yı) and p2(x2, y2). The slope m of a line…
A: #Student Id:#Full Name:#Section Number:from math import infimport sys def printHeader():…
Q: You will create a new version of the restaurant ordering program you created below in which the…
A: I have used "menu.txt" for the menu items as opposed to the predefined lists. def…
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: The pressure of a gas changes as the volume and temperature of the gas vary. Write a program that…
A: Files are used to store data permanently in a storage device. In the file handling feature of C++…
Q: QI: Write a program to calculate the average of four integer score, and find the grade for 7…
A: Required: Read scores from a txt file using c++ and print the average and grade to a new text file…
Q: (Late Assignments will not be accepted for any reason) Counting the character occurrences in a file…
A: PROGRAM CODE: #include <stdio.h> #include <stdlib.h> //Function to print histogram…
Q: The manager of a football stadium wants you to write a program that calculates the total ticket…
A: #include <iostream>#include <fstream>#include <iomanip> using namespace std; int…
Q: I this question, you will be given a list of integers, and you have to write in a text file named…
A: Given:- İn python
Q: Muscat marketing research company is conducting a rating survey of different chains of supermarkets.…
A: Program Plan: Read the files as stream. read the file line by line and push the values into the…
Q: Muscat marketing research company is conducting a rating survey of different chains of supermarkets.…
A: the code is an given below :
Q: Question: Write a program called commasperiods.c which reads through the file commasperiodsin.txt…
A: Given:
Q: Exercise #3: Write a program that finds all students who score the highest and lowest average marks…
A: //hw2.java import java.io.File;import java.io.FileNotFoundException;import java.io.FileWriter;import…
Q: A company hired 10 temporary workers who are paid hourly and you are given a data file that contains…
A: Actually, given information: A company hired 10 temporary workers who are paid hourly and you are…
Q: Problem: Write a Python program that reads from an input file named employees.txt some employee…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.…
Q: Q1: Write a program to calculate the average of four integer score, and find the grade for 7…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: I this question, you will be given a list of integers, and you have to write in a text file named…
A: In the solution of the given problem to print the bar into the file, first, we need to open file…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: In the given version of code, code is not properly indented. and content of list sg is like…
Q: Unfortunately, the change from int to Month means that it's harder to read Date objects from an…
A: Month toMonth ( int mm) C++ functionis given below
Q: Your program should use a loop to read data from a text file which contains students' names and 3…
A: def main(): #set count of grades readFile() #readFile reads text file scores.txt and print the…
Q: Exercise 5: Write a python program that reads from a text file whose name is provided by the user…
A: Required: Write a python program that reads from a text file whose name is provided by the user…
Q: Write a program that reads from a text file named “sales.txt”, which contains the sales figures…
A: Please find the answer below :
Q: Description Write a program to compute average grades for a course. The course records are in a…
A: Algorithm: 1. Open the text file. 2. Print error if file not opened. 3. Open average.txt and write…
Q: SOLVE a question from "Starting out with Python" by Tony Gaddis Chapter 8, question number 14, the…
A: Open and read the file GasPrice.txt Delete new line \n from the list in file Define dictionaries for…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: The answer given as below:
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: here i written code in c++ as per problem define below.
Q: Problem: Write a Python program that reads from an input file named employees.txt some employee…
A: Using python 2.7 def printHeader():print…
Q: and Biology, in a text file. The program will ask the user to input grades for each of the four…
A: #include<stdio.h>#include<conio.h> void main (){ float m1,m2,m3; float per,avg; float…
Q: (19) A file named "Fruit.txt" contains unknown number of fruit (maximum number of fruit is 50). Each…
A: #include <iostream>#include <fstream>#define size 100using namespace std;int main(int…
Q: Muscat marketing research company is conducting a rating survey of different chains of supermark The…
A: #include<iostream>#include<conio.h>#include<fstream>#include<string>#include…
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Muscat marketing research company is conducting a rating survey of different chains of supermarkets.…
A: #include<iostream> #include<conio.h> #include<fstream> #include<string>…
Q: The objective of this problem is to show that you can write a program that reads a text file and…
A: Here is the approach Create the file Create the list . Read the file in the list so the list can…
Q: Exercise #3: Write a program that finds all students who score the highest and lowest average marks…
A: for your requirements i have provided the in detail
Q: A University has the following information about its faculty and the number of graduate students…
A: Open the files. Start a loop to read the contents of the file. Iterate the loop till length of data…
Q: or this assignment, you will write a program that reads employee work data from a text file, and…
A: Java is an Object oriented programming like c++ which was developed by Sun microsystems It…
Q: Add this comment: # LAB 5: Part 2 Write a program that calculate the sum and the average of random…
A: Answer in step2
Q: Design a program that reads a file called sales.txt containing the following data: Jane,…
A: Input : Given the python file. Output : Produce the output as given.
Q: Write a program that uses a text file to store weekly payroll data for the office. The program…
A: Introduction to Program In this C++ program, the file handling concept is used. Please make a text…
Q: A vehicle inspection station keeps records of its checking services in a text "inspection.txt").…
A: Below is the implementation:-
Q: In the student sample program files for this chapter, you will find a text file named…
A: Code : HousePrice.cs File: namespace HousePriceAnalysis { class HousePrice { //…
Q: The following table that is available in a file “rain.txt" shows the amount of rain in mm³ that fell…
A: Why files are needed? When a program is terminated, the entire data is lost. Storing in a file will…
Q: Given a text file containing the availability of food items, write a program that reads the…
A: Code Screenshot :
Q: b) You are supposed to write a program to calculate the body mass index (BMI) of 3 members of your…
A: Pseudocode is a sequence of shortened steps to solve a problem. It can be implemented in any…
Q: Modify this program so that it writes the values in two columns, like this: 32.ee 54.00 67.5e 29.00…
A: To write the values into two columns in the output file, the code can be modified as shown below.…
Q: Muscat marketing research company is conducting a rating survey of different chains of supermarketS.…
A: In this question we have to perform the following task using file handling in C++. What and when to…
Q: How do I write a python program that creates a text file to store scoring stats for the Tampa Bay…
A: """python program that creates a text file to store scoring stats for the Tampa Bay Lightning"""…
Q: C++ A company hired 10 temporary workers who are paid hourly and you are given a data file that…
A: #include <iostream> #include <fstream> #include <string> using namespace std;…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: The Answer start from step-2.
Q: In C++, how to read a number with decimal in input file and write that decimal number in output…
A: To read the third line string name, you can continue using fin >> name3 so that the next…
Q: Write a program to calculate the average of seven integer score, the program should do the…
A: 1.In input.txt file name score1,score2,score3,score4,score5,averagethis table is created.…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets—box, sideline, premium, and general admission. After each game, data is stored in a file in the following form: ticketPrice numberOfTicketsSold … Sample data are shown below: 250.75 5750 100.50 28000 50.25 35750 25.00 18750 The first value indicates that the ticket price is Php 250.75 and that 5750 tickets were sold at that price. Output the total number of tickets sold and the total sale amount using c++ compiler. Format your output with two decimal places.For this assignment, you will write a program that reads employee work data from a text file, and then calculates payroll information based on this file. The text file will contain one line of text for eachemployee. Each line consists of the following data (delimited by spaces or tabs):1) employee’s id2) employee’s hourly wage rate3) hours worked Monday4) hours worked Tuesday5) hours worked Wednesday6) hours worked Thursday7) hours worked Friday ex) txt file attached Your program should first prompt the user to get the location of the input file. Then it will read the data from the file, put it in appropriate arrays (as described below), and output to the screen the following information: (1) the employee ID, total number of hours worked, regular pay, overtime hours, overtime pay, and total paid to each employee (2) the total hours worked by all employees throughout the week; (3) the total amount paid out to all employees for the week; (4) the employee who received the highest pay for…"In the student sample program files for this chapter, you will find a text file named house_prices.csv. The file contains the following data about houses for sale in a city: Price Number of bedrooms Number of bathrooms Square feet of living space The data stored in each line is formatted in the following way: Price,Bedrooms,Bathrooms,SquareFeet Notice that the data items are separated by commas. The first line in the file looks like this: 221900,3,1,1180 The data stored in this line is: Price = $221,900 Bedrooms = 3 Bathrooms = 1 Square feet = 1,180 Design a class that has properties for the four pieces of data. In an application, read the file and store each house’s data in an instance of the class. The class instances should be stored in a List. The application should let the user search the List for the prices of houses with the number of bedrooms within a range, the number of bathrooms within a range, and the square feet of living space within a range. For…
- The course records are shown below: Each student has 4 assignments. 108194 9 10 10 10 197526 10 10 10 10 197008 10 10 0 10 197746 10 10 9 10 108154 10 0 10 9 Create an input file ‘CSassignments.txt’ using an editor such as Notepad++ with a student number, then a space, then four assignment marks on one line. The assignment marks are whole numbers and are separated by a space. Your C++ program will read from the file ‘CSassignments.txt’ and write to a second file ‘CSgrades.txt’ which includes the average of the student’s four assignments. e.g. 108194 9 10 10 10 9.75 Your C++ program should work with any number of records in the ‘CSassignments.txt’ input file – that is – test your program with TWO records…Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). The following shows part of a typical data file: Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 The program should compute the GPA (grade point or quality point average) for each student (the total quality points divided by the number of semester hours) then write the student information to the output file if that student should be put on academic warning. A student will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other students. The file Warning.java contains a skeleton of the…Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). The following shows part of a typical data file: Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 The program should compute the GPA (grade point or quality point average) for each student (the total quality points divided by the number of semester hours) then write the student information to the output file if that student should be put on academic warning. A student will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other students. The file Warning.java contains a skeleton of the…
- I need help with a java problem: Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. Assume also the last names and first names do not contain whitespaces. - (The rest in described in the attached image) Code - import java.util.Scanner;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.PrintWriter;import java.io.IOException; public class LabProgram { public static void main(String[] args) throws IOException { Scanner scnr = new Scanner(System.in); /* TODO: Declare any necessary variables here. */ /* TODO: Read a file name from the user and read the…C++ Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. Assume also the last names and first names do not contain whitespaces. The program performs the following tasks: Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores, and letter grades of the…This is the statement it gives - Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. Assume also the last names and first names do not contain whitespaces. The program performs the following tasks: Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores,…
- Given a text file food.txt containing the availability of food items. Write a program that reads the information from the text file and outputs the available food items. Add comments to better understand it txt.file content ========== Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Beverages Water 16oz bottled water Available Vegetarian Avocado sandwich Sliced avocado with fruity spread Not available Mexican food Beef tacos Ground beef in freshly made tortillas Available Mexican food Chicken tacos Grilled chicken breast in freshly made tortillas Not available Beverages Coca-Cola 16oz Coca-Cola AvailableCode should be in Python. Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate lists, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character ('\t'). (Examples in image)Your program should use a loop to read data from a text file which contains students' names and 3 exam scores. The program should calculate the exam average for each student, determine the appropriate letter grade for that exam average, and print the name, average, and letter grade. After printing all this, you need to print the count of the total number of A's, B's, C's, D's, and F's for the whole class. The text file you need to use can be accessed using this link: scores.txt. Copy this file to the folder where your program will reside. The text file contains a list of 30 records, and each record contains a name and that person's 3 test scores. Each field is separated by a tab character. The first 2 records looks like this: Davis 88 92 84Wilson 98 80 73 and so on. Your program will need to open this file and read each line until the end of file. I recommend calculating a student's exam average and letter grade as you read the file, although this is not a…