1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gladu [14]
3 years ago
12

Java code?????

Computers and Technology
1 answer:
12345 [234]3 years ago
5 0

Answer:

Explanation:

Here is the code for you:

import java.io.*;

import java.util.*;

class GirlScoutCookies

{

public static void main(String[] args)

{

int [] BoxesCategory = new int[5];

Scanner sc = new Scanner(System.in);

System.out.print("Total number of girls in the troop: ");

int numOfGirlScouts = sc.nextInt();

for(int i = 0; i < numOfGirlScouts; i++)

{

System.out.print("Boxes of cookies for girl #"+(i+1)+": ");

int boxes = sc.nextInt();

if(boxes >= 0 && boxes <= 10)

BoxesCategory[0]++;

else if(boxes >= 11 && boxes <= 20)

BoxesCategory[1]++;

else if(boxes >= 21 && boxes <= 30)

BoxesCategory[2]++;

else if(boxes >= 31 && boxes <= 40)

BoxesCategory[3]++;

else if(boxes > 40)

BoxesCategory[4]++;

}

System.out.println("TOTAL BOXES\tNUMBER OF GIRL SCOUTS");

System.out.println(" 0 to 10\t"+BoxesCategory[0]);

System.out.println("11 to 20\t"+BoxesCategory[1]);

System.out.println("21 to 30\t"+BoxesCategory[2]);

System.out.println("31 to 40\t"+BoxesCategory[3]);

System.out.println("41 or more\t"+BoxesCategory[4]);

}

}

And the sample output is:

You might be interested in
Which fund classification would a focus on only stocks of technology companies match?
Bumek [7]

Answer:

Growth funds

Explanation:

This funds fucos on capital appreciation

5 0
3 years ago
Please Help!
Alex787 [66]

The three default components listed in the inspector view of a terrain assets are: Terrain, Terrian Collider  and Texture.

So the answer is Transform.

If you use the Move tool then click and drag an object while holding CTRL and Shift at the same time, it will snap the object to intersection points of the Collider; allowing stacking of objects automatically.

So the answer is Stack objects automatically.

3 0
3 years ago
Read 2 more answers
5.
larisa86 [58]

Answer:

Explanation:

5 is correct answer

3 0
3 years ago
How can you tell if your car is overheating?
Nitella [24]
A) your temp gauge is moving into red
4 0
3 years ago
Read 2 more answers
How many total numbers can be represented with an 8-bit binary (base-2) system?
ddd [48]

Answer:

256

Explanation:

4 0
3 years ago
Other questions:
  • In three to five sentences, describe how you can organize written information logically and sequentially
    8·1 answer
  • What is an example of asynchronous communication
    7·1 answer
  • What leadership style involves the ideas of advice others
    6·1 answer
  • A user is experiencing slow performance with their computer. A technician suspects the computer has a virus and runs antivirus s
    12·1 answer
  • Which one of the following is not possible to view in the debug logs?
    8·1 answer
  • After Maya gave her friend the password to a protected website, the friend was able to remember it only long enough to type it i
    6·1 answer
  • Need help with just #8
    12·1 answer
  • A _____ is a unique name that identifies an Internet site. URL Browser AOL IA
    13·1 answer
  • Badin Industries runs a web application that processes e-commerce orders and handles credit card transactions. As such, it is su
    9·2 answers
  • You need to install Windows on a new computer. You also need to replace a motherboard in another computer, and both tasks need t
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!