You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Übungen_Rabatrechner1
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
//Deklaration
|
|
|
|
double betrag, rab_betrag, netto;
|
|
double rabatt = 0;
|
|
|
|
//Header
|
|
Console.WriteLine("--Rabatrechner1--") ;
|
|
|
|
//Eingabe
|
|
Console.Write("Geben Sie Ihren Rechungsbetrag an (in Euro)");
|
|
betrag = Convert.ToDouble(Console.ReadLine());
|
|
|
|
//Berechnungen
|
|
if (betrag > 500.0)
|
|
rabatt = 7.5;
|
|
else
|
|
if (betrag > 100.0)
|
|
rabatt = 5.0;
|
|
else
|
|
rabatt = 0.0;
|
|
|
|
rab_betrag = betrag * rabatt / 100;
|
|
netto = betrag - rab_betrag;
|
|
//Ausgabe
|
|
|
|
Console.WriteLine("Rabatt(in %): "+rabatt);
|
|
Console.WriteLine("Rabatt(in Euro): " + rab_betrag);
|
|
Console.WriteLine("Betrag (abzüglich Rabatt): " + netto);
|
|
Console.ReadLine();
|
|
|
|
}
|
|
|
|
}
|
|
}
|