Advertisement
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 teht57
- {
- class Program
- {
- static void Ylioppilasarvosana(int pisteet)
- {
- if (pisteet > 60)
- {
- throw new ArgumentException("Et voi saada yli 60 pistettä!");
- }
- else if (pisteet < 0)
- {
- throw new ArgumentException("Alle 0 pistettä on mahdottomuus!");
- }
- else if (pisteet < 10)
- {
- Console.WriteLine("Arvosanasi on: hylätty");
- }
- else if(pisteet >= 10 && pisteet < 16)
- {
- Console.WriteLine("Arvosanasi on: A");
- }
- else if (pisteet >= 16 && pisteet < 23)
- {
- Console.WriteLine("Arvosanasi on: B");
- }
- else if (pisteet >= 23 && pisteet < 32)
- {
- Console.WriteLine("Arvosanasi on: C");
- }
- else if (pisteet >= 32 && pisteet < 45)
- {
- Console.WriteLine("Arvosanasi on: M");
- }
- else if (pisteet >= 45 && pisteet < 58)
- {
- Console.WriteLine("Arvosanasi on: E");
- }
- else if (pisteet >= 58)
- {
- Console.WriteLine("Arvosanasi on: L");
- }
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Mikä oli matematiikan kirjoitusten pistemääräsi?");
- string syote = Console.ReadLine();
- int syoteInt = Int32.Parse(syote);
- Ylioppilasarvosana(syoteInt);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement