Advertisement
JJMartinez

Oefening 2-4: Omrekenen excl. BTW naar incl. BTW

Nov 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. using System;
  2.  
  3. /*
  4.  * Oefening 2-4    
  5.  * In de garage van een BMW dealer zijn de prijzen van alle wagens weergegeven exclusief BTW.
  6.  * Ontwerp een consoletoepassing waarmee je met de opgegeven prijs exclusief BTW
  7.  * de prijs inclusief BTW kan berekenen.
  8.  * Het BTW-tarief voor een nieuwe BMW is 21 %.
  9.  * Het resultaat in de console wordt als volgt weergegeven: β€œDe prijs inclusief BTW bedraagt: x”.
  10.  */
  11.     namespace random_ForPasteBin
  12.     {
  13.         class MainClass
  14.         {
  15.             public static void Main(string[] args)
  16.             {
  17.                 {
  18.                 //Declaratie van de variabelen
  19.                 Double dblPrijsExBtw, dblPrijsInBtw;
  20.                 const Double cdblBtwTarief = 21;
  21.  
  22.                 //Prijs van een wagen opvragen
  23.                 Console.WriteLine("Hoeveel is de prijs exclusief BTW? ");
  24.                 dblPrijsExBtw = Convert.ToDouble(Console.ReadLine());
  25.  
  26.                 //Prijs inclusief BTW berekenen
  27.                 dblPrijsInBtw = dblPrijsExBtw * (1 + cdblBtwTarief / 100);
  28.  
  29.                 //Prijs inclusief BTW weergeven in de console
  30.                 Console.WriteLine("De prijs inclusief BTW bedraagt: " + dblPrijsInBtw.ToString());
  31.                 Console.ReadLine();
  32.                
  33.                 }
  34.             }
  35.         }
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement