Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MNS // Note: actual namespace depends on the project name.
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- //Niveau 1 Dire Bonjour
- Console.WriteLine("Comment tu t'appelles ?");
- string entree = Console.ReadLine();
- Console.WriteLine("Bonjour " + entree);
- //Niveau 2 Addition
- Console.WriteLine("Donne moi un nombre : ");
- string nombre1 = Console.ReadLine();
- Console.WriteLine("Donne moi un autre nombre : ");
- string nombre2 = Console.ReadLine();
- int resultat = int.Parse(nombre1) + int.Parse(nombre2);
- Console.WriteLine("La somme de ces deux nombres est : " + resultat);
- //Niveau 3 : Soldes
- Console.WriteLine("Donne moi un prix : ");
- string prix = Console.ReadLine();
- Console.WriteLine("Donne moi une pourcentage de rΓ©duction : ");
- string reduction = Console.ReadLine();
- float prixFloat = float.Parse(prix);
- float reductionFloat = float.Parse(reduction);
- float montantRemise = reductionFloat * prixFloat / 100;
- float prixFinal = prixFloat - montantRemise;
- Console.WriteLine("Le prix final est : " + prixFinal);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment