Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integers numObjects, requiredGroups, and invalidGroups are read from input. If numObjects is less than 1 8 , then subtract 5 from requiredGroups. Otherwise, add 4

Integers numObjects, requiredGroups, and invalidGroups are read from input. If numObjects is less than 18, then subtract 5 from requiredGroups. Otherwise, add 4 to invalidGroups.
Ex: If the input is 17101, then the output is:
5
1 import java.util.Scanner;
public class GroupResearch {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int numObjects;
int requiredGroups;
int invalidGroups;
numObjects = scnr.nextInt();
requiredGroups = scnr.nextInt();
invalidGroups = scnr.nextInt();
/* Your code goes here */
System.out.println(requiredGroups);
System.out.println(invalidGroups);
}
}

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

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

Students also viewed these Databases questions

Question

Explain why accounts payable are considered to be free debt.

Answered: 1 week ago

Question

Discuss four ( 4 ) types of enterprise applications.

Answered: 1 week ago

Question

2. Develop a persuasive topic and thesis

Answered: 1 week ago

Question

1. Define the goals of persuasive speaking

Answered: 1 week ago