Fay's number of laptops and desktops are read from input represented by numLaptops and numDesktops, respectively. Fay receives 2 additional laptops. Fay's number of desktops increases 3 times.
First, write statements to update numLaptops and numDesktops.
Then, assign the variable totalComputers with the total number of laptops and desktops.
Click here for example
import java.util.Scanner;
public class LabData {
public static void main(String[] args) {
Scanner scnr = new Scanner(System. in);
int numLaptops;
int numDesktops;
int totalComputers;
numLaptops = scnr.nextInt();
numDesktops = scnr.nextInt();
/* Your code goes here */
System.out.println(numLaptops + " laptops");
System.out.println(numDesktops + " desktops");
System.out.println(totalComputers + " total");
}
}
import java.util.Scanner;
public class LabData {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int numLaptops;
int numDesktops;
int totalComputers;
numLaptops = scnr.nextInt();
numDesktops = scnr.nextInt();
/* Your code goes here */
System.out.println(numLaptops + " laptops");
System.out.println(numDesktops + " desktops");
System.out.println(totalComputers + " total");
}
}