Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

When you need to convert a char variable to a string, you can call its ____________ method. ToString CompareTo GetType Equal When you need to

  1. When you need to convert a char variable to a string, you can call its ____________ method.

ToString

CompareTo

GetType

Equal

  1. When you need to convert a char variable to a string, you can call its ____________ method.

ToString

CompareTo

GetType

Equal

  1. The process of breaking a string into tokens is known as ____________.

a.

lexical analysis

b.

tokenizing

c.

threading

d.

parsing

  1. 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;

  1. 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";

  1. If the argument is already uppercase, the char.ToLower method returns it unchanged.

True

False

  1. In C#, you can only provide one delimiter per string that you wish to tokenize.

True

False

  1. 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

  1. 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

  1. 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

  1. 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

  1. To append data to an existing file, you open it with the ____________ method.

a.

File.AppendText

b.

  1. File.Append

c.

  1. File.OpenExistingText

d.

File.AppendAll

  1. 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

  1. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Real Time Database Systems Architecture And Techniques

Authors: Kam-Yiu Lam ,Tei-Wei Kuo

1st Edition

1475784023, 978-1475784022

More Books

Students also viewed these Databases questions

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago