Advertisement
desislava_topuzakova

01. Savings

May 1st, 2020
654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3.  
  4. namespace demo
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.  
  11.             //Доход
  12.             //спестени пари = доход - (пари за живеене + пари за непред.)
  13.             // спесетени пари за х месеца
  14.  
  15.             double income = double.Parse(Console.ReadLine());
  16.             int months = int.Parse(Console.ReadLine());
  17.             double sumPrivate = double.Parse(Console.ReadLine());
  18.  
  19.             double sumUnexpected = 0.3 * income;
  20.             double savedMoneyPerMonth = income - sumPrivate - sumUnexpected;
  21.  
  22.             double totalMoney = months * savedMoneyPerMonth;
  23.             double percent = savedMoneyPerMonth / income * 100;
  24.  
  25.             Console.WriteLine($"She can save {percent:F2}%");
  26.             Console.WriteLine($"{totalMoney:F2}");
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement