DIm Cost, Cost2 as Decimal
DIm PhoneorTablet,YNCharger as Char
DIm TabletChoice, PhoneChoice, SimChoice, CaseChoice, ChargerChoice as Integer
Dim PhonePrice(6) as Decimal
Dim TabletPrice(4) as Decimal
Dim Discount, TotalDiscount as decimal
Dim UserChoice As Integer
Console.WriteLine("MENU OF OPTIONS")
Console.WriteLine("Task 1")
Console.WriteLine("Task 2")
Console.WriteLine("Task 3")
Console.WriteLine("Enter number 1 - 3")
UserChoice = Console.ReadLine()
Loop Until UserChoice >= 1 And UserChoice <= 3
Console.WriteLine("Task 1")
Dim PhoneItemCode(6) as String
Dim PhoneDescription(6) as String
Dim TabletItemCode(4) as String
Dim TabletDescription(4) as String
Dim SimCItemCode(2) as String
Dim SimCDescription(2) as String
Dim SimCPrice(2) as Decimal
Dim CaseItemCode(2) as String
Dim CaseDescription(2) as String
Dim CasePrice(2) as Decimal
Dim ChargerItemCode(3) as String
Dim ChargerDescription(3) as String
Dim ChargerPrice(3) as Decimal
PhoneItemCode(1)= "BPCM "
PhoneItemCode(2)= "BPSH "
PhoneItemCode(3)= "RPSS "
PhoneItemCode(4)= "RPLL "
PhoneItemCode(5)= "YPLS "
PhoneItemCode(6)= "YPLL "
PhoneDescription(1)= "Compact "
PhoneDescription(2)= "Clam Shell "
PhoneDescription(3)= "RoboPhone-5-inch screen and 64GB Memory "
PhoneDescription(4)= "RoboPhone-6-inch screen and 256GB Memory "
PhoneDescription(5)= "Y-Phone Standard-6-inch screen and 64GB Memory "
PhoneDescription(6)= "Y-Phone Deluxe-6-inch screen and 256GB Memory "
TabletItemCode(1)= "RTMS "
TabletItemCode(2)= "RTML "
TabletItemCode(3)= "YTLM "
TabletItemCode(4)= "YTLL "
TabletDescription(1) = "RoboTab-8-inch screen and 64GB Memory "
TabletDescription(2) = "RoboTab-10-inch screen and 128GB Memory "
TabletDescription(3) = "Y-Tab Standard- 10 inch screen and 128GB memory "
TabletDescription(4) = "Y-Tab Standard- 10 inch screen and 256GB memory "
SimCItemCode(1) = "SMNO "
SimCItemCode(2) = "SMPG "
SimCDescription(1) = "Sim Free (no Sim Card purchased) "
SimCDescription(2) = "Pay As You Go (SIM card purchased) "
CaseItemCode(1) = "CSST "
CaseItemCode(2) = "CSLX "
CaseDescription(1) = "Standard "
CaseDescription(2) = "Luxury "
ChargerItemCode(1) = "CGCR "
ChargerItemCode(2) = "CGHM "
ChargerItemCode(3) = "CGCR & CGHM "
ChargerDescription(1) ="Car "
ChargerDescription(2) ="Home "
ChargerDescription(3) ="Car & Home "
console.WriteLine("(P)hone or (T)ablet (P/T)?")
PhoneorTablet=console.ReadLine()
loop until PhoneorTablet= "P" or PhoneorTablet= "T"
If PhoneorTablet = "P" then
console.WriteLine(i & ". " & PhoneItemCode(i) & PhoneDescription(i) & "$" & PhonePrice(i))
console.WriteLine("Enter Phone Choice (1-6)")
PhoneChoice= console.ReadLine()
Loop Until PhoneChoice= 1 or PhoneChoice= 2 or PhoneChoice= 3 or PhoneChoice= 4 or PhoneChoice= 5 or PhoneChoice= 6
Cost= cost + Phoneprice(Phonechoice)
console.WriteLine(i & ". " & SimCItemCode(i) & SimCDescription(i) & SimCPrice(i))
console.WriteLine("Would you like a Free SIm Card or Pay As You go? (1-2)")
SimChoice=console.ReadLine()
Loop Until SImChoice= 1 or SImChoice= 2
Cost= cost + SimCPrice(SimChoice)
console.WriteLine(i & ". " & CaseItemCode(i) & CaseDescription(i) & CasePrice(i))
console.WriteLine("Would you like to get a Standard or Luxury? (1-2)")
Casechoice=console.ReadLine()
Loop Until Casechoice = 1 or Casechoice = 2
Cost= cost + CasePrice(CaseChoice)
console.WriteLine("Would you like a charger? (Y/N)")
YNCharger = console.ReadLine()
Loop Until YNCharger= "Y" OR YNCharger= "N"
console.WriteLine(i & ". " & ChargerItemCode(i) & ChargerDescription(i) & ChargerPrice(i))
console.WriteLine("Would you like to get a Car or Home charger or Both (1-3) ")
Chargerchoice=console.ReadLine()
Loop Until Chargerchoice = 1 or Chargerchoice = 2 or ChargerCHoice = 3
Cost= cost + ChargerPrice(ChargerChoice)
console.WriteLine("Reciept:")
console.WriteLine(PhoneDescription(PhoneChoice) & PhonePrice(PhoneChoice))
console.WriteLine(SimcDescription(SimChoice) & SimcPrice(SimChoice))
console.WriteLine(CaseDescription(CaseChoice) & CasePrice(CaseChoice))
console.WriteLine(ChargerDescription(ChargerChoice) & ChargerPrice(ChargerChoice))
Else if PhoneorTablet = "T" then
console.WriteLine(i & ". "& TabletItemCode(i) & TabletDescription(i) & "$" & TabletPrice(i))
console.WriteLine("Enter Tablet Choice (1-4)")
TabletChoice= console.ReadLine()
Loop Until TabletChoice = 1 or TabletChoice = 2 or TabletChoice = 3 or TabletChoice = 4
Cost= cost + TabletPrice(TabletChoice)
console.WriteLine(TabletDescription(TabletChoice) & TabletPrice(TabletChoice))
console.WriteLine("Your total cost is " & Cost)
Console.WriteLine("Task 2")
console.WriteLine("Any more devices(Y/N)?")
Anymore= console.ReadLine()
Console.WriteLine("Task 3")
const DiscountPercent as decimal = 10
If PhoneorTablet="P" then
Discount=DiscountPercent/100*Phoneprice(Phonechoice)
Discount=DiscountPercent/100*Tabletprice(Tabletchoice)
Discount=Math.Round(Discount,2)
Cost2=Cost2+Cost-Discount
TotalDiscount=TotalDiscount+Discount
console.WriteLine("Any more devices(Y/N)?")
Anymore= console.ReadLine()
console.WriteLine("Your total discount is " & TotalDiscount)
console.WriteLine("Your final price is " & Cost2)