Six exam-style questions, mostly about methods and return values — Activities 2.1 to 2.3. These sets are cumulative, so Quarter 1 is still fair game. This is the first set of Quarter 2.
Two pairs this time. Questions 1 and 2 differ by one word; Questions 3 and 4 are the same procedure in the two notations, with two different answers. Read each pair side by side when you check your work.
Guessing beats leaving it blank. There is no penalty for a wrong answer on the AP exam, so a blank is a guaranteed zero where a guess is not.
Four have exactly one correct answer, one asks you to select all that apply, and the last is about data or the impact of computing rather than about code.
What does the following C# display?
Console.WriteLine(Shout("go"));
string Shout(string word){ return $"{word}!";}gogo!Shout does not print anythingThe same program, with Shout changed to print instead of return. What happens?
string x = Shout("go");Console.WriteLine(x);
void Shout(string word){ Console.WriteLine($"{word}!");}go! is displayed twicego! is displayed once, then a blank linego! is displayed onceWhat does the following C# display?
Console.WriteLine(Half(9));Console.WriteLine(Half(Half(40)));
int Half(int n){ return n / 2;}4.5, then 104, then 104, then 204.5, then 20The following is written in AP exam notation. What does it display?
PROCEDURE half(n){ RETURN(n / 2)}
DISPLAY(half(9))DISPLAY(half(half(40)))4.5 104 104.5 204 20Which of these are true of return in C#?
double that never reaches a return will not buildA school moves all its homework to an online system that needs a fast internet connection at home. Students in one rural area, where home internet is slow or unavailable, start falling behind. This is an example of:
This is graded on completion, not accuracy. A thoughtful wrong answer earns the same as a right one. What is being built here is speed and stamina, and both require being allowed to get things wrong cheaply.