Advertisement
LePetitGlacon

FICHE 4 Exercice 2 #2

Sep 30th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. namespace e
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.            Console.WriteLine("Nombre de photocopie effectuées");
  10.            float nombrePhotocopie = float.Parse(Console.ReadLine());
  11.            float prixTotal;
  12.            
  13.            if (nombrePhotocopie <= 10)
  14.             {
  15.                 prixTotal = nombrePhotocopie * 0.1f;
  16.             }
  17.             else
  18.             {
  19.                 if (nombrePhotocopie <= 30)
  20.                     {
  21.                     prixTotal = 10 * 0.1f + (nombrePhotocopie - 10) * 0.09f;
  22.                     }
  23.                     else
  24.                     {  
  25.                         prixTotal = 10 * 0.1f + 20 * 0.09f + (nombrePhotocopie - 30) * 0.08f;
  26.                     }
  27.                
  28.             }
  29.             Console.WriteLine("Le prix sera {0} euro",prixTotal);
  30.             Console.ReadLine();
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement