final - IT528 Developing .NET Applications Using C# 1. What...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: IT528 Developing .NET Applications Using C# 1. What is CLR (Common Language Runtime)? Why do we need it for C# programs? What exactly does it do for us? 2. What is GAC (Global Assembly Cache)? Why do we need it for? 3. Do all classes/objects in C# have the ToString() method? Why or why not? 4. Please given an example for an explicit casting between types. Why do we need explicit casting? How can we prevent data loss in explicit casting? 5. What are pass-by-reference parameters? Does the value of a value type (example: int) change if passed-by-reference? Does the value of a reference type (example: string) change if passed-by- reference? 6. What are pass-by-value parameters? Does the value of a reference type (example: string) change if passed-by-value? Does the value of a value type (example: int) change if passed-by-value? 7. How can I rewrite the same if-else statement below: if ( ! (a < 0 && b <= 0 && a < b) Console.WriteLine(Valid input); else Console.WriteLine(Invalid input); reversed as follows: if ( ) Console.WriteLine(Invalid input); else Console.WriteLine(Valid input); 8. Rewrite your homework 1 using command line arguments instead of prompting the user for the operator and the operands. For example: if your program is called calculator.exe, then one can use your program as follows: calculator + 3 4 7 calculator min 2 3 -1 6.5 0 57 The first argument to your program is the operator and the following args are the operands. The first one calculates the sum of 3 numbers and the second one calculates the minimum of 6 numbers. User can give any number of operands, there is no limit. You may assume the valid operators are +, - , *, /, min and max. They all take any number of operands. In addition, you must define and use the following delegate to pass each operators calculate method to calculate the result to another method that is calculating the result of the operation. public delegate void Calculate ( double operands, out double result); Also please use at least one shortcut we learned for defining delegates on slide 36 of http://myweb.sabanciuniv.edu/gulsend/files/2009/04/arrays_enum_events.pdf . 9. calculate May 9, 2009 Spring 2008-2009 FINAL PART 1 Duration: 30 minutes Name : 1. Explain at least 3 benefits of exceptions that you can think of. (9 points) IT528 Developing .NET Applications Using C# 1. What is CLR (Common Language Runtime)? Why do we need it for C# programs? What exactly does it do for us? 2. What is GAC (Global Assembly Cache)? Why do we need it for? 3. Do all classes/objects in C# have the ToString() method? Why or why not? 4. Please given an example for an explicit casting between types. Why do we need explicit casting?...
View Full Document

Page1 / 33

final - IT528 Developing .NET Applications Using C# 1. What...

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

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