Question: Integers numberOfItems, allowedGroups, and rejectedGroups are read from input. If numberOfltems is 2 2 or more, then subtract 5 from allowedGroups. Otherwise, add 3 to

Integers numberOfItems, allowedGroups, and rejectedGroups are read from input. If numberOfltems is 22 or more, then subtract
5 from allowedGroups. Otherwise, add 3 to rejectedGroups.
Click here for examples
import java.util.Scanner;
public class GroupResearch {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
int numberofitems;
int allowedGroups;
int rejectedGroups;
numberofitems = scnr.nextInt ();
allowedGroups = scnr.nextInt ();
rejectedGroups = scnr.nextInt () ;
/* Your code goes here */
System.out.println(allowedGroups);
System.out.println(rejectedGroups);
 Integers numberOfItems, allowedGroups, and rejectedGroups are read from input. If numberOfltems

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!