MuffinMonster

Class Task 40#

Dec 11th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Dollar(int dollars, double worth)
  11.         {
  12.             double precent, sum1;
  13.             sum1 = dollars * worth;
  14.             int dollarstart = dollars;
  15.             for (int i = 1; i <= 10; i++)
  16.             {
  17.                 Console.WriteLine("Enter the precentage of dollar's change today: (1% - 100%)");
  18.                 precent = double.Parse(Console.ReadLine());
  19.                 precent = precent / 100;
  20.                 worth = worth * precent;
  21.             }
  22.             Console.Write("Paar: " + Math.Abs(worth * dollars - sum1));
  23.  
  24.            
  25.         }
  26.         static void Main(string[] args)
  27.         {
  28.             Console.WriteLine("Enter the worth of dollars you've purchased:");
  29.             double dollarsworth = double.Parse(Console.ReadLine());
  30.             Console.WriteLine("Enter the ammount of dollars:");
  31.             int dollars = int.Parse(Console.ReadLine());
  32.             Dollar(dollars, dollarsworth);
  33.             Console.ReadLine();
  34.         }
  35.     }
  36. }
Add Comment
Please, Sign In to add comment