Absolute C++
Absolute C++
6th Edition
ISBN: 9780133970784
Author: Walter Savitch, Kenrick Mock
Publisher: Addison-Wesley
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 17PP

Given the scores . txt file described in Programming Project 4.16, write two additional functions. The first function should be named getPlayerscore and take a string parameter as input that is a player’s name, and it should return the player’s high score stored in the file. If the player’s name is not in the file, then the function should return 0. The second function should output whether a player’s high score is above average, exactly equal to the average, or below aver-age, where the average is computed from all of the scores in the file. You should design the function appropriately (i.e., determine the function name, parameters, and return values).

Blurred answer
Students have asked these similar questions
IN C++ VISUAL STUDIO   Create two classes one to read data from file, and the other to write data into a file. The data can be about employees having information about employee name, id and designation. You must create a class for employee. There is  a total of 3 classes in your program. In the second class, which is about file writing, you have to write data about 10 employees in file. You can get data from user. In reading class, you have to read information about a specific employee whose id is given by user. Finally write a function to show data about employees whose designation is  “manager”.
Here are the two programs which you may choose from to do this program: 1. Using Files - Student Line Up Modify the Student Line Up program described in Programming Challenge 14 which states: "A teacher has asked all of her students to line up according to their first name. For example, in one class Amy will at the front of the line, and Yolanda will be at the end. Write a program that prompts the user to enter the number of students in the class, then loops to read that many names. Once all of the names have been read, it reports which student would be at the front of the line and which one would be at the end of the line. You may assume that no two students have the same name. You are now to do this program reading names from a file. Names should be read in until there is no more data to be read. I am providing for you a file named LineUp.txt for you to use in writing this program. I suggest that you write it first without the file and then modify to add the file.
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.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY