Question: In Java, please: Integers numTasks, allowedGroups, and rejectedGroups are read from input. If numTasks is less than 2 0 , then add 3 to allowedGroups.
In Java, please:
Integers numTasks, allowedGroups, and rejectedGroups are read from input. If numTasks is less than then add to allowedGroups. Otherwise, subtract from rejectedGroups.
Click here for examples
Ex : If the input is then the output is:
Ex : If the input is then the output is:
Integers numTasks, allowedGroups, and rejectedGroups are read from input. If numTasks is less than
then add to allowedGroups. Otherwise, subtract from rejectedGroups.
Click here for examples
import java.util.Scanner;
public class GroupDetails
public static void mainstring args
Scanner scnr new Scanner
System.in;
int numTasks;
int allowedGroups;
int rejectedGroups;
numTasks scnrnextInt ;
allowedGroups scnr nextInt ;
rejectedGroups scnr nextInt ;
Your code goes here
System.out.printlnallowedGroups;
System.out.printlnrejectedGroups;
I
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
