Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Which one of the following options represents the output of the program below? struct play { int score, bonus; } ; void calculate ( play

Which one of the following options represents the output of the program below?
struct play { int score, bonus; };
void calculate(play &p, int n =10){ p.score++; p .bonus += n; }
int main(){ play pl ={10,15}; calculate(pl,5); cout << pl.score <<":"<< pl.bonus << endl; calculate(pl); cout << pl.score <<":"<< pl.bonus << endl; calculate(pl,15); cout << pl.score <<":"<< pl.bonus << endl;
return 0; }
a.
11:20
12:30
13:45
b.
16:10
17:40
18:55
c.
10:20
11:30
12:45
d.
11:10
12:20
13:35
Question 40
Not yet answered
Marked out of 1.00
Flag question
Question text
Which one of t

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions