Integers numberOfParts, required Groups, and invalid Groups are read from input. If numberOfParts is 21 or more, then add 3 to requiredGroups. Otherwise, add 6 to invalidGroups. ► Click here for examples 3 public class GroupSurvey { 4 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int numberOfParts; int requiredGroups; I int invalidGroups; 345679 8 9 10 11 12 13 14 15 16 17 18 19 20 } numberOfParts = scnr.nextInt (); requiredGroups = scnr.nextInt (); invalidGroups = scnr.nextInt (); /* Your code goes here */ if(numberOfParts>21){ requiredGroups= System.out.println(requiredGroups); System.out.println(invalidGroups);

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question
Integers numberOfParts, required Groups, and invalid Groups are read from input. If numberOfParts is 21 or more, then add 3 to
requiredGroups. Otherwise, add 6 to invalidGroups.
► Click here for examples
3 public class GroupSurvey {
4 public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int numberOfParts;
int requiredGroups;
I
int invalidGroups;
345679
8
9
10
11
12
13
14
15
16
17
18
19
20
}
numberOfParts = scnr.nextInt ();
requiredGroups = scnr.nextInt ();
invalidGroups = scnr.nextInt ();
/* Your code goes here */
if(numberOfParts>21){
requiredGroups=
System.out.println(requiredGroups);
System.out.println(invalidGroups);
Transcribed Image Text:Integers numberOfParts, required Groups, and invalid Groups are read from input. If numberOfParts is 21 or more, then add 3 to requiredGroups. Otherwise, add 6 to invalidGroups. ► Click here for examples 3 public class GroupSurvey { 4 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int numberOfParts; int requiredGroups; I int invalidGroups; 345679 8 9 10 11 12 13 14 15 16 17 18 19 20 } numberOfParts = scnr.nextInt (); requiredGroups = scnr.nextInt (); invalidGroups = scnr.nextInt (); /* Your code goes here */ if(numberOfParts>21){ requiredGroups= System.out.println(requiredGroups); System.out.println(invalidGroups);
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,