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 Schulnoten
- {
- class Program
- {
- static void Main(string[] args)
- {
- double note = 0;
- while(true) {
- Console.WriteLine("Geben Sie die Note ein");
- note = Convert.ToDouble(Console.ReadLine());
- if (!IsWithin(note, 1, 6))
- {
- Console.WriteLine("Bitte eine Note zwischen 1 und 6 eingeben!");
- }
- if (IsWithin(note, 1, 1.2))
- {
- Console.WriteLine("Note: 1");
- }
- if (IsWithin(note, 1.3, 1.6))
- {
- Console.WriteLine("Note: 1-");
- }
- if (IsWithin(note, 1.7, 1.9))
- {
- Console.WriteLine("Note: 2+");
- }
- if (IsWithin(note, 2, 2.2))
- {
- Console.WriteLine("Note: 2");
- }
- if (IsWithin(note, 2.3, 2.6))
- {
- Console.WriteLine("Note: 2-");
- }
- if (IsWithin(note, 2.7, 2.9))
- {
- Console.WriteLine("Note: 3+");
- }
- if (IsWithin(note, 3, 3.2))
- {
- Console.WriteLine("Note: 3");
- }
- if (IsWithin(note, 3.3, 3.6))
- {
- Console.WriteLine("Note: 3-");
- }
- if (IsWithin(note, 3.7, 3.9))
- {
- Console.WriteLine("Note: 4+");
- }
- if (IsWithin(note, 4, 4.2))
- {
- Console.WriteLine("Note: 4");
- }
- if (IsWithin(note, 4.3, 4.6))
- {
- Console.WriteLine("Note: 4-");
- }
- if (IsWithin(note, 4.7, 4.9))
- {
- Console.WriteLine("Note: 5+");
- }
- if (IsWithin(note, 5, 5.2))
- {
- Console.WriteLine("Note: 5");
- }
- if (IsWithin(note, 5.3, 5.6))
- {
- Console.WriteLine("Note: 5-");
- }
- if (IsWithin(note, 5.7, 5.9))
- {
- Console.WriteLine("Note: 6+");
- }
- if (IsWithin(note, 6, 7))
- {
- Console.WriteLine("Note: 6");
- }
- Console.ReadLine();
- Console.Clear();
- }
- }
- public static bool IsWithin(double value, double minimum, double maximum)
- {
- return value >= minimum && value <= maximum;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement