'F' → Fullscreen
Today you board the crew for launch in a new program named 2-2-crew-boarding. Every crew member is welcomed, listed, and seated by the same three methods, and the countdown can start from any number.
How to read the code blocks. Each task's code block shows your whole program, from line 1, as it should look when that task is finished.
The green lines marked with a + are the ones you add or change for that task — everything else is already in your file. Do not type the + sign.
name on line 4 is the parameter; "Avery" and "Blake" are the arguments.Greet("Avery");Greet("Blake");
void Greet(string name){ Console.WriteLine($"Welcome aboard, {name}.");}CrewLine below Greet, and the two calls on lines 3 and 4. Run it.CrewLine("Pilot", "Avery"); and run it. Write down exactly what printed, and whether there was an error. Then swap them back.Greet("Avery");Greet("Blake");CrewLine("Avery", "Pilot");CrewLine("Blake", "Engineer");
void Greet(string name){ Console.WriteLine($"Welcome aboard, {name}.");}
void CrewLine(string name, string role){ Console.WriteLine($"{name} - {role}");}AssignSeat and its two calls. Its second parameter is an int, so its argument is a number with no quotes.AssignSeat(1, "Avery"); and run it. Write down the error code, how many errors there were, and what each one said it could not convert. Then swap them back.Greet("Avery");Greet("Blake");CrewLine("Avery", "Pilot");CrewLine("Blake", "Engineer");AssignSeat("Avery", 1);AssignSeat("Blake", 2);
void Greet(string name){ Console.WriteLine($"Welcome aboard, {name}.");}
void CrewLine(string name, string role){ Console.WriteLine($"{name} - {role}");}
void AssignSeat(string name, int seat){ Console.WriteLine($"{name} takes seat {seat}.");}Countdown. It is Activity 2.1's countdown with one parameter, int from, and the loop starts at from instead of at 3.Greet("Avery");Greet("Blake");CrewLine("Avery", "Pilot");CrewLine("Blake", "Engineer");AssignSeat("Avery", 1);AssignSeat("Blake", 2);Countdown(3);Console.WriteLine("Launch scrubbed. Resetting the clock.");Countdown(5);
void Greet(string name){ Console.WriteLine($"Welcome aboard, {name}.");}
void CrewLine(string name, string role){ Console.WriteLine($"{name} - {role}");}
void AssignSeat(string name, int seat){ Console.WriteLine($"{name} takes seat {seat}.");}
// Write a method named Countdown here. It takes one int parameter named from.// It counts down from "from" to 1, one "T-minus" line each,// then prints LIFTOFF! -- Activity 2.1's countdown, but starting at "from".Three changes, one at a time. Write down exactly what happens, and put each one back before the next.
Greet(); — no argument.Greet(Avery); — the quotes gone.Countdown(0);.Two of these stop the build. One builds and runs. For the two errors, write the code and say in your own words what C# was objecting to. For the one that runs, write what it printed in place of the first countdown, and say why C# had no reason to object.
There is no code block for this task. When it is over, your program is exactly what it was at the end of Task 4.
Hold with one int parameter, seconds. It prints Holding for 30 seconds. — but for 1 it must say Holding for 1 second., with no s.if inside the method that looks at the parameter. Call it with 1 and with 30, and check both.The reference sheet writes a procedure with parameters as PROCEDURE procName(parameter1, parameter2, ...) and a call as procName(arg1, arg2, ...).
Greet("Avery");
void Greet(string name){ Console.WriteLine($"Welcome, {name}");}PROCEDURE greet(name){ DISPLAY("Welcome,") DISPLAY(name)}
greet("Avery")PROCEDURE greet(name) — just the name. C# makes you write string name, and that type is exactly what let C# catch Task 3's swap. On the exam nothing catches either swap, so read the order of the arguments carefully.
The reference sheet says it directly: arg1 is assigned to parameter1, arg2 to parameter2, and so on. Task 2's swap means the same thing on the exam as it did in your program.
There is no $"..." on the reference sheet. To show a word and a value on one line, the exam uses two DISPLAY calls, and DISPLAY adds a space after each value, so the panel prints Welcome, Avery with the space supplied by the first call.
The finished program's output.
Welcome aboard, Avery.Welcome aboard, Blake.Avery - PilotBlake - EngineerAvery takes seat 1.Blake takes seat 2.T-minus 3T-minus 2T-minus 1LIFTOFF!Launch scrubbed. Resetting the clock.T-minus 5T-minus 4T-minus 3T-minus 2T-minus 1LIFTOFF!Countdown has one body, and prints four lines for 3 and six for 5Answer the following questions before submitting your work.
Greet("Avery") and its definition, which is the parameter and which is the argument? Say where each one appears in your program.Greet qualify? Does Countdown? Argue each in a sentence.Submit four things to the dropbox: