Themes are selected in different tabs. It varies.
Answer:
import java.util.Scanner;
public class CalculatingSales {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int product, quantity;
double total = 0;
while(true) {
System.out.println("Enter product_id and quantity(0 0 to stop): ");
product = sc.nextInt();
quantity = sc.nextInt();
if(product==0 && quantity == 0)
break;
switch (product) {
case 1:
total = total + 2.98*quantity;
break;
case 2:
total = total + 4.50*quantity;
break;
case 3:
total = total + 9.98*quantity;
break;
case 4:
total = total + 4.49*quantity;
break;
case 5:
total = total + 6.87*quantity;
break;
default:
System.out.println("Invalid option");
}
}
System.out.println("total value: "+total);
sc.close();
}
}
Explanation:
- Take the product and quantity as input from user.
- Use a switch statement to multiply the total with their relevant value.
- Display the total value.
Answer:
Option(C) is the correct answer to the given question.
Explanation:
Since overall the On-Board Diagnostics of the level 2 the computer systems need to evaluate the cause of the engine failures .The malfunction significantly increases in the fuel consumption, so that we can detecting the error code in the vehicle.
- If we starting the engine as well as by using the DMM, we'll see how much battery voltage it is at the negative ignition coil node.
- If the spark module is faulty and no ignition coils can fire so all the engines are working that's why all the other option are incorrect .