Chapter 9 Reading Review

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

enumerated data type

A(n) ________ is a data type that you can create by specifying a set of symbolic names that belong to that data type.

structure

A(n) ________ is an object you can create that contains one or more variables known as fields.

cat2 = cat1;

Assuming that cat1 and cat2 are both instances of the Pet structure, which of the following statements copies cat1 to cat2?

instance

Before you can use a structure to store data, you must create a(n) ________ of the structure in memory.

hound.type = "Beagle";

Given the code sample shown, which of the following statements assigns the string "Beagle" to the hound object's type field? struct Pet { public string name; public int age; public string type; } Pet hound = new Pet();

Pet hound = new Pet();

Given the code sample shown, which of the following statements declares a Pet structure named hound and initializes the object's fields with their default values? struct Pet { public string name; public int age; public string type; }

iceCreamFlavor = Flavor.Vanilla;

Given the following code sample, which of the following statements assigns the value Flavor.Vanilla to the iceCreamFlavor variable? enum Flavor {Vanilla, Strawberry, Chocolate} Flavor iceCreamFlavor;

July 19, 2019

Given the following code, the futureDate object will be set to ________. DateTime dt = new DateTime(2019, 7, 12); TimeSpan tspan = new TimeSpan(7, 0, 0, 0); DateTime futureDate = dt + tspan;

field

In order to compare two structure objects you must compare the individual ________ of each object.

by value

Structure objects are normally passed ________ to a method.

March 4, 2018

What is the date set by the following DateTime instance named dt? DateTime dt = new DateTime(2018, 3, 4);

KeyValuePair

When an element is stored in a Dictionary, it is stored as an object of the ________ type.

unique

When an element is stored in a Dictionary, the keys must be ________.

cats.name[2] = "Pickles";

iven the code sample shown, which of the following statements assigns the string "Pickles" to the name member of cats[2]? struct Pet { public string name; public int age; public string type; } const int SIZE = 4; Pet[] cats = new Pet[SIZE];


Set pelajaran terkait

Random variables And probability Distributions

View Set

Interpretation of Literature Midterm

View Set

Economics 201: Chapter 12 Assignment

View Set