Skip to content

AlinaSkultecka/ClassMethods_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# Exercise Classes and Methods

This is a C# console application demonstrating a variety of programming exercises.


Tasks

Console Interaction

  1. Ask the user for their name and favorite color, then change the console's text color to their favorite color and greet them with their name.
  2. Prompt the user for two numbers, add them together, and display the result.
  3. Create a simple loop that continually asks the user for input until they enter "exit" or "quit".

Math Operations

  1. Ask the user for a number and display its square root.
  2. Get two numbers from the user and display the smallest number and the difference between them.
  3. Calculate the area of a circle, given user input for the radius.

Random Operations

  1. Generate a random number between 1 and 6, simulating the roll of a dice, and display the result.
  2. Create a simple lottery simulation where the user has to guess a number between 1 and 10, and tell them if they guessed correctly.
  3. Generate three random colors (using RGB values) and display their values.

Date and Time

  1. Ask the user for their birthdate and calculate their age.
  2. Display the current day of the week and ask the user to enter an event. Store and remind them of the event the next time the program runs.
  3. Calculate the difference in days between today and the next holiday provided by the user.

String Operations

  1. Ask the user for a sentence and then display it in reverse order.
  2. Check if the user's input string is a palindrome (reads the same backward as forward).
  3. Ask the user for a paragraph and count how many times a specific word appears in it.

Array

  1. Create an application that accepts 5 numbers from the user, stores them in an array, then prints out each number in reverse order.
  2. Ask the user for a string. Convert this string into a character array and count how many vowels (a, e, i, o, u) are in the string.
  3. Create a program where the user can continually add names into an array until they decide to stop. After they stop, display all names entered and count how many names are in the array.

About

Homework, aplication of different methods

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages