Advertisement
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 Section3a
- {
- class Program
- {
- private static string custName;
- private static string custStreet;
- private static string custCity;
- private static string custState;
- private static string custZip;
- private static double custNoBlenders;
- const double SALES_TAX = .07;
- const double BLENDER_PRICE = 39.95;
- private static double custTotal;
- private static double custTax;
- private static double custSubTotal;
- static void Main(string[] args)
- {
- //interactive user prompt data
- Console.Write("Please enter your name: ");
- custName = Console.ReadLine();
- Console.Write("\nPlease Enter your street address: ");
- custStreet = Console.ReadLine();
- Console.Write("\nPlease enter your City: ");
- custCity = Console.ReadLine();
- Console.Write("\nPlease enter your State: ");
- custState = Console.ReadLine();
- Console.Write("\nPlease enter your Zip Code: ");
- custZip = Console.ReadLine();
- Console.Write("\nPlease enter the number of blenders you would like to purchase: ");
- custNoBlenders = Convert.ToDouble(Console.ReadLine());
- //Calculations
- custSubTotal = custNoBlenders * BLENDER_PRICE;
- custTax = custSubTotal * SALES_TAX;
- custTotal = custSubTotal + custTax;
- //Output
- Console.WriteLine("\n\n\n");
- Console.WriteLine(custName);
- Console.WriteLine(custStreet);
- Console.WriteLine("{0}, {1} {2}\n", custCity, custState, custZip);
- Console.WriteLine("Number of blenders ordered: {0}\n\n", custNoBlenders);
- Console.WriteLine("Subtotal:\t{0}",custSubTotal.ToString("c"));
- Console.WriteLine("Tax:\t\t{0}",custTax.ToString("c"));
- Console.WriteLine("--------------------");
- Console.WriteLine("Total Due:\t{0}",custTotal.ToString("c"));
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement