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 Umsatz
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Vordefinierte Arrays
- int[] produktid = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
- double[] plan = {800000,1258900,720000,550000,1200500,500000,300000,150000,700000,1200000,300000};
- double[] ist = {900000, 2500000, 750000, 600000, 80000, 480000, 320000, 3000000, 450000, 900000, 330000 };
- // Variablen
- int i;
- double[] umsatz = new double[11];
- // Main
- Console.WriteLine("Willkommen liebe Manager!!");
- Console.WriteLine("Wir berechnen hier unterschiedliche Werte für unsere Produkte.\n");
- for (i = 0; i <= 10; i++)
- {
- umsatz[i] = ist[i] - plan[i];
- Console.WriteLine("Für Produkt {0} haben wir einen Plan-Umsatz von {1}$ und einen Ist-Umsatz von {2}$!\n", produktid[i], plan[i], ist[i]);
- if (plan[i] <= ist[i])
- {
- Console.ForegroundColor = ConsoleColor.DarkGreen;
- Console.WriteLine("Der Umsatz wurde erreicht.");
- Console.WriteLine("Der Umsatz wurde um {0}$ überboten", umsatz[i]);
- Console.WriteLine("Das sind {0:F2}% mehr.", (ist[i] - plan[i]) * (100 / plan[i]));
- Console.ForegroundColor = ConsoleColor.White;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Der Umsatz wurde nicht erreicht.");
- Console.WriteLine("Der Umsatz wurde um {0}$ unterschritten", -umsatz[i]);
- Console.WriteLine("Das sind {0:F2}% weniger.", -(ist[i] - plan[i]) * (100 / plan[i]));
- Console.ForegroundColor = ConsoleColor.White;
- }
- if (umsatz[i] > 500000)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine("Das Produkt ist ein A-Produkt!\n\n");
- Console.ForegroundColor = ConsoleColor.White;
- }
- else if (umsatz[i] > 0)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine("Das Produkt ist ein B-Produkt!\n\n");
- Console.ForegroundColor = ConsoleColor.White;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine("Das Produkt ist ein C-Produkt!\n\n");
- Console.ForegroundColor = ConsoleColor.White;
- }
- }
- Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement