Question

In: Computer Science

Program: Java Write a Java program using good programming principles that will aggregate the values from...

Program: Java


Write a Java program using good programming principles that will aggregate the values from several input files to calculate relevant percentages and write the values to an output file.

You have been tasked with reading in values from multiple files that contains different pieces of information by semester. The Department of Education (DOE) would like the aggregate values of performance and demographic information by academic year. A school year begins at the fall semester and concludes at the end of the summer semester the following year. Fall 2019 - Summer 2020 is considered one academic year.

Input Files

  • Input files named Fall2019Analytics.txt, Spring2020Analytics.txt, and Summer2020Analytics.txt have been placed in Canvas.   Each have the same layout but differ by semesters.
  • Each file contains several pieces of data by program - total enrollment, enrollment by gender, completion by gender, enrollment by ethnicity, completion by ethnicity, among other pieces of data.  
  • The program should read in the values from these input files, aggregate the data, and write the information to an output file that will be sent to Tallahassee.
  • From there, the DOE will use this output file as input to aggregate the data from other schools within the state of Florida.
  • It is important that this file is formatted in the proper sequence that the DOE needs - otherwise the college will be heavily fined and may lose accreditation.


These input files contain the data for three programs on campus:

Program code 3624
Program code 5651
Program code 6635

Input file layout (all integer values) by semester:

  • program number
  • total number of students enrolled in the program
  • total number of student completers in the program
  • total number of female students enrolled in the program
  • total number of male students enrolled in the program
  • total number of unknown/not reported gender students enrolled in the program
  • total number of female student completers in the program
  • total number of male student completers in the program
  • total number of unknown/not reported student completers in the program
  • total number of Asian students enrolled in the program
  • total number of Black students enrolled in the program
  • total number of Hispanic students enrolled in the program
  • total number of Multiracial students enrolled in the program
  • total number of Native American students enrolled in the program
  • total number of Native Hawaiian students enrolled in the program
  • total number of Unknown/not reported ethnicity students enrolled in the program
  • total number of White students enrolled in the program
  • total number of Asian student completers in the program
  • total number of Black student completers in the program
  • total number of Hispanic student completers in the program
  • total number of Multiracial student completers in the program
  • total number of Native American student completers in the program
  • total number of Native Hawaiian student completers in the program
  • total number of Unknown ethnicity student completers in the program
  • total number of White students completer in the program


Notes

  • Each value within the file for a program is separated by one space.
  • Each program code is on its own line in each file. There are three lines per file.
  • Use an array or arrayList to hold the values within each file.
  • Each semester should be coded within their own class.


Calculations

The following values must be calculated:

For each semester:
   - the percentage of students completers (total number of student completers / total number of students enrolled)

For each individual program code:
   - grand totals for each category (enrolled, completers, gender, and ethnicity)

Aggregate for all semesters:

   - the total number of students enrolled
   - the total number of student completers
   - the total number by gender
   - the total number by each ethnicity
   - the percentage of student completers (total completers / total enrolled)
   - the percentage of female completers (total number of female completers / total number of female enrolled)
   - the percentage of male completers
   - the percentage of each ethnicity


Output


The output for this project will be two-fold.   The output will be displayed in a Message dialog box and an output file.

The Message Dialog boxes:

Each percentage calculated should be displayed in percentage format with one decimal place.

A sample format (the values are not accurate, this is only for formatting purposes):

Santa Fe College
Academic Year 2019 - 2020
Program codes: 3624, 5651, and 6635

Aggregate total number of student enrolled:       5555
Aggregate total number of student completers: 4444

Aggregate percentage of students completing for the academic year: 81.2%

Percentage of students completing Fall 2019:             76.9%
Percentage of students completing Spring 2020:        85.3%
Percentage of students completing Summer 2020:     84.1%

On the next dialog screen, display the following:

Santa Fe College
Academic Year 2019 - 2020
Program codes: 3624, 5651, and 6635

Aggregate values for:

Female student completers:     88.8%
Male student completers:                        88.7%
Unknown/not reported completers:    89.1%

Asian completers:    90.1%
Black completers:                                        90.2%
Hispanic completers:                                 90.3%
Multiracial completers:                             90.4%
Native American completers:      90.5%
Native Hawaiian completers:                  90.6%
Unknown/Not Reported completers:   90.7%
White completers:                                       90.8%

Fall2019Analytics.txt: 3624 3729 2946 1774 1445 510 1442 1087 417 627 1021 939 216 47 15 122 742 572 977 735 181 39 11 84 3475651 4074 3585 1956 1977 141 1782 1731 72 413 927 893 314 56 37 395 1039 387 912 803 273 49 30 327 8046635 2116 1837 609 1058 449 582 1031 224 341 402 363 146 89 74 297 404 303 377 321 113 76 57 270 320

Spring2020Analytics.txt: 3624 3496 3102 1579 1238 679 1486 1017 599 703 1137 842 224 32 21 103 434 688 1007 774 221 30 21 101 2605651 3942 3711 1421 2213 308 2148 1349 214 443 739 804 310 46 37 173 1390 439 727 799 216 46 36 162 12866635 2101 1979 797 1273 31 752 1039 188 601 739 426 173 21 15 3 123 592 701 399 162 18 13 2 92

Summer2020Analytics.txt: 3624 2021 1983 771 1137 113 717 1083 183 307 526 601 211 27 4 13 332 297 506 600 208 26 4 13 3295651 3013 2883 1267 1393 353 1240 1297 346 226 402 373 102 16 13 17 1864 214 401 369 96 15 13 17 17586635 1731 1546 663 817 251 612 799 135 107 392 649 81 30 21 71 380 103 384 621 80 30 20 70 238

Solutions

Expert Solution

ANSWER :

Let's see the answer :-

Java code for calculating percentage

import java.util.Scanner;
public class Percentage {
   public static void main(String args[]){
      float percentage;
      float total_marks;
      float scored;
      Scanner sc = new Scanner(System.in);
      System.out.println("Enter your marks ::");
      scored = sc.nextFloat();

      System.out.println("Enter total marks ::");
      total_marks = sc.nextFloat();

      percentage = (float)((scored / total_marks) * 100);
      System.out.println("Percentage ::"+ percentage);
   }
}

Java program for finding total average and percentage of 5 subjects

import java.util.Scanner;

public class Totalof5subjects1 {
        private static Scanner sc;
        public static void main(String[] args) 
        {
                int english, chemistry, computers, physics, maths; 
            float total, Percentage, Average;
                sc = new Scanner(System.in);
                
                System.out.print(" Please Enter the Five Subjects Marks : ");
                english = sc.nextInt(); 
                chemistry = sc.nextInt();       
                computers = sc.nextInt();       
                physics = sc.nextInt(); 
                maths = sc.nextInt();   
                
                total = english + chemistry + computers + physics + maths;
                Average = total / 5;
            Percentage = (total / 500) * 100;
            
            System.out.println(" Total Marks =  " + total);
            System.out.println(" Average Marks =  " + Average);
            System.out.println(" Marks Percentage =  " + Percentage);
        }
}

Java program for semester wise percentage

import java.util.Scanner;

class CGPA {

    public static double CgpaCalc(double[] marks, int n)

    {

        // Variable to store the grades in

        // every subject

        double grade[] = new double[n];

        // Variables to store CGPA and the

        // sum of all the grades

        double cgpa, sum = 0;

        // Computing the grades

        for (int i = 0; i < n; i++) {

            grade[i] = (marks[i] / 10);

        }

        // Computing the sum of grades

        for (int i = 0; i < n; i++) {

            sum += grade[i];

        }

        // Computing the CGPA

        cgpa = sum / n;

        return cgpa;

    }

    // Driver code

    public static void main(String args[])

    {

        int n = 5;

        double[] marks

            = { 90, 80, 70, 80, 90 };

        double cgpa = CgpaCalc(marks, n);

        System.out.println(

            "CGPA = " + cgpa);

        System.out.println(

            "CGPA Percentage = "

            + String.format("%.2f", cgpa * 9.5));

    }

}

( PLEASE VOTE FOR THIS ANSWER )

I THINK IT WILL BE USEFULL TO YOU ........

THANK YOU .............


Related Solutions

Program: Java Write a Java program using good programming principles that will aggregate the values from...
Program: Java Write a Java program using good programming principles that will aggregate the values from several input files to calculate relevant percentages and write the values to an output file. You have been tasked with reading in values from multiple files that contains different pieces of information by semester. The Department of Education (DOE) would like the aggregate values of performance and demographic information by academic year. A school year begins at the fall semester and concludes at the...
Program: Java Write a Java program using good programming principles that will aggregate the values from...
Program: Java Write a Java program using good programming principles that will aggregate the values from several input files to calculate relevant percentages and write the values to an output file. You have been tasked with reading in values from multiple files that contains different pieces of information by semester.    The Department of Education (DOE) would like the aggregate values of performance and demographic information by academic year. A school year begins at the fall semester and concludes at the...
Program: Java Write a Java program using good programming principles that will aggregate the values from...
Program: Java Write a Java program using good programming principles that will aggregate the values from several input files to calculate relevant percentages and write the values to an output file. You have been tasked with reading in values from multiple files that contains different pieces of information by semester. The Department of Education (DOE) would like the aggregate values of performance and demographic information by academic year. A school year begins at the fall semester and concludes at the...
In this programming assignment, you are asked to write a multi-threaded program using JAVA to compute...
In this programming assignment, you are asked to write a multi-threaded program using JAVA to compute the sum of an arithmetic series from 1 to 200 using pthreads.   The main thread is responsible for creating two child threads The first child thread should compute the partial sum of the series from 1 to 100 and the second computes the partial sum of another series from 101 to 200. The main thread should accumulate the partial sums computed by the child...
Java Programming Write a program that displays the following pattern *                         *       &nbsp
Java Programming Write a program that displays the following pattern *                         *          *          * *          *          *          *          *          *          *          *          *          *          *          *             *          *          *          *          *                         *          *          *                                     * Printing Pattern A * ** *** **** ***** ****** ******* Printing Pattern B ******* ****** ***** **** *** ** * Printing Pattern C * ** *** **** ***** ****** *******
Write a Java program that takes an array of 10 "Int" values from the user and...
Write a Java program that takes an array of 10 "Int" values from the user and determines if all the values are distinct or not. Return TRUE if all the values of the array are distinct and FALSE if otherwise.
Using the object-oriented programming principles, write a currency exchange converter in Java. You should also use...
Using the object-oriented programming principles, write a currency exchange converter in Java. You should also use 3 different classes it could be currency1 and currency2 and currencytest, and set() and get() method and tostring() method. A person will be presented with 3 currencies (i.e., USD, AED, MYR) that they can convert to/from AED Dirham. The program will allow the user to input the amount of Dirham or other currency to be converted. The Money changer will take AED50 commission if...
***Please answer the question using the JAVA programming language. Write a program that calculates mileage reimbursement...
***Please answer the question using the JAVA programming language. Write a program that calculates mileage reimbursement for a salesperson at a rate of $0.35 per mile. Your program should interact (ask the user to enter the data) with the user in this manner: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer reading > 13505.2 Enter ending odometer reading > 13810.6 You traveled 305.4 miles. At $0.35 per mile, your reimbursement is $106.89. ** Extra credit 6 points: Format the answer (2 points),...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user to enter the name of the month he/she was born in (example: September). b) Prompt the user to enter his/her weight in pounds (example: 145.75). c) Prompt the user to enter his/her height in feet (example: 6.5). d) Display (print) a line of message on the screen that reads as follows: You were born in the month of September and weigh 145.75 lbs. and...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user to enter a six-digit integer. b) Take the integer and break it up into two pieces of three-digits each (make sure you keep the order of digits). c) Display each 3-digit piece on a separate line with a proper message before each piece. For example, if the user enters  450835 as the integer, then the program should display the following output: Right 3-digit piece: 835...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT