You want to write a message (output) to the console, but want the cursor to move to a new line. You should use what statement?
Console.WriteLine();
For both a CWL and a CW, what character must be at the end of the statement to indicate termination?
semi-colon
string favFood = "seafood";
What is wrong?
the variable should be declared and initialized before trying to use the value in output. swap the order.
What is the expected output of...
Console.WriteLine(4 * 2);
8
Console.WriteLine("Hello, World");
Hello, World
You want to write a message to the console, but want the cursor to remain on the same line. You can use what statement?
Console.Write();
CWL("Hi, " ___ name ____ "!");
What is missing for concatenation?
plus sign (+)
string firstName;
CWL("Enter your first name.");
Console.ReadLine();
Need to be able to capture and store the user input and assign it to a variable. Should be firstName = CRL
double pennyWeight = 3.11;
The user has a total of 100 pennies. Write a formula to calculate the total weight of pennies within a Console.WriteLine(); without creating a new variable.
CWL("Total weight: " + pennyWeight * 100);
string pixarMovie = "Up";
CWL(pixarMovie);
Up
I have a simple program that prompts the user for their name and then greets them. I want to hide the ending (behind-the-scenes) information from the user and leave the console open until the user hits any key. What can I use?
Console.ReadKey();
I am storing a user-entered number as an integer. What is the correct syntax for reading the input and converting it to an integer value?
Convert._____32(Console.ReadLine());
Fill in the blank
ToInt
Console.Write("2 + 2 = ");
Console.WriteLine(2 * 2);
What is wrong?
Should be the addition operator and not multiplication in the CWL.
Console.WriteLine(0 / 100);
What is the output?
0
string favoriteActionMovie = "John Wick";
CWL(favoriteActionMovie);
favoriteActionMovie = "Violent Night";
CWL(favoriteActionMovie);
John Wick
Violent Night
I am prompting the user to enter their age as text. What method should I use to store their answer (input)?
Console.ReadLine();
double bodyTemp;
CWL("Enter body temperature.");
bodyTemp = Convert.ToDouble(_______);
What should be in the parentheses?
Console.ReadLine()
string firstName = "Mary";
string lastName = Poppins;
CWL("Hi, " + firstName + " " + lastName + ".");
What is wrong?
Poppins should be in double quotes since it is text (string)
Console.WriteLine(100 / 0);
What is wrong with the following mathematical operation?
You can not divide by zero.
Console.Write("My name is");
Console.WriteLine("Matt");
My name isMatt
string firstName = "John";
string lastName = "Smith";
Fill in the blank.
string fullName = _________________
firstName + " " + lastName
string fruit1 = "apple";
This is an example of declaring and initializing. Fill in the blank of what is needed to only declare the next variable.
string fruit2_
; semi-colon
I want to update the value of the stored int variable from one value to another. The first CWL should display the first value and the second CWL the new value.
int num = 5;
CWL(num);
CWL(num);
num = 2;
num = 2 should be moved before the second Console.WriteLine();
This program has 5 different test scores. Correct the code to figure out and display the average test score.
int test1 = 100;
int test2 = 75;
int test3 = 90;
int test4 = 95;
int test5 = 80;
int avgTestScore = (test1 * test2 * test3 * test4 * test5) / 10;
What is wrong? Two things.
Should add each test together instead of multiply. Should divide by 5 (the number of tests) instead of 10
//scores
Console.WriteLine("Scores:\t100\t75\t50");
Scores: 100 75 50