Question: The initial value of numLaptops is read from input. Assign numDesktops with the sum of numLaptops and 5 . Then, assign numLaptops with the same
The initial value of numLaptops is read from input. Assign numDesktops with the sum of numLaptops and Then, assign numLaptops with the same value as numDesktops. Lastly, assign totalComputers with the sum of numLaptops and numDesktops.
Click here for example
Ex: If the input is then the output is:
laptops
desktops
total
import java.util.Scanner;
public class LabData
public static void mainString args
Scanner scnr new Scanner
System.in;
int numLaptops;
int numDesktops;
int totalComputers;
numLaptops scnr nextInt ;
numDesktops numLaptops;
numLaptops numDesktops ;
level Jaelyn King
totalComputers numLaptops numDesktops;
System.out.printlnnumLaptops "laptops";
System.out.printlnnumDesktops "desktops";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
