Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hours, payment, totalpay = 0, temp, x = 0;
- Console.Write("Enter hours: ");
- hours = int.Parse(Console.ReadLine());
- Console.Write("Payment: ");
- payment = int.Parse(Console.ReadLine());
- while (payment != -999 && hours != -999)
- {
- temp = payment * hours;
- if (hours > 150)
- temp += 250;
- totalpay = totalpay + temp;
- x++;
- Console.Write("Enter hours: ");
- hours = int.Parse(Console.ReadLine());
- Console.Write("Payment: ");
- payment = int.Parse(Console.ReadLine());
- }
- Console.WriteLine("Total payment was: " + totalpay);
- Console.WriteLine("Memuza: " + (totalpay/x));
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment