Java VP of Sales at Nvidia Inc wants to system so she can a
Java
VP of Sales at Nvidia Inc wants to system so she can
a. Track sales of 3 products (GTX, Titan and 1080ati), for 3 quarters in 2017(q1, q2, q3) and three georgraphies in US(West, North and South).
b. Print a report for the following:
opt1. Total sales for any product (take user input) across all geographies and all quarters).
opt2. Total sales for any quarter (take user input) for all product and all geographies).
opt3. Total sales for any geography (take user input) for all products and all quarters).
Design -
Structured Programming - Structure Chart
You need to creat these methods for the program in Java:
public class SalesApp {
public static void ShowMenu() { }
public static void Enterdata() { }
public static void TotalSalesbyProduct() { }
public static void TotalSalesbyQuarter() { }
public static void TotalSalesbyGeography() { }
public static void EndProgram() { System.exit(0); }
Solution
import java.util.Scanner;
public class SalesApp {
public static void main(String[] args) {
Scanner s = new Scanner ( System.in);
System.out.println(\"Menu\");
System.out.print(\"\ 1)GTX\");
System.out.print(\"\ 2)Titan\");
System.out.print(\"\ 3)1080ati\");
System.out.print(\"\ 4)exit\");
int choiceentry;
do {
choiceentry = s.nextInt();
switch (choiceentry)
{
case 1:
System.out.print(\"Enter order of GTX in quarter(q1,q2,q3) and geographic area of Us(West,North,South)\");
int quarter1=s.nextInt();
int geo_us1=s.nextInt();
break;
case 2:
System.out.print(\"Enter order of Titan in quarter(q1,q2,q3) and geographic area of Us(West,North,South)\");
int quarter2=s.nextInt();
int geo_us2=s.nextInt();
break;
case 3:
System.out.print(\"Enter order of 1080ati in quarter(q1,q2,q3) and geographic area of Us(West,North,South)\");
int quarter3=s.nextInt();
int geo_us3=s.nextInt();
default:
System.out.println(\"Choice must be a value between 1 and 3.\");
}
}while(choiceentry!=3);
}
}
as per your requirement i have completed first section

