PROGRAM_EIGHT

PROGRAM_EIGHT - import java.util.Scanner; import...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: import java.util.Scanner; import java.lang.*; import java.io.*; import java.text.*; import java.math.*; import java.lang.String; import java.text.DecimalFormat; import javax.swing.JOptionPane; import java.io.*; i //Jeremy Debruce / //Professor Campbell / public class PROGRAM_EIGHT p { static int PB=0,PC=0,PD=0,PF=0; s public static void main(String args)throws FileNotFoundException, IOException { int num; System.out.println("*******************************************"); System.out.println("* This program assign letter Grades.*******"); System.out.println("*******************************************"); S System.out.println("*The purpose of the programs is to *"); System.out.println("*Display Table *"); System.out.println("*Display Individual *"); System.out.println("*Sort in multiple ways *"); * System.out.println("*Display Highest AVE. *"); System.out.println("*Display Students In Categories *"); System.out.println("*******************************************"); S do { System.out.println(); System.out.println("\t1.Display Table *"); System.out.println("\t2.Display Individual *"); System.out.println("\t3.Sort By Last Name *"); * System.out.println("\t4.Sort By First Name *"); * System.out.println("\t5.Sort By Max *"); * System.out.println("\t6.Sort By Ave *"); * System.out.println("\t7.Display Highest AVE. *"); * System.out.println("\t8.Display Students In Categories *"); System.out.println("\tPlease Enter 1, 2, 3, 4, 5, 6, 7, 8, or 9 to exit *"); t System.out.println(); S Scanner scan = new Scanner(System.in); num = scan.nextInt(); n switch (num) { case 1: Dis_Table(); break; case 2: Dis_Ind(); break; case 3: Sort_L(); break; case 4: Sort_F(); break; case 5: Sort_M(); break; case 6: Sort_AVE(); break; case 7: High_Ave(); break; case 8: Category(); break; case 9: System.out.println("Thank You for using this program!"); break; default: System.out.println("Please follow directions \n" +" Only 1, 2, 3, 4, 5, 6, 7, 8, and 9 to quit."); break; } }while (num !=9); } } public static void Dis_Table()throws FileNotFoundException, IOException { //Table System.out.println("*************************************************************** *******"); System.out.println("LNAME FNAME SS# GRADES AVG MIN MAX*"); System.out.println("*************************************************************** *******"); * //Declare Variables char letter; String ss; String name; String name2; S int a,b,c,d,e,f,Avg,min,max,Avg1; int A=0, B=0, C=0, D=0, F=0; int G1,G2,G3,G4,G5,G6; i //data file scanner Scanner inFile= new Scanner(new FileReader("g:\\people.txt")); //loop for (int i=1;i<21;i++) { // data info ss = inFile.next(); name = inFile.next(); name2 = inFile.next(); a = inFile.nextInt(); b = inFile.nextInt(); c = inFile.nextInt(); d = inFile.nextInt(); e = inFile.nextInt(); f = inFile.nextInt(); //formula Avg = (a+b+c+d+e+f)/6; Avg1 = Avg/10; A switch (Avg) { case 10: { letter = 'A'; A = A+1; } break; case 9: { letter = 'A'; A = A+1; } break; case 8: { letter = 'B'; B = B+1;...
View Full Document

Page1 / 23

PROGRAM_EIGHT - import java.util.Scanner; import...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online