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

1.PROGRAMMING CODE FOR JAVA TO CALCULATE PERCENTAGES:

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);
   }
}

OUTPUT:

Enter your marks ::
500
Enter total marks ::
600
Percentage ::83.33333

CODE2:

// Java program to find Total Average and percentage of Five 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);
        }
}

3. PROGRAMMING CODE FOR SEMESTER WISE PRCENTAGES:

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));

    }

}

HENCE I HAVE SOLVED ALL THE PROGRAMMING CODE WITH THE HEPL OF JAVA LANGUAGE TO CALCULATE THE PERCENTAGES THAT A STUDENT HAS GAINED AND ON THE BASIS OF THAT GRADES ARE ALSO SHOWN.DIFFRENTS METHODS IN JAVA I HAVE PUBLISHED FROM THE BEGINNERS TO GAIN KNOWLEDGE ABOUT THA BASICS OF JAVA AND HOW TO CALCULATE SEMESTER WISE PERCENTAGES IN JAVA.HOPE YOU LIKE IT AND ENJOY MY CODES.GOOD LUCK BUDDIES.ALL THE BEST..


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...
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.
***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...
Programming in C++ Write a program that prints the values in an array and the addresses...
Programming in C++ Write a program that prints the values in an array and the addresses of the array’s elements using four different techniques, as follows: Array index notation using array name Pointer/offset notation using array name Array index notation using a pointer Pointer/offset notation using a pointer Learning Objectives In this assignment, you will: Use functions with array and pointer arguments Use indexing and offset notations to access arrays Requirements Your code must use these eight functions, using these...
This is an exercise to design and write a Python program in good programming style for...
This is an exercise to design and write a Python program in good programming style for a simulation of stock price over a period of 100 days. In this exercise, you are asked to simulate the stock price starting at $100.00 for 100 days with a daily fluctuation based on the Normal Distribution with mean = 0.0 & sigma = 0.0125. The program will show the daily stock price, the 7-day minimum, the 7-day maximum, the 7-day average, and the...
JAVA PROGRAM Write program that will prompt user generate two random integers with values from 1...
JAVA PROGRAM Write program that will prompt user generate two random integers with values from 1 to 10 then subtract the second integer from the first integer. Note, if the second integer is greater than the first integer, swap the two integers before making the subtraction.Then prompt user for the answer after the subtraction. If the answer is correct, display “Correct”otherwise display “Wrong”.You will need to do this in a loop FIVE times and keep a count of how many...
Java programming Write the max-heapify code and test it and then write the program to find...
Java programming Write the max-heapify code and test it and then write the program to find the three largest values of the array without sorting the entire array to get values.
THIS IS JAVA PROGRAMMING Guessing the Capitals. Write a program Lab5.java that repeatedly prompts the user...
THIS IS JAVA PROGRAMMING Guessing the Capitals. Write a program Lab5.java that repeatedly prompts the user to enter a capital for a state (by getting a state/capital pair via the StateCapitals class. Upon receiving the user’s input, the program reports whether the answer is correct. The program should randomly select 10 out of the 50 states. Modify your program so that it is guaranteed your program never asks the same state within one round of 10 guesses.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT