Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Name :
Group :
Matric No. : 15
Question 1
d) A function call may or may not have formal parameters in its statement.
(5 marks)
Question 2
The program given below is a program to find the highest goals scored by the players. This
program will allow the user to enter player details until the user chooses to stop entering
details. Your task is to fill in the blanks with the most appropriate statements.
(10 marks)
Sample Input/Ouput:
1
CSC128 (Fundamental of Computer Problem Solving) | Mar – Jul 2018 | Quiz 02
int highestGoalScore(int,int);
int main()
{
char answer,playerName[30],teamName[30];
int goalScore,yellowCard,max=0;
___(a)___ //loop starts here
{
cout << "Enter player name : ";
cin.getline(playerName,30);
cout << "Enter team name : ";
cin.getline(teamName,30);
cout << "Enter goals scored : ";
cin >> goalScore;
max = highestGoalScore(___(b)___,___(c)___);
cout << "Press Y if there are more player details to enter : ";
cin >> answer;
cin.ignore(1000,'\n');
}
___(d)___; //loop ends here
cout << "\nThe highest goal scored : " << ___(e)___ << endl;
}
a) f)
b) g)
c) h)
d) i)
e) j)