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 20, then add 3 to allowedGroups. Otherwise, subtract 5 from rejectedGroups.
Click here for examples
Ex 1: If the input is 19151, then the output is:
18
1
Ex 2: If the input is 21151, then the output is:
15
-4Integers numTasks, allowedGroups, and rejectedGroups are read from input. If numTasks is less than
20, then add 3 to allowedGroups. Otherwise, subtract 5 from rejectedGroups.
Click here for examples
import java.util.Scanner;
public class GroupDetails {
public static void main(string[] args){|
Scanner scnr = new Scanner(
System.in);
int numTasks;
int allowedGroups;
int rejectedGroups;
numTasks = scnr.nextInt () ;
allowedGroups = scnr. nextInt ();
rejectedGroups = scnr. nextInt () ;
/* Your code goes here */
System.out.println(allowedGroups);
System.out.println(rejectedGroups);
}I
 In Java, please: Integers numTasks, allowedGroups, and rejectedGroups are read from

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!