Hi! I have a few short questions on C++ Thank you! 1. Given the following functi
ID: 666277 • Letter: H
Question
Hi! I have a few short questions on C++ Thank you!
1. Given the following function prototype: void mystry(const int list[], int size); and the declaration : int alpha[50];
Which of the following is a valid call to the function mystry?
a. mystry(int alpha[50]); b. mystry(alpha[],50); c. mystry(alpha,50); d. mystry(const alpha,50);
2. Given the following declarations and initializations:
a. y[SIZE] = 42.0; b. x[0] = 14.0; c. x = y; d. cin >> y >> z; e. x[8-i] = y[i] + z;
3. Suppose that ch1, ch2, and ch3 are variables of the type char and the input is:
a. A; b. B; c. C; d.
4. Suppose you have the following code:
a. Nothing because the input buffer needs to be flushed when the enter key is hit
b. Donald ucky
c. Donald Ducky
d. Donald
5.
a. Find syntax errors.
b. Translate the source code into machine language.
c. Correct logic errors.
d. Make the output look pretty.
THANK YOU!
Explanation / Answer
1.) c //only name aof the array is passed
2) b , e //x[0]=14.0 assign 14.0 at 0th position, and e is valid expression
3) c //since ch3 is last it will read last input which is c
4) b //Donald will be assigned to first and D of Ducky will read into c and ucky will be read into last
5) a,b //compiler check syntax errors and translate souce into m/c langauge
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.