import java.util.Scanner;
public class Project_TLE {
public static void main (String [] args ) {
Scanner fromKey = new Scanner (System.in);
int code,qty,amount,total,A, B, C,letter,payment, change;
code = fromKey.nextInt ();
System.out.println ("------------------------------");
System.out.println ("PhoneZy Cellshop");
System.out.println ("Your one stop gadget shop.");
System.out.println ("------------------------------");
System.out.println ("Gadget List ");
System.out.println (" A. Laptops ");
System.out.println ("******************************");
System.out.println ("A. Apple Macbook Pro ----- Php.94,900.00");
System.out.println ("B. HP Spectre X360 ----- Php.49,782.00 ");
System.out.println ("C. Razer Blade 14-Inch ----- Php.129,990.00");
System.out.println ("******************************");
System.out.println (" B. Tablets ");
System.out.println ("******************************");
System.out.println ("A. Huawei MediaPad T1 .70 ----- Php.4,100.00");
System.out.println ("B. Samsung Galaxy Tab A 7.0 ----- Php.6,990.00");
System.out.println ("C. Apple Ipad Mini Wifi 16GB ----- Php.8,999.00");
System.out.println ("******************************");
System.out.println (" C. Smartwatches ");
System.out.println ("******************************");
System.out.println ("A. Apple Watch ----- Php.13,690.00");
System.out.println ("B. Apple Watch Series 2 ----- Php.18,300.00");
System.out.println ("C. Samsung Smartwatch SW2 ----- Php.15,990.00");
System.out.println ("******************************");
System.out.println (" D. Smartphones ");
System.out.println ("******************************");
System.out.println ("A. OPPO F1s ----- Php.9,990.00");
System.out.println ("B. Samsung Galaxy J7 Pro ----- Php.15,000.00");
System.out.println ("C. Iphone 7 plus----- Php.40,000.00");
System.out.println ("******************************");
System.out.println ("------------------------------");
System.out.println ("Enter code: ");
letter = fromKey.nextInt ();
code = fromKey.nextInt ();
amount = fromKey.nextInt ();
payment = fromKey.nextInt ();
A = fromKey.nextInt ();
B = fromKey.nextInt ();
C = fromKey.nextInt ();
total = fromKey.nextInt ();
switch (letter)
{ case 1:System.out.println ("Enter letter of choice:" + letter);
if (letter==A)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*94900;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==B)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*47782;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==C)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*129990;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
break;
case 2:System.out.println ("Enter letter of choice:" + letter);
if (letter==A)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*4100;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==B)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*6990;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==C)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*8999;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
break;
case 3:System.out.println ("Enter letter of choice:");
if (letter==A)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*13690;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==B)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*18300;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==C)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*15990;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
break;
case 4:System.out.println ("Enter letter of choice:");
if (letter==A)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*9990;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total ;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==B)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*15990;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
if (letter==C)
{ System.out.println ("Enter quantity:");
qty = fromKey.nextInt ();
total =fromKey.nextInt ();
total = qty*40000;
System.out.println ("Enter payment:");
payment = fromKey.nextInt ();
}
if (payment<total)
{
System.out.println ("");
System.out.println ("");
System.out.println ("");
System.out.println ("***Transaction Error! Payment is Insufficient***");
}
if (payment>total)
{
System.out.println ("****Thank You For Shopping****");
System.out.println ("The Change is:");
change = fromKey.nextInt ();
change = payment - total;
System.out.println ("Please get the change!");
System.out.println ("");
}
break;
default:System.out.println (" ");
break;
}
}
}
The program would display a Cellshop in which the person is asked to choose from 4 options with 3 suboptions. the suboptions are selected by typing the letter then it will show the answers pls help asap fsahbafvakbcfnakncfklfnbcdfksnxahmjlcnfuxhamjhhibnchmjixdihnnujjmfiuhybghnjmiofgyuacuaebfnucecvnheufncweincuywwciuwbgyucnifuncuyafncvianmcjkiowncvijcxiunmciuefuxheuimfuincyuinmxqoemniuhecygurnhifncjuiecxiuucnexmcyifmnxudenxmjhexfmfiduheybnwugcrhcfcwicvhecvfiojmgvcerhguiverhvehoermib5ebv
Aucun commentaire:
Enregistrer un commentaire