What is the purpose of the ReadLine() method? How would you use it with a variable of type string? How would you use it with a variable of type double?

What will be an ideal response?

You use the ReadLine() method to accept user input from the keyboard. This method accepts all of the characters entered by a user until the user presses Enter. The characters can be assigned directly to a string. For example, the following statement accepts a user's input and stores it in the variable myString:
myString = ReadLine();
If you want to use the data as a string-for example, if the input is a word or a name-then you simply use the variable to which you assigned the value. If you want to use the data as a number, then you must use a conversion method to convert the input string to the proper type, as in:
itemPrice = Convert.ToDouble(myString);

Computer Science & Information Technology

You might also like to view...

A(n) ____________________ procedure is a procedure that performs a task but does not return any data.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The size of a GUI object on a Windows Form object can be changed by dragging its borders or by using the ____ property of the object.

A. Dimensions B. Shape C. Resolution D. Size

Computer Science & Information Technology