Consider the program fragment given here and use it to answer the questions belo
ID: 3570106 • Letter: C
Question
Consider the program fragment given here and use it to answer the questions below. (12 Points)Question 1: What is the value of each variable after line of code with the
Question 1 comment has executed?
first: __________ middle: __________ last: __________
Question 2: What is the value of each variable after line of code with the Question 2 comment has executed?
a: __________ b: __________ c: __________
void swap(char first, char & middle, char & last)
{
first = last;
middle = middle + 4;
last = tolower(middle);
// Answer Question 1
}
int main()
{
char a = 'B';
char b = 'C';
char c = 'F;
swap(a, b, c);
// Answer Question 2
return 0;
}
Explanation / Answer
1) first = 'F'
middle = 'G'
last = 'c'
2)
a = 'B'
b = 'C'
c = 'F'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.