Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

using using using using

System; System.Collections.Generic; System.Linq; System.Text;

namespace Assignment1 { class Program { static void Main(string[] args) { double sale1, sale2, sale3, sale4, total, ave, com; Console.Write("Enter First Quarter Sale : "); sale1 = Convert.ToDouble(Console.ReadLine()); Console.Write("Enter Second Quarter Sale : "); sale2 = Convert.ToDouble(Console.ReadLine()); Console.Write("Enter Third Quarter Sale : "); sale3 = Convert.ToDouble(Console.ReadLine()); Console.Write("Enter Fourth Quarter Sale : "); sale4 = Convert.ToDouble(Console.ReadLine()); total = sale1 + sale2 + sale3 + sale4; ave = total / 4; Console.WriteLine("===================================="); Console.WriteLine(); if (total >= 5000 && total <= 10000) com = total * 0.10; else if (total > 10000 && total <= 20000) com = total * 0.15; else if (total > 20000) com = total * 0.20; else com = 0.00; Console.WriteLine("Total Sale : " + total.ToString()); Console.WriteLine("Average Sale : " + ave.ToString()); Console.WriteLine("Commission : " + com.ToString()); Console.ReadLine(); } } }

You might also like