Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started