Professional Documents
Culture Documents
Write A C
Write A C
Write A C
Write a C# program that takes three letters as input and display them in reverse
order.
2. Write a C# program that takes 2 inputs form user respectively name and
surname, and then print it as "NAME SURNAME" (both uppercase) in console
3. Write a C# program that takes the radius of a circle as input and calculate the
perimeter and area of the circle and print it in console
4. Make a lot of exercises with different types and try to understand important
aspects
1. Write a C# program that takes two numbers as input and returns true or false
when both numbers are even or odd
2. Write a C# program which takes 2 string input from user and return if second
string is in first string. Example. 1st input: Azərbaycan, 2nd input: can, Result
should be true because can is in Azərbaycan
3. Get 2 int number input from user and calculate the exact input1 / input2.
Example: 16, 5. Result should be 3.2 not 3.
4. Practise type conversions (different options), types and operators
1. Write a C# that calculates the day of week (ex: Monday) of your birthday
2. Write a C# that calculates you current life days (how many days past since your
birth)
3. Write a C# program to calculate what day of the week is after 40 days from this
moment
4. Write a program in C# to check whether the given year, month and day are the
current or not. Test Data :
Input the Day : 17
Input the Month : 09
Input the Year : 2016
Expected Output :
5. Write a program in C# to get the day of week from last day of the current year
against a given date. Test Data:
Input the Day : 12
Input the Month : 12
Input the Year : 2012
Expected Output :
The formatted Date is : 12/12/2012
The Last day of the year 2012 is : 31/12/2012
6. Write a program in C# Sharp to find the last day of a week against a given date.
Test Data:
Input the Day : 16
Input the Month : 06
Input the Year : 2016
Expected Output :
The formatted Date is : 16/06/2016 The last day of the week for the above date is:
18/06/2016
7. Write a C# Sharp program to find the largest of three numbers. Test Data :
Input the 1st number :25
Input the 2nd number :63
Input the 3rd number :10
Expected Output :
The 2nd Number is the greatest among three
8. Write a program in C# Sharp to read any day number in integer and display day
name in the word. Test Data : 4 Expected Output : Thursday
*
**
***
****
*****
6. Write a program in C# to make such a pattern like right angle triangle with
number increased by 1. The pattern like :
1
23
456
7 8 9 10
7. Write a program in C# to display the sum of the series [ 9 + 99 + 999 + 9999 ...].
Test Data :
Input the number or terms :5
Expected Output :
9 99 999 9999 99999
The sum of the series = 111105
8. Write a C# program to find prime numbers up to users entered value.
Exmpl: input-100, Result: 2, 3, 5, 7, 11, 13 ... 89, 97
9. Write a program in C# to check whether a number can be express as sum of two
prime numbers.
Test Data :
Input a positive integer: 16
Expected Output :
16 = 3 + 13
16 = 5 + 11
10. Write a program in C# to check whether a number is a palindrome (visual
simmetric) or not. Test Data :
Input a number: 121
Expected Output :
121 is a palindrome number.
Enter the value between 10 and 100. Initialize int array with random values with length
of user entered value. Do following tasks
Other tasks - Write seperate method for each task and call them
in Main method
4. Write a program in C# to create a function to swap the values of two integer
numbers without additional variable. Test Data : Enter a number: 5 Enter another
number: 6 Expected Output : Now the 1st number is : 6 , and the 2nd number is :
5
1. https://www.hackerrank.com/challenges/mini-max-sum/problem
2. https://www.hackerrank.com/challenges/plus-minus/problem
3. https://www.hackerrank.com/challenges/birthday-cake-candles/problem
4. https://www.hackerrank.com/challenges/time-conversion/problem
5. https://www.hackerrank.com/challenges/staircase/problem
6. https://www.hackerrank.com/challenges/day-of-the-programmer/problem
1. https://www.hackerrank.com/challenges/divisible-sum-pairs/problem
2. https://www.hackerrank.com/challenges/kangaroo/problem
3. https://www.hackerrank.com/challenges/sock-merchant/problem
1. https://www.exercisescsharp.com/oop/first-class-method-tostring
2. https://www.exercisescsharp.com/oop/constructors-destructors
3. https://www.exercisescsharp.com/oop/class-person-student-and-teacher
4. https://www.exercisescsharp.com/oop/photo-book-class
5. https://www.exercisescsharp.com/oop/inheritance-of-objects
2. Create a SchoolPerson class that has SchoolName, Name, Surname, Age and
DateOfBirth, CurrentClass properties. Also this class will have a general Greet
method, which will show us "Hello {Name Surname}".
The class "Student" will also have a public method "GoToClasses", which will write
on screen "I’m {name surname}, I am student and I'm going to class."
The class "Teacher" will have a public method "Explain", which will show on
screen "Explanation begin on subject {subject}". Also, it will have a private
attribute "subject", a string which indicates his/her speciality. Also "Teacher" will
have a public method "GoToClasses", which will write on screen "I’m {name
surname}, I am a teacher."
The class SchoolPerson must have a functionality to set of their age (eg, 20 years
old). Note: Age cannot be less than 6 and more than 50. If we try to assign invalid
number exception should be thrown.
The student will have a public method "ShowAge" which will write on the screen
"My age is: 20 years old" (or the corresponding number).
You must create another test class called "StudentAndTeacherTest" that will
contain "Main" and:
Create a SchoolPerson and make it say hello
Create a student, set his age to 21, tell him to Greet, display his age and make
him to go classes
Create a teacher, set age to 30 years old, ask him to say hello, then go to classes
and then explain.
1. Organize contents of any directory and it's files in the following style \
o All image files should be in Images folder (png, jpg and etc.)
o All video files should be in Videos folder (.mp4 and etc.)
o All pdf and office files should be in Documents folder
o All other files should in Other Files folder
o Remove any empty directory
2. Write a program in C# Sharp to create and read the last line of a file.
Test Data:
Input number of lines to write in the file :3
Input 3 strings below :
Input line 1 : line1
Input line 2 : line2
Input line 3 : line3
Expected Output:
The content of the last line of the file mytest.txt is: line3
3. Write a program to calculate all files and directories count in a given directory
(including files and folder in any subdirectory)
1. We need to show how many drives we have currently (C, D and etc), also for each
one show total size, available size and used size (in MB)
2. Show size of RAM and current usage (how many MB is in use now)
3. Show current CPU usage in percentage
4. Write a program to shut down the computer after predefined value. For example
get an input from user (example: 5 minutes) and after 5 minutes computer should
be shut down