Problem Solving with C++ (10th Edition)
Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 19PP

Write a program that manages a list of up to 10 players and their high scores in the computer’s memory. Use two arrays to manage the list. One array should store the player’s name and the other array should store the player’s high score. Use the index of the arrays to correlate the name with the score. In Chapters 10 and 11, you will learn a different way to organize related data by putting them into a struct or class. Your program should support the following features:

a. Add a new player and score. If it is one of the top 10 scores then add it to the list of scores. The same name and score can appear multiple times. For example, if Bill played 3 times and scored 100, 100, and 99, and Bob played once and scored 50, then the top scores would be Bill 100, Bill 100, Bill 99, Bob 50.

b. Print the top 10 names and scores to the screen sorted by score with the highest score first.

c. Allow the user to enter a player name and output that player’s highest score if it is on the top 10 list or a message if the player’s name has not been input or is not in the top 10.

d. Allow the user to enter a player name and remove the highest score for that player from the list.

Create a menu system that allows the user to select which option to invoke.

Blurred answer
Students have asked these similar questions
Implement this program to understand use of Arrays in real world examples. A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You are to write an application to assign seats on each flight of the airline’s only plane (capacity: 10 seats). Your application should display the following alternatives: Please type 1 for First Class and Please type 2 for Economy. If the user types 1, your application should assign a seat in the first-class section (seats 1–5). If the user types 2, your application should assign a seat in the economy section (seats 6–10). Your application should then display a boarding pass indicating the person’s seat number and whether it is in the first-class or economy section of the plane. Use a one-dimensional array of primitive type boolean to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the…
use c++ to write a program that manages a list of up to 10 players and their high scores in the computer's memory. Use two arrays to manage the list. One array should store the player's name and the other array should store the player's high score. Use the index of the arrays to correlate the name with the score. In Chapters 10 and 11, you will learn a different way to organize related data by putting them into a struct or class. Your program should support the following features: a. Add a new player and score. If it is one of the top 10 scores then add it to the list of scores. The same name and score can appear multiple times. For example, if Bill played 3 times and scored 100, 100, and 99, and Bob played once and scored 50, then the top scores would be Bill 100, Bill 100, Bill 99, Bob 50. b. Print the top 10 names and scores to the screen sorted by score with the highest score first. c. Allow the user to enter a player name and output that player's highest score if it is on the top…
JAVA Your teacher has created two arrays, each holding the results of tests, say Test 1 and Test 2. You need to create a new array which holds the averages of these two tests. You may assume that the first element of the first test array refers to the student who also has the grade in the first element of the second test, and the last element in each array are the grades the last student earned for each test. All students received grades for both tests, meaning both test arrays are of the same length. Complete the method, named makeAverage, in the class named Grades.java. There are two parameters to this method: the first is the integer array representing the grades of the first test, and the second is the array containing the grades of the second test. The new average array should be returned by the method. The grades should be treated as double variables. For example, consider the test grades for the five students in the following arrays:   [ 87 ]    [ 91 ]  [ 76 ]    [ 76 ]  [ 94 ]…

Chapter 8 Solutions

Problem Solving with C++ (10th Edition)

Ch. 8.1 - What string will be output when this code is run?...Ch. 8.1 - Prob. 12STECh. 8.1 - Consider the following code (and assume it is...Ch. 8.1 - Consider the following code (and assume it is...Ch. 8.2 - Consider the following code (and assume that it is...Ch. 8.2 - Prob. 16STECh. 8.2 - Consider the following code: string s1, s2...Ch. 8.2 - What is the output produced by the following code?...Ch. 8.3 - Is the following program legal? If so, what is the...Ch. 8.3 - What is the difference between the size and the...Ch. 8 - Create a C-string variable that contains a name,...Ch. 8 - Prob. 2PCh. 8 - Write a program that inputs a first and last name,...Ch. 8 - Write a function named firstLast2 that takes as...Ch. 8 - Write a function named swapFrontBack that takes as...Ch. 8 - Prob. 6PCh. 8 - Write a program that inputs two string variables,...Ch. 8 - Solution to Programming Project 8.1 Write a...Ch. 8 - Write a program that will read in a line of text...Ch. 8 - Give the function definition for the function with...Ch. 8 - Write a program that reads a persons name in the...Ch. 8 - Write a program that reads in a line of text and...Ch. 8 - Write a program that reads in a line of text and...Ch. 8 - Write a program that can be used to train the user...Ch. 8 - Write a sorting function that is similar to...Ch. 8 - Redo Programming Project 6 from Chapter 7, but...Ch. 8 - Redo Programming Project 5 from Chapter 7, but...Ch. 8 - Prob. 11PPCh. 8 - Write a program that inputs a time from the...Ch. 8 - Solution to Programming Project 8.14 Given the...Ch. 8 - Write a function that determines if two strings...Ch. 8 - Write a program that inputs two strings (either...Ch. 8 - Write a program that manages a list of up to 10...
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
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
9.1: What is an Array? - Processing Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=NptnmWvkbTw;License: Standard Youtube License