Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please Help. These are literally the last points that i have. If i had more, i w

ID: 3549680 • Letter: P

Question

Please Help. These are literally the last points that i have. If i had more, i would give more.


Programming Challenges Program specifications: Current overall GPA is the average of the current overall GPA and the semester GPA A letter grade of "C" or better is equals a class passed Each class passed equals 3 hours earned Data Object members: Name Gender Age Major Classification GPA Function(s): Read the student information from an input file - (data types, files: input) Output the student information to the monitor - (formatting, output) Calculate the semester GPA - (conditional statements, loops, input/output, input validation) Sample User input: Grades for the semester were Class 1 - A Class 2 - A Class 3 - B Class 4-B Store the student letter grade earned and number of credit hours earned in an array-(arrays)-Not an actual func Write the student information to an output file - (formatting, files: output) Classification requirements (hours) Freshman(0-24) Sophomore(25-48) Junior(49-72) Senior(73-96) Sample Input File: Marcus Golden M 1977 Computer Science 42 3.82 (Note: current overall GPA) Sample Output File: (based on the sample user input) Marcus Golden Male 36 Computer Science Junior 3.66 (Note: current overall GPA)

Explanation / Answer

please rate - thanks



if he had 42 points, and took 4 classes, based on what I can figure he now has 42 + 4 or 46 points, which is a sophmore, not a junior.   I based the age on 2014-birth year, since it's not specific



had a 3.82 GPA with with 42 classes, thats 42*3.82 points = 160.44 pts

now has 46 classes   2 A+2B = 14 pts       160.44+14=170.44

170.44/46=3.79 new GPA not 3.66.

If you can explain to me where those numbers come from I'll make the changes

Did the best I could, with the insufficient information.

Please don't make me feel I wasted my time and rate

Thanks




import java.util.*;
import java.io.*;
public class GPA
{public static void main(String[] args)throws FileNotFoundException
{Scanner in=new Scanner(new File("input.txt"));
Scanner kb=new Scanner(System.in);
String name,major,buffer;
char gender;
int age,currentClass,birth,count,i;
char grade;
double currentGPA,currentPoints;
name=in.nextLine();
gender=in.next().charAt(0);
birth=in.nextInt();
age=2014-birth;
in.nextLine(); //skip enter
major=in.nextLine();
currentClass=in.nextInt();
currentGPA=in.nextDouble();
System.out.println("Data input "+ name);
System.out.println("Gender: "+gender);
System.out.println("Birth Year: "+birth);
System.out.println("Major: "+major);
System.out.println("Classification: "+currentClass);
System.out.println("GPA: "+currentGPA);
System.out.print("How many classes did "+name +" take this semester? ");
count=kb.nextInt();
kb.nextLine();   //skip enter
currentPoints=currentGPA*currentClass;
for(i=0;i<count;i++)
    {System.out.print("enter class "+(i+1)+" name - grade: ");
     buffer=kb.nextLine();
     grade=buffer.charAt(buffer.indexOf('-')+1);
     if(grade<'A'||grade>'F'||grade=='E')
         {System.out.println("grade must be A, B, C, D, or F");
          i--;
          }
      else
         currentPoints+=getPoints(grade);
     }

currentClass+=count;
PrintStream out=new PrintStream(new File("output.txt"));
out.println(name);
if(gender=='M')
    out.println("Male");
else
    out.println("Female");
out.println(age);
out.println(major);
if(currentClass<=24)
     buffer="Freshman";
else if(currentClass<=48)
     buffer="Sophmore";
else if(currentClass<=72)
     buffer="Junior";
else
     buffer="Senior";
out.println(buffer);
out.printf("%.2f ",currentPoints/currentClass);
out.close();
}
public static int getPoints(char grade)
{char g[]={'A','B','C','D'};
int pts[]={4,3,2,1};
int i;
for(i=0;i<g.length;i++)
     if(grade==g[i])
          return pts[i];
return 0;
}

}