Assignment 1 (5%) : All Coding 100% Excellent Good Fair Poor
Assignment 1 (5%) : All Coding 100% Excellent Good Fair Poor
Assignment 1 (5%) : All Coding 100% Excellent Good Fair Poor
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.