Consider a text file named scores. txt that contains player scores for a game. A possible sample is shown here where Ronaldo’s best score is 10400, Didier’s best score is 9800, etc.
Ronaldo
10400
Didier
9800
12300
Kaka
8400
Cristiano
8000
Write a function named getHighScore that takes a string reference parameter and an integer reference parameter. The function should scan through the file and set the reference parameters to the name of the player with the highest score and the corresponding score.
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Absolute C++
Additional Engineering Textbook Solutions
Concepts Of Programming Languages
Starting Out with Python (4th Edition)
Modern Database Management
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Mechanics of Materials (10th Edition)
- In C++, my program reads from a file, each line of the text file ends in a 1 or 0. How do you make a function that updates the value in the text file to change to from 1 to 0 or 0 to 1?arrow_forwardPythonarrow_forwardComputer Science In C++ can someone make a code where it reads a txt file and displays the text file that has pending shipping orders. I would also like the code to be able to modify the text file in terms of canceling shipping orders or view shipping orders.arrow_forward
- program5_3.pyWrite a program about triangles. You need two files, a module file and an executable file with a main method. Include Psudocode to explain your code. The module file (defines two functions): One function that takes the three sides of a triangle as arguments. It returns True if the sides define a right triangle and False if it doesn't. HINT: This is easiest with a Math module function. The other function must use Heron's Formula to calculate and return the area of a triangle. Learn about Heron's formula online. The main file:Prompt the user to enter the three sides (longest first) of the triangle. Use integers only. Make sure that no side is longer than the sum of the other two sides. Call the function that returns a boolean and use it to output whether the triangle is a right triangle, or not. Call the function that returns the area. Display the value returned with two decimal places. Two Example outputs Enter longest side of the triangle 14 Enter any another side of…arrow_forwardThe program takes a single argument as the name of the file to be read. A sample file is named (Movies.txt). The program reads this file which has labeled columns separated by commas. Every row of this text file includes information about a movie. You are asked to read every row as a string and decompose the given information (separated by commas). If a costumer wants too see "List of the Genres" (or genre,score,year) all genres type must be show. I need this answer in C language. Please explain nicely. Thanks.arrow_forwardPlease write the code in carrow_forward
- Code 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)arrow_forwardIn Python Write a program that consists of (at least) two function: A function that creates and saves data in a file. The saved data represents exam grades. In the function, you will create n random numbers in the range [0,100], where n is the number of students. The function can be called as follows: createFile(filename, n) Main function, in which the user inputs the file name and the number of students, then the main calls function createFile. The main should perform validation for n (should be > 0), and the filename (should end with .txt). I will explain how to validate strings in the coming lecture. Hint: a good developer will write four functions to solve the problem.arrow_forwardin c++: Assume that you have a text file named file1.dat contains some text written into it, write a function named vowelwords(), that reads the file file1.dat and creates a new file named file2.dat, to contain only those words from the file file1.dat which start with a lowercase vowel (i.e., with 'a', 'e', 'i', 'o', 'u').arrow_forward
- C-programming Create a solution that calculates statistics on students' performance data. Write an application where user can enter the course, semester, number of students n and then n records of student and their test grade. This data should be saved to a binary file. Then a second application should read data from that binary file and let the user enter a filter of a course. That application then filters out the data for just that event course, sorts it by grades in descending order and saves it to an HTML file.arrow_forwardC++ 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…arrow_forwardFile names: color_square.py, chessboard.py, test_squares.py Positions on a chess board are identified by a letter and a number. The letter identifies the column; the number identifies the row. See the image below. You will provide the functions that allow us to determine: if a chessboard square is either black or white, given its coordinates. If the row/column is valid or not for the standard chessboard For example, if we pass in “d” for the column and 4 for the row, your function that determines color should return the string: “BLACK”. If we pass in "k" for the column to your function that validates columns, that function should return the boolean False. Requirements: Your function for validating the column should be able to accept upper or lowercase strings as parameters. Your functions for validating the row should be able to accept integers or strings as parameters. Your function that determines black-or-white may assume that the input has been validated prior to us calling…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,