You are on page 1of 1

CSD 2354 C# Programming

Assignment 1 (5%)

1. Declare five variables choosing for each of them the most appropriate of the types byte, sbyte,
short, ushort, int, uint, long, ulong to represent the
following values: 52130, -115, 4825932, 97, -10000.
2. Which of the following values can be assigned to a variable of type float and which to a variable
of type double: 34.567839023, 12.345, 8923.1234857, 3456.091?
3. Write a program that safely compares floating-point numbers with precision of 0.000001.
4. Declare an integer variable and assign it with the value 254.
5. Declare a character variable and assign it with the symbol that has Unicode code for the first
letter of your first name. Hint: first use the Windows Calculator to find the hexadecimal
representation of 72.
6. Declare a boolean variable called isGender and assign an appropriate value corresponding to
your gender.
7. Declare two string variables and assign them with “Hello” and “World”. Declare an object
variable and assign it with the concatenation of the first two variables (mind adding an interval).
Declare a third string variable and initialize it with the value of the object variable (you should
perform type casting).
8. Declare two string variables and assign your name to them.

Excellent Good Fair Poor


 
2.5% 1.5-2.25% 1-1.25% 0-.75%

All Coding Excellent Good Fair Poor


100%
All steps are There are 1-3 coding There are 4-5 coding There are more than 6
completed errors and/or 1-3 steps errors and/or more coding errors and/or 6
100%, and there are not correct and/or than 4-5 steps are not and/or more steps are not
are no errors done and/or some correct and/or done correct and/or done
and all standard standard coding practices and/or some standard and/or some standard
coding practices are not implemented into coding practices are not coding practices are not
are the exercises. implemented into the implemented into the
implemented exercises. exercises.
into the
exercises.

You might also like