Advertisement
Spocoman

Savings

Oct 7th, 2023
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Savings
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double salary = double.Parse(Console.ReadLine());
  10.             int months = int.Parse(Console.ReadLine());
  11.             double minimalCosts = double.Parse(Console.ReadLine());
  12.  
  13.             double monthlySavings = salary * 0.70 - minimalCosts;
  14.  
  15.             Console.WriteLine($"She can save {monthlySavings / salary * 100:f2}%\n{monthlySavings * months:f2}");
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement