Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace p
- {
- class Program
- {
- public static void Main(string[] args)
- {
- int code;
- float pourcentage;
- Console.WriteLine("Quel est votre ancienneté (en années) ?");
- int annee = int.Parse(Console.ReadLine());
- Console.WriteLine("Quel est votre salaire (en euro) ?");
- int salaire = int.Parse(Console.ReadLine());
- if (annee < 2 && salaire < 60000)
- {
- code = 1;
- pourcentage = 0f;
- }
- else
- {
- if ((annee < 5 && salaire < 100000) || (annee >= 5 && salaire < 60000))
- {
- code = 2;
- pourcentage = 1f;
- }
- else
- {
- if ((annee >= 5 && (salaire >= 60000 && salaire < 100000)) || (annee < 2 && salaire >= 100000))
- {
- code = 3;
- pourcentage = 1.5f;
- }
- else
- {
- if ((annee >= 2 && annee < 5) && salaire >= 100000)
- {
- code = 4;
- pourcentage = 2f;
- }
- else
- {
- code = 5;
- pourcentage = 2.5f;
- }
- }
- }
- }
- Console.WriteLine("Votre code est {0}, vous aurez donc une remise de {1} %",code,pourcentage);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement