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
Rachelle is writing a program that needs to calculate the cube root of a number. She is not sure how to write the code for that
Dmitriy789 [7]

The cube root is a number multiplied by itself three times to get another number

The code to use is y = x**(1/3)

<h3>How to determine the code to use</h3>

Assume the variable is x, and the cube root of x is y.

So, we have the following equation

y = x^\frac13

In Python, the code to use is y = x**(1/3)

Hence, the code that Rachelle can use in her calculation is x**(1/3)

Read more about cube roots at:

brainly.com/question/365670

3 0
2 years ago
Read 2 more answers
Diligent people are as concerned with the ____ as the ___ of their work
Ksivusya [100]

Answer:

Duration; quality/correctness.

Explanation:

Diligence is a way of life. It adds value to a piece of work. When a work is diligently done, it is said to be good or almost perfect. A diligent work evaluates all errors and corrects them from start to finish.

A diligent person takes time to analyse and complete a task to perfection. But diligence also comes with speed. A diligent work as to meet up with deadlines. Diligent people are also as concerned with the speed or duration of their work as to the correctness and quality.

5 0
3 years ago
GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
kumpel [21]
The answer is display information
4 0
3 years ago
Read 2 more answers
Water is constantly in motion.<br> True or false
motikmotik

Answer: true

Explanation: yes water is constantly in motion

7 0
3 years ago
What type of computer is IBM 1401 ?<br><br>​
rjkz [21]

Answer:

The IBM 1401 is a variable-word length decimal computer that was announced by IBM on October 5, 1959.

7 0
3 years ago
Other questions:
  • Write a Java program to print the result in the series 10, 15, 20, 25, ..., 50. Hint: You can use an iteration statement for wri
    9·1 answer
  • Advancements in technology that might be helpful for individuals who need accommodations to perform computer tasks include _____
    15·2 answers
  • The accessibility of a website refers to which of
    6·1 answer
  • True or false? A medical assistant can check for available exam rooms and providers using an electronic scheduling system.
    8·1 answer
  • What is a googleplex?
    7·1 answer
  • What is TLB for? Why TLB? Given the following number, what is theeffective memory access time?
    11·1 answer
  • If you wanted to include a chart in the new slide you are getting ready to create, you would most likely
    9·1 answer
  • The model for Diminishing Marginal Utility is ______ in nature.
    12·1 answer
  • It’s Saturday and you’re looking forward to hanging out with friends and having some fun. However, you get two phone calls early
    10·1 answer
  • What are the characteristics of calendar sharing options in Outlook 2016? Check all that apply.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!