Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the purpose of a submittal?

Answered: 1 week ago

Question

=+Creative strategy statement template Example

Answered: 1 week ago