Basic Input and Output
data types
Converting Data Types
variables
potpourri
100

You want to print output (text) to the console and have the cursor move to the next line. You should use this.

Console.WriteLine("");

100

Which data type is used to store multiple characters (text) such as a name or email

string

100

I am converting a string into an int. How can I do this?

Convert.ToInt32(Console.ReadLine());

100

to create and utilize a variable in c#, you must do the following: ______ and ___________.

declare and initialize

100

Single line comments are created with which special characters?

two forward slashes

//

200

You want to read the user's input. You should use this...

Console.ReadLine();

200

I want to store a user's entered age, but I don't plan on doing math with this data. Which data type should I use?

string

200

I am going to Convert an entered string (text) into a double. How can I do this?

Convert.ToDouble(Console.ReadLine());

200

string firstName;


This is an example of _______ a variable of string data type named firstName

declaring

200

The following special characters are used for what?

/*

*/

multi-line comments

300

You want to write output (text) to the console, but you want the cursor to remain on the same line. You would use this...

Console.Write();

300

I want to store a user's entered age, but I plan on doing math with this number. What data type would be best?

int

300

Fix the syntax.

Convert.ToDouble(Console.WriteLine());

should be Console.ReadLine() in the parentheses

300

string firstName = "John";


this is an example of declaring and _______ a variable.

initializing

300
I am going to ask the user to enter a whole number and store it as an integer. How can I better ensure that they enter a whole number?

prompt them in the output

(provide an example such as For example, 7)

400

You want to hide the ending information when you run your code. You can use this...

Hitting any key will reveal it though.

Console.ReadKey();

400

I am going to store a user entered temperature in Fahrenheit. Which data type would be best?

double

400

Fix the syntax. (2 things are wrong)


Convert.ToInt31(Console.ReadLine()):

should be 32 instead of 31 and should end in semi-colon instead of a colon

400

string fruit = "banana";

fruit = "apple";

Console.WriteLine(fruit);

What is the output?

apple

400

I would like to create a new line without using a CWL. What escape sequence can I use?

\n for newline

500

I want to store a user's entered name in a variable: string name; How should I capture their input and store it in this variable?

name = Console.ReadLine();

500

I am storing a number that will have a decimal place. What data type could I use?

double

500

string food = "pizza";

Convert.ToInt32(food);


What is wrong?

can't turn the text into a number.

500

a local variable should follow this naming convention...

such as myVariable

camel-case

500

What symbol denotes termination of a statement. 

semi-colon

M
e
n
u