the question is as follows:
Using a switch statement and functions implement the following game.
The player's score starts at 0. Your program should allow the player to input a meaningful sentence as a sequence of characters. The sentence’s length should not exceed 50 characters. The program will calculate the score for the player as follows
+ 5 for each occurrence of a vowel (a,e,i,o,u)
+ 10 for each occurrence of q, z, or w.
-7 for each occurrence of t, s, r, m or n
The program should take into consideration both capital and small case letters. A player wins if he/she can score higher than 10 and loses otherwise. The program then prints the score to the player with a message indicating whether the player won or lost.
After each run, the program should ask the user whether he/she want to give it another try and allows the user to try again as much as the user wants
The following is a sample of an output
In the zoo children enjoy watching squirrels$
SCORE = 14 YOU WIN!!!!!
Programming is fun$
SCORE = -24 YOU LOSE :(
The following functions should be implemented
score: takes in the sentence entered by the user and returns the score that the user has achieved
displayMsg: takes in the user score and prints an appropriate message to the user
main: In the main the program reads the sentence and calls the other functions
i did this but something is wrong !! the output is wrong so any help plzz
#include <iostream>
using namespace std;
int score(char sentence)
{
int score=0;
for (int i=0;i<50;i++,sentence++) {
switch (sentence) {
case 'a': case 'A':
score+=5;
case 'e': case 'E':
score+=5;
case 'i': case 'I':
score+=5;
case 'o': case 'O':
score+=5;
case 'u': case 'U':
score+=5;
case 'q': case 'Q':
score+=10;
case 'z': case 'Z':
score+=10;
case 'w': case 'W':
score+=10;
case 't': case 'T':
score-=7;
case 's': case 'S':
score-=7;
case 'r': case 'R':
score-=7;