Batting Averages
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Starting Out With Visual Basic (7th Edition)
Starting Out with C++: Early Objects
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
- CASE STUDY#:Grade Register Write a grade register program to keep and process the grades of students. The program contain a class called GradeRegister. This class has two data members known as CourseName and an array of integer called Grades. The array Grades keep the grades of students of the same course. GradeRegister class have three methods as GetHighestGrade(), GetLowestGrade() and GetAverageGrade().The method GetHighestGrade return the maximum grade as integer from the array Grades and GetLowestGrade return the minimum grade value as integer from the array Grades. The GetAverageGrade method will return the average of grades from Grades array as float value. The parameterized constructor inside GradeRegister class will take two parameters to initialize the two data members of same class as mentioned before. Write a driver class GradeRegisterDriver to declare and initialize an integer array for grades and pass through the GradeRegister class constructor along with the course name.…arrow_forwardc++ The program reads data about two contestants from the keyboard and displays the scores and the winner of the two contestants. The program uses a data structure called Contestant for storing the scores of a contestant and a set of functions related to the data structure for processing the scores of contestants. The data structure, Contestant, contains an int variable for the contestant's ID and an array of doubles for the scores given to the contestant. Each ID must be a positive integer. Each score must fall in the range from 0.0 to 10.0 inclusive. Your job is to complete the program so that its output matches the expected outputs when testing with the same test data. First, complete everything that is required of you at the top of the file. Then complete those and only those incomplete functions according to their descriptions. Each of the incomplete functions has the following line in its body. // Write your code with comments . . . Remove that line and complete the function.…arrow_forwardAddy basics Javaarrow_forward
- Lotto Program C++Write a program that simulates the Powerball lottery. In Powerball, a ticket is comprised of 5 numbers between 1 and 69 that must be unique, and a Powerball number between 1 and 26. The Powerball does not have to be unique. Hint: You can use an array to represent the 5 unique numbers between 1 and 69, and an integer variable to represent the powerball. The program asks the player if they'd like to select numbers or do a 'quickpick', where the numbers are randomly generated for them. If they opt to select numbers, prompt them to type the numbers in and validate that they are unique (except the powerball), and in the correct range. The program then generates a 'drawing' of 5 unique numbers and a Powerball, and checks it against the user's lotto ticket. It assigns winnings accordingly. Because it is so rare to win the lottery, I suggest hard coding or printing values to when testing the part of the program that assigns winnings.arrow_forwardC++ Coding Write a program that asks a teacher to enter the student's and the grades received on her quarterly exams. The datatype for the student's name could be a string and the four grades should be entered in an array of data types int. Test scores are on the base of 100. The main() functions describe the average function with the following title line: double avg( int grades[] , int cap ): The program prints the student's name, her four grades, and her average grades. The main() function also uses the following print function: void print( int grades[], int cap);arrow_forwardClass and Data members: Create a class called Student that stores a student’s grades (integers) in a vector (do not use an array). The class should have data members that store a student’s name and course for which the grades are earned. Constructor(s): The class should have a 2-argument constructor that receives the student’s name and course as parameters and sets the appropriate data members to these values. Member Functions: The class should have functions as follows: Member functions to set and get the student’s name and course variables. A member function that adds a single grade to the vector. Only positive grades are allowed. Call this function AddGrade. A member function to sort the vector in ascending order. A member function to compute the average (x̄) of the grades in the vector. The formula for calculating an average is x̄ = ∑xi / n where xi is the value of each grade and n is the total number of grades in the vector. A member function to determine the lowest…arrow_forward
- C# application that will allow users to enter values store all the expenses on that month in an array clothes, food, cool drinks, water, meatarrow_forwardPROGRAMMING LANGUAGE: C++ Write a program which has a class named FileHandlerto read StudentName, MarksObtained from the attached picture. The class should have a function which calculates grade for a student and then adds it in a new column i.e. Grade. The grade should be calculated considering the following criteria. A: 87-100, B+: 80-86, B: 72-79, C+: 66-71, C: 60-65, D: 50-59, F: 0-49 The file should be saved once grade for all students is calculated. Write the driver program for executing the task.arrow_forwardC++ programming Chapter(s) Covered: Chapter 1-8 Concepts tested by the program: Working with one dimensional parallel arrays Use of functions Use of loops and conditional statements Project Description The Lo Shu Magic Square is a grid with 3 rows and 3 columnsshown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly. Each number 1 – 9must not be used more than once. So, if you were to add up thenumbers used, The sum of each row, each column and each diagonal all add upto the same number, Write a program that simulates a magic square using 3 onedimensional parallel arrays of integer type. Each one the arrays corresponds to a row of the magicsquare. The program asks the user to enter the values of the magicsquare row by row and informs the user if the grid is a magicsquare or not. See the sample outputs for more clarification. Project Specifications Input for this project: Values of the grid (row by row) Output for this…arrow_forward
- C++ Visual 2019 Write a program that has an array of at least 100 randomly generated integers. It should call a function that uses the linear search algorithm to locate one of the values. The function should keep a count of the number of comparisons it makes until it finds the value. The program then should call a function that uses the binary search algorithm to locate the same value. it should also keep count of the number of comparisons it makes. Displays these values with an appropriate description.arrow_forwardC Programming qn Write a program that stores the mark allocation weights for 4 assessments as shown in the table below in an array. The program must prompt the user to enter their full name and the 4 mark assessments as follows: "Please enter your first name and your last name: " "Please enter the project mark: " "Please enter the practical mark: " "Please enter test 1 mark: " "Please enter test 2 mark: " The program must use the weights and the entered mark values to calculate the final mark for the student and display the student's name and final mark. Note: format the displayed values to two decimal points. The program must perform the following functionality: Creates a four-element array with the correct data type to store the weights. Prompts the user to obtain the four assessment values. | Prompts the user to for their first name and last name. Calculates the final mark. Prints the student name and final mark to the screen. Assessment Description Weight Project 0,35 Practical…arrow_forwardc++ programming languagearrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning