Exercises


  1. Which of the following conversions can't be performed implicitly:

    • int to short

    • short to int

    • bool to string

    • byte to float

  2. Give the code for a color enumeration based on the short type containing the colors of the rainbow plus black and white. Can this enumeration be based on the byte type?

  3. Modify the Mandelbrot set generator example from the last chapter to use the following struct for complex numbers:

     struct imagNum { public double real, imag; } 
  4. Will the following code compile? If not, why not?

     string[] blab = new string[5] string[5] = 5th string. 
  5. Write a console application that accepts a string from the user and outputs a string with the characters in reverse order.

  6. Write a console application that accepts a string and replaces all occurrences of the string no with yes.

  7. Write a console application that places double quotation marks around each word in a string.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net