Question
When you need to convert a char variable to a string, you can call its ____________ method. ToString CompareTo GetType Equal When you need to
- When you need to convert a char variable to a string, you can call its ____________ method.
| ToString | |
| CompareTo | |
| GetType | |
| Equal |
- When you need to convert a char variable to a string, you can call its ____________ method.
| ToString | |
| CompareTo | |
| GetType | |
| Equal |
- The process of breaking a string into tokens is known as ____________.
| a. | lexical analysis |
| b. | tokenizing |
| c. | threading |
| d. | parsing |
- Look at the following code sample:
struct Pet
{
public string name;
public int age;
public string type;
}
Which one of the following statements declares an instance of a Pet structure named hound and initializes the object's fields with their default values?
| a. | hound = new Pet(); |
| b. | Pet hound; |
| c. | Pet hound = new Pet(); |
| d. | new Pet = hound; |
- Look at the following code sample:
struct Pet
{
public string name;
public int age;
public string type;
}
const int SIZE = 4;
Pet[] cats = new Pet[SIZE];
Which one of the following statements assigns the string "Pickles" to the name member of cats[2]?
| a. | cats[2].name("Pickles"); |
| b. | "Pickles" = cats[2]; |
| c. | cats[2].name = "Pickles"; |
| d. | cats.name[2] = "Pickles"; |
- If the argument is already uppercase, the char.ToLower method returns it unchanged.
True
False
- In C#, you can only provide one delimiter per string that you wish to tokenize.
True
False
- When you are tokenizing a string that was entered by the user and you are using characters other than white spaces as delimiters, you do not need to trim the string before tokenizing it.
True
False
- A structure declaration does not create anything in memory.
True
False
The term ____________ is used to describe a file to which data is written.
| data file | |
| record | |
| input file | |
| output file |
- When you work with a ____________, you access data from the beginning of the file to the end of the file.
| a. | input file |
| b. | sequential access file |
| c. | direct access file |
| d. | text file |
- When you want to write data to a text file, you create a file object using the ____________.
| a. | StreamWriter class |
| b. | TextReader class |
| c. | TextWriter class |
| d. | StreamReader class |
- To append data to an existing file, you open it with the ____________ method.
| a. | File.AppendText |
| b. |
|
| c. |
|
| d. | File.AppendAll |
- You can use the StreamWriter class's WriteLine or Write methods to write numbers to a text file, but the numbers are converted to strings.
True
False
- An exception will be thrown if a program attempts to read beyond the end of a file.
True
False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started