Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace morexercies
- {
- class Program
- {
- static void Main(string[] args)
- {
- double paycheck = double.Parse(Console.ReadLine());
- double monthsForSaving = double.Parse(Console.ReadLine());
- double essentials = double.Parse(Console.ReadLine());
- double personal = paycheck * 0.3;
- double savedSum = (paycheck - (essentials + personal)) * monthsForSaving;
- double percentage = (savedSum / monthsForSaving / paycheck * 100);
- Console.WriteLine($"She can save {percentage:f2}%");
- Console.WriteLine($"{savedSum:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement