Question

In: Computer Science

Using C++, create a program that will input the 3 game scores of a player and...

Using C++, create a program that will input the 3 game scores of a player and then output the level of the player with a message.
 
Specifications
Prompt the user to input 3 game scores (double values).
Compute the weighted average (DO NOT JUST ADD AND DIVIDE BY 3!) score as follows:
20% for first game, 30% for second game, 50% for last game
Earlier games are worth less in the weighted average; later games are worth more.
Print the level of the player expertise based on the weighted average as follows:
average >= 2000:  expert
average is >= 1800 but is < 2000 master
average is >= 1500 but is < 1800: advanced
average is >=1000 but is < 1500: intermediate
average < 1000: beginner
For each expert player print: "Congratulations! You are an expert! "
For each player that is master or advanced print: "Good Job!"
For each player that is a beginner: "Keep on practicing!"
Run the program 2 times on the following input:
Run 1:
600 1500 900
Run 2:
1800 1500 2000

Solutions

Expert Solution

#include<iostream>
using namespace std;

int main()
{
   double s1,s2,s3,avg;
  
   cout<<"Please enter the values of game scores :";
   cin>>s1>>s2>>s3;
  
   avg = (s1*0.2)+(s2*0.3)+(s3*0.5);   // Computing weighted average according to the game weightage
  
   if(avg >= 2000)
   {
       cout<<"Expert\n";
       cout<<"Congratulations! You are an expert! \n";
   }
   else if(avg >= 1800 && avg < 2000)
   {
       cout<<"Master\n";
       cout<<"Good Job!\n";
   }
   else if(avg >= 1500 && avg < 1800)
   {
       cout<<"Advanced\n";
       cout<<"Good Job!\n";
   }
   else if(avg >= 1000 && avg < 1500)
   {
       cout<<"Intermediate\n";
   }
   else if(avg < 1000)
   {
       cout<<"Beginner\n";
       cout<<"Keep on practicing!\n";
   }
   return 0;
}


Sample run# 1
600 1500 900
output : Intermediate

Sample run# 2
1800 1500 2000
output :Master
Good Job!


Related Solutions

Create a c++ program with this requirements: Create an input file using notepad ( .txt )...
Create a c++ program with this requirements: Create an input file using notepad ( .txt ) . When testing your program using different input files, you must change the filename inside your program otherwise there will be syntax errors. There are a finite number of lines to be read from the data file. But we can’t assume to know how many before the program executes; so, the standard tactic is to keep reading until you find the “End of File”...
Using C++ Create a program that asks the user to input a string value and then...
Using C++ Create a program that asks the user to input a string value and then outputs the string in the Pig Latin form. - If the string begins with a vowel, add the string "-way" at the end of the string. For “eye”, it will be “eye-way”. - If the string does not begin with a vowel, first add "-" at the end of the string. Then rotate the string one character at a time; that is, move the...
Create a c++ program that: Create an input file using notepad ( .txt ). When testing...
Create a c++ program that: Create an input file using notepad ( .txt ). When testing your program using different input files, you must change the filename inside your program otherwise there will be syntax errors. There are a finite number of lines to be read from the data file. But we can’t assume to know how many before the program executes; so, the standard tactic is to keep reading until you find the “End of File” marker. Input date...
Using Perl create a program that will output the scores of 3 golfers that are playing...
Using Perl create a program that will output the scores of 3 golfers that are playing nine holes of golf. Create a blank array, this will be a two-dimensional array @golf_array; Load up the follow scores For hole 1: Golfer 1 shot 4, Golfer 2 shot 3, Golfer 3 shot 5 For hole 2: Golfer 1 shot 3, Golfer 2 shot 3, Golfer 3 shot 4 For hole 3: Golfer 1 shot 7, Golfer 2 shot 5, Golfer 3 shot...
Write a C++ program that prompts the user (or “Player 1”) to input an integer value...
Write a C++ program that prompts the user (or “Player 1”) to input an integer value between 1 and 3 (where 1=paper, 2=scissor, and 3=rock). This input should be passed into a string function called player_RPS(), and returns a string value indicating the selection of paper, scissors, or rock (as mentioned above). Next, the returned string value, along with a generated input from the computer, should be passed into a void function called RPS_comparison(), and determines whether the user’s input...
C Program: Create a C program that prints a menu and takes user choices as input....
C Program: Create a C program that prints a menu and takes user choices as input. The user will make choices regarding different "geometric shapes" that will be printed to the screen. The specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Important! Consider which control structures will work best for which aspect of the assignment. For example, which would be the best to use for a menu?...
C Program: Create a C program that prints a menu and takes user choices as input....
C Program: Create a C program that prints a menu and takes user choices as input. The user will make choices regarding different "geometric shapes" that will be printed to the screen. The specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Your code must contain at least one of all of the following control types: nested for() loops a while() or a do-while() loop a switch() statement...
C++ needed Create a loop which gives the player instructions on what to input. Then read...
C++ needed Create a loop which gives the player instructions on what to input. Then read input from the player. The input will be either one of three options: • If the user enters the word “answer” or some other string you choose to indicate the player is ready to end the game and guess. In this case, output the hidden rule. • Three numbers separated by spaces. Let’s call a trio of numbers and the corresponding output a Guess....
Write a C++ program that scores a blackjack hand. In blackjack, a player receives from two...
Write a C++ program that scores a blackjack hand. In blackjack, a player receives from two to five cards. The cards 2 through 10 are scored as 2 through 10 points each. The face cards --- jack, queen, and king ---- are scored as 10 points. The goal is to come as close to a score of 21 as possible without going over 21. Hence, any score over 21 is called “busted”. The ace can count as either 1 or...
** USING MATLAB TO PROGRAM The main objective of this lab is to create a game...
** USING MATLAB TO PROGRAM The main objective of this lab is to create a game that involves betting on the sum of two dice. The player will start out with some initial total amount of money. During each round, the player can bet some money that the sum of the two dice will be equal to a certain number. If the player wins the bet, that player adds the amount of the bet to his or her current total....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT