Test 2 - A form you create at the design time is a class...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
A form you create at the design time is a class but an actual running form is an object. T What are the basic members in a class? Constructer, objects, datamembers, methods, properties What is encapsulation? Each class should keep it’s data members private and if there is a need to expose the data you’ll do that using a constructer By doing that if you need to change something it’ll be localized in just that class and won’t have a ripple effect 1) What is a data member? Global Variable 1) True or False: An object has both data and behaviors. A class is a template that defines the data and behaviors. T; T 2) True or False: A class cannot have more than one constructor False 3) True or False: A class can be used to create one object 1.iii. False you can create no object or many objects 1.iv. Ex. Math, you never create object just functions, POW etc 4) True or False: A property is a data member. F It’s a data excessor What is overloading?Prop that two or more methods/ con will have the same name if they have different sig, the sig is just the type of the parameter. What are the three types of behaviors an object can have? Comstruct: Prop: method 7)A method is declared as private in a class. Then who can invoke the method? Only the code in the class 8)Who can invoke a public method? Anyone in the Same Project. -An output data type, not its name, is coded into a method-True. -To handle run time errors in a function, you put “throw new exception(“error”)” -Bool- is used to tell true or false statements. -when calling out parameters, the corresponding argument must be declared or initialized-False. - A ref parameter can be used to return an output value back from a method and also pass an input value into the method-True. The content of the argument variable cannot be directly altered by the method. - A form you create at the design time is a class but an actual running form is an object- True. - A class is a template that defines the data and behaviors of the objects to be created-True. -A class can have more than one constructor. - A class can be used to create many objects of the same type or kind as you desire-True. - A property in c# is considered a data member -to pass data, you can create a public method in frm1st and call it from frm2nd. - 2 functions in the same form or class can have the same name if they have different signs. - use streamreader and fileobjects to open text file -stream reader use readline method() *grade to letter private void cmdConvert_Click( object sender, EventArgs e)~{ int result”` string letter = txtLetter.Text;` switch (letter)`{ case "A" : case "B" :` case "C" :`result = 2:` break ; case "D" : case "E" :` case "F" :`result = 3;` break ;` case "G" : case "H" :` case "I" :`result = 4;` break
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/20/2012 for the course GENERAL 100 taught by Professor Tba during the Fall '10 term at The University of Akron.

Page1 / 2

Test 2 - A form you create at the design time is a class...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online