Sams Teach Yourself C in 21 Days

(singke) #1
The C# Programming Language 779

BD7


Q Where can I get a C# compiler?
AA C# compiler is a part of the Microsoft .NET Framework. You can download the
framework from Microsoft’s Web site (www.Microsoft.com).

Workshop

The Workshop provides quiz questions to help you solidify your understanding of the
material covered and exercises to provide you with experience in using what you’ve
learned. Answers to the quiz are provided in Appendix F.

Quiz


  1. Give three reasons why C# is a great choice of programming language.

  2. What do IL and CLR stand for?

  3. What are the steps in the Program Development Cycle?

  4. What command do you need to enter to compile a program called my_prog.cs with
    your compiler?

  5. What extension should you use for your C# source files?

  6. Is filename.txt a valid name for a C# source file?

  7. If you execute a program that you have compiled and it doesn’t work as you
    expected, what should you do?

  8. What is machine language?

  9. What two statements can be used to write information in C# programs?


Exercises


  1. Use your text editor to look at the EXE file created by Listing B7.1. Does the EXE
    file look like the source file? (Don’t save this file when you exit the editor.)

  2. Enter and compile the following program. What does this program do?
    1: class AClass
    2: {
    3: static void Main()
    4: {
    5: int x,y;
    6: for ( x = 0; x < 10; x++, System.Console.Write( “\n” ) )
    7: for ( y = 0; y < 10; y++ )
    8: System.Console.Write( “X” );
    9: }
    10: }


42 448201x-Bonus7 8/13/02 11:24 AM Page 779

Free download pdf