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
Contact [7]
3 years ago
7

Write a method called classSplit that accepts a file scanner as input. The data in the file represents a series of names and gra

duation years. You can assume that the graduation years are from 2021 to 2024.Sample input file:Hannah 2021 Cara 2022 Sarah2022Nate 2023 Bob 2022 Josef 2021 Emma 2022Your method should count the number of names per graduation year and print out a report like this --- watch the rounding!:students in class of 2021: 28.57%students in class of 2022: 57.14%students in class of 2023: 14.29%students in class of 2024: 00.00%You must match the output exactly.You may not use any arrays, arrayLists, or other datastructures in solving this problem. You may not use contains(), startsWith(), endsWith(), split() or related functions. Token-based processing, please.There is no return value.
Computers and Technology
1 answer:
Lelu [443]3 years ago
4 0

Answer:

public static void classSplit(Scanner file){

   int studentsOf21 = 0, studentsOf22 = 0,studentsOf23 = 0, studentsOf24 = 0;

   while (file.hasNext() == true){

       String studentName = file.next();

       int year = file.nextInt();

       switch (year){

           case 2021:

               studentsOf21++;

               break;

           case 2022:

               studentsOf22++;

               break;

           case 2023:

               studentsOf23++;

               break;

           case 2024:

               studentsOf24++;

               break;

       }

   }

   int totalGraduate = studentsOf21+studentsOf22+studentsOf23+studentsOf24;

   System.out.printf("students in class of 2021: %.2f%n", students2021*100.0/totalGraduate);

   System.out.printf("students in class of 2022: %.2f%n", students2022*100.0/totalGraduate);

   System.out.printf("students in class of 2023: %.2f%n", students2023*100.0/totalGraduate);  

   System.out.printf("students in class of 2024: %.2f%n", students2024*100.0/totalGraduate);

}

Explanation:

The classSplit method of the java class accepts a scanner object, split the object by iterating over it to get the text (for names of students) and integer numbers (for graduation year). It does not need a return statement to ask it prints out the percentage of graduates from 2021 to 2024.

You might be interested in
Which activity is performed during high-level design in the V-model?
SVETLANKA909090 [29]

Answer:

understanding component interaction

4 0
2 years ago
Identify the three fuzzy logic systems in the given text.
Furkat [3]

Answer:

she is the both city CAA been Van from is next

4 0
2 years ago
A ______ system writes data on two or more disks simultaneously, thereby creating a complete copy of all the information on mult
Mrrafil [7]

A raid 1 and mirrored system writes data on two or more disks simultaneously, thereby creating a complete copy of all the information on multiple drives.

<h3>What is Disk mirroring?</h3>

In data storage, disk mirroring is a term that connote the doubling of logical disk volumes into a different physical hard disks so that it will always be available.

Conclusively, Note that this is mostly used in RAID 1. A mirrored volume is known to be full logical depiction of separate volume copies and as such the answer above is correct.

Learn more about system from

brainly.com/question/25594630

8 0
2 years ago
What is the difference between computer architecture and computer organization?
alukav5142 [94]
The distinction between "computer architecture" and "computer organization" has become very fuzzy, if no completely confused or unusable. Computer architecture was essentially a contract with software stating unambiguously what the hardware does. The architecture was essentially a set of statements of the form "If you execute this instruction (or get an interrupt, etc.), then that is what happens. Computer organization, then, was a usually high-level description of the logic, memory, etc, used to implement that contract: These registers, those data paths, this connection to memory, etc. Programs written to run on a particular computer architecture should always run correctly on that architecture no matter what computer organization (implementation) is used. For example, both Intel and AMD processors have the same X86 architecture, but how the two companies implement that architecture (their computer organizations) is usually very different. The same programs run correctly on both, because the architecture is the same, but they may run at different speeds, because the organizations are different. Likewise, the many companies implementing MIPS, or ARM, or other processors are providing the same architecture - the same programs run correctly on all of them - but have very different high - level organizations inside them.
8 0
3 years ago
Read 2 more answers
When did Microsoft released MS-Word 2016? S When did Microsoft released MS - Word 2016​
Pepsi [2]

Answer:

July 9, 2015

Explanation:

It was released on macOS on July 9, 2015, and on Microsoft Windows on September 22, 2015, for Office 365 subscribers. Mainstream support ended on October 13, 2020, and extended support for most editions of Office 2016 will end on October 14, 2025, the same day as Windows 10.

3 0
1 year ago
Other questions:
  • Torque is defined as _____.
    7·1 answer
  • The first widely adopted windows product, ____, featured a standardized look and feel, similar to the one made popular by apple'
    11·1 answer
  • All of the nested folders you created will carry the same permissions as the __________ until you make changes.
    10·1 answer
  • in cell h5, enter a formula that will calculate the percentage of attendees that went to the Altamonte springs job fair in 2018.
    15·2 answers
  • Why should characters be avoided in file names
    11·1 answer
  • Name 3 examples of operating system software that are not Windows based.
    5·1 answer
  • What type of Internet monitoring technique records information about a customer during a web surfing session, such as what websi
    8·1 answer
  • Lesson 3 - Calling All Operators
    6·1 answer
  • Which of the following screen elements is a horizontal bar that displays at the
    8·1 answer
  • When individuals are purchasing a computer, they sometimes might get the most expensive computer they can afford. Why might this
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!