WhippetBus - using System namespace ConsoleApplication1 cfw...

This preview shows page 1 - 2 out of 2 pages.

using System;namespace ConsoleApplication1{class Program{static void Main(string[] args){int x = 4, i;double tPriceBeforeDis = 0, tPriceAfterDis = 0, pSize = 0;string[] size = new string[4] { "S", "M", "L", "X" }; //i=3double[] price = new double[4] { 6.99, 8.99, 12.50, 15 }; //i=3int[] numberRangeLmit = new int[5] { 1, 2, 3, 4, 5 }; //x=4double[] discount = new double[5] { 0, 0.1, 0.15, 0.15, 0.20 }; //x=4Console.WriteLine("Pizza size - S M L X");Console.Write("Which size you want ");string s = Console.ReadLine();for (i = 0; i < size.Length; ++i){if (s == size[i]){Console.WriteLine("Price of a Pizza is {0}", price[i].ToString("C"));//pSize = price[i]; //(1) comment outi = size.Length;}}Console.Write("\nHow many Pizza you want ");

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture