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

Please help Write a Java program that will display the following output: Program

ID: 3549213 • Letter: P

Question

Please help

Write a Java program that will display the following output: Program Specifications: You are responsible for choosing to the variables (programmer-defined identifiers) The order in which you gather your input from the user is not important. Calculations Calculate age based off this year's date Semester GPA is based off the point system given for each grade and the number of courses. A is 4 points, B is 3 points, C is 2 points, D is 1 point, and F is 0 points Overall GPA is the average of semester GPA and current GPA Formatting The dotted line as well as the information between those lines should have a similar fomat as far as spacing and position. Note: The number of dots in the line is not important, so let's say about 50. Note The data in the output box is interactive, meaning that the data can differ based on what the user inputs. So, you program should not run as a static program, generating the same output regardless of what the user inputs.

Explanation / Answer

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class main{
    public static void main(String[] args) throws IOException{
        String name;
        int year;
        int age;
        String sex;
        String major;
        float gpa;
        float a_num,b_num,c_num,d_num,f_num;
        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        System.out.println("Enter your name:");
        name=in.readLine();
       
        System.out.println("Enter the year you were born:");
        year=Integer.parseInt(in.readLine());
        age=year-2016;
       
        System.out.println("Enter you sex:");
        sex=in.readLine();
       
        System.out.println("Enter your major:");
        major=in.readLine();
       
        System.out.println("Enter your current GPA:");
        gpa=Float.parseFloat(in.readLine());
       
        System.out.println("Enter how many A(s) you earned this semester:");
        a_num=Integer.parseInt(in.readLine());
       
        System.out.println("Enter how many B(s) you earned this semester:");
        b_num=Integer.parseInt(in.readLine());
       
        System.out.println("Enter how many C(s) you earned this semester:");
        c_num=Integer.parseInt(in.readLine());
       
        System.out.println("Enter how many D(s) you earned this semester:");
        d_num=Integer.parseInt(in.readLine());
       
        System.out.println("Enter how many F(s) you earned this semester:");
        f_num=Integer.parseInt(in.readLine());
       
        float sem_gpa=((a_num*4)+(b_num*3)+(c_num*2)+(d_num*1))/(a_num+b_num+c_num+d_num+f_num);
        float overall_gpa=(sem_gpa+gpa)/2;
        System.out.println("...........................");
        System.out.println("Name:   "+name);
        System.out.println("Sex:   "+sex);
        System.out.println("Age:   "+age);
        System.out.println("Major:   "+major);
        System.out.println("Overall GPA:   "+overall_gpa);
        System.out.println("Semester GPA:   "+sem_gpa);

        System.out.println("...........................");
    }
}