Question
Write a program in C++ Lightening Lanes Case Study Problem Statement On Tuesday afternoons, Lightening Lanes Bowling Alley runs a special class to teach children
Write a program in C++
Lightening Lanes Case Study
Problem Statement On Tuesday afternoons, Lightening Lanes Bowling Alley runs a special class to teach children to bowl. Each lane has an instructor who works with a team of four student bowlers and instructs them as they bowl three lines (games). The management of Lightening Lanes has asked you to develop a program that will report each students 3-game average score and compare it to the average score they bowled the previous week. In this way, the students can see how much they are improving. The program will utilize looping structures and data validation techniques you learned in Chapters 1-5.
Input: Input should come from the keyboard, using suitable prompts. First the team name should be entered. Then, for each of the four students on the team, the program should input their name, their previous weeks average score, and their score from each of todays games. The score for each game must be between 0 and 300.
Output: Output should be written to a file. It should be in the form of a report that lists the team name, each students name, their 3-game average from last week, and their 3-game average from today.
Program Design General Pseudocode The following general pseudocode lists the steps the program must carry out. Open the output file Input the team name Print report heading which includes team name For each of the 4 students Input the students name Input and validate their last weeks bowling average Input, validate, and add up each of their game scores from today Print student name, last weeks average and todays calculated average End for Close the file
Variables Whose Values Will be Input string teamName // the team name name // a students name double oldAvg // a students previous weeks averages score // a students score for 1 game
Variable Whose Value Will be Accumulated int total // a students total 3-game score
Detailed Pseudocode (including actual variable names and needed calculations) Open the output file Input teamName Print report heading which includes teamName For each of the 4 students total = 0 Input name, oldAvg While oldAvg < 0 or oldAvg > 300 Print error message Input oldAvg End While For each of todays 3 games Input score While score < 0 or score > 300 Print error message Input score End While total = total + score End For Print name, oldAvg, total / 3.0 End For Close the file
The Program The next step, after the pseudocode has been checked for logic errors, is to expand the pseudocode into the final program. The source code listing for this program follows
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started