Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace AssignmentMethods
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Get information about: ");
- string typeOfInformation = Console.ReadLine();
- if (typeOfInformation == "student")
- {
- GetStudentInformation();
- }
- else if (typeOfInformation == "course")
- {
- GetCourseInformation();
- }
- else if (typeOfInformation == "degree")
- {
- GetInformationDegree();
- }
- else
- {
- Console.WriteLine("Incorrect input!");
- }
- }
- static void GetStudentInformation()
- {
- string first = Console.ReadLine();
- string second = Console.ReadLine();
- string birthday = Console.ReadLine();
- PrintStudentDetails(first, second, birthday);
- }
- static void PrintStudentDetails(string first, string second, string birthday)
- {
- Console.WriteLine("{0} {1} was born on: {2}", first, second, birthday);
- }
- static void GetCourseInformation()
- {
- string name = Console.ReadLine();
- string professor = Console.ReadLine();
- string credits = Console.ReadLine();
- PrintCourseDetails(name, professor, credits);
- }
- static void PrintCourseDetails(string name, string teacher, string credits)
- {
- Console.WriteLine("The course name is: {0}, it is tought by {1}, and it is evaluated with {2} credits", name, teacher, credits);
- }
- static void GetInformationDegree()
- {
- string name = Console.ReadLine();
- string department = Console.ReadLine();
- string university = Console.ReadLine();
- PrintDegree(name, department, university);
- }
- static void PrintDegree(string name, string faculty, string uni)
- {
- Console.WriteLine("The degree is {0}, is offered by {1} depertment in {2}", name, faculty, uni);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment