Advertisement
LePetitGlacon

FICHE 4 Exercice 1++

Oct 3rd, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. namespace p
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Quel est votre age ?");
  10.             int age = int.Parse(Console.ReadLine());
  11.             Console.WriteLine("Etes vous un homme [H]  ou une femme [F] ?");
  12.             string genre = Console.ReadLine();
  13.            
  14.             if (genre == "H" && age >= 20)
  15.             {
  16.                 Console.WriteLine("Vous payerez l'impôt");
  17.             }
  18.             else
  19.             {
  20.                 if (genre == "F" && (age >= 18 && age <= 35))
  21.                     {
  22.                         Console.WriteLine("Vous payerez l'impôt");
  23.                     }
  24.                     else
  25.                         {
  26.                             Console.WriteLine("Vous ne payerez pas l'impôt");
  27.                         }
  28.             }
  29.             Console.ReadKey();
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement