1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
yaroslaw [1]
3 years ago
12

Create an application named StudentsStanding.java that allows you to enter student data that consists of an ID number, first nam

e, last name, and grade point average. Have the program accept input until ZZZ is entered for the ID number. Depending on whether the student’s grade point average is at least 2.0, output each record either to a file of students in good standing or those on academic probation. Create an application named StudentsStanding2.java that displays each record in the two files created in the StudentsStanding application. Display a heading to introduce the list produced from each file. For each record, display the ID number, first name, last name, grade point average, and the amount by which the grade point average exceeds or falls short of the 2.0 cutoff.
Computers and Technology
1 answer:
Artemon [7]3 years ago
8 0

Answer:

Answers can be found below

Explanation:

import java.io.*;

import java.util.Locale;

import java.util.Scanner;

public class StudentStanding {

      public static void main(String[] args) throws IOException {

            BufferedReader bufferedReader = new BufferedReader(new

InputStreamReader(System.in));

Scanner scanner = new Scanner(System.in).useLocale(Locale.US);

            boolean isWorking = true;

            while (isWorking) {

                    System.out.print("ID: ");

                    int id = scanner.nextInt();

                    System.out.print("First name: ");

                    String firstName = bufferedReader.readLine();

                    System.out.print("Last name: ");

                    String lastName = bufferedReader.readLine();

                    System.out.print("Grade point average: ");

                    double gradePointAverage = scanner.nextDouble();

                    System.out.println("Student " + firstName + " " + lastName +

                         " with ID " + id + " have " + gradePointAverage + " grade

point average.");

                    if (gradePointAverage >= 2.0) {

                       BufferedWriter out = new BufferedWriter(new

FileWriter("D:\\GoodStanding.txt", true));

                        out.write("ID: " + Integer.toString(id));

                        out.newLine();

                        out.write("First name: " + firstName);

                        out.newLine();

                        out.write("Last name: " + lastName);

                        out.newLine();

                        out.write("Grade point average: " +

Double.toString(gradePointAverage));

                         out.newLine();

                         out.newLine();

                         out.close();

                         System.out.println(firstName + " " + lastName + " have grade

point average > 2.0");

                         System.out.println("This student was saved to

GoodStanding.txt");

} else {

BufferedWriter out = new BufferedWriter(new

FileWriter("D:\\AcademicProbation.txt", true));

out.write("ID: " + Integer.toString(id));

out.newLine();

out.write("First name: " + firstName);

out.newLine();

out.write("Last name: " + lastName);

out.newLine();

out.write("Grade point average: " +

Double.toString(gradePointAverage));

out.newLine();

out.newLine();

out.close();

System.out.println(firstName + " " + lastName + " have grade

point average < 2.0");

                    System.out.println("This student was saved to

AcademicProbation.txt");

          }

           System.out.println("Continue? y ­ yes, n ­ no.");

           System.out.print("Answer: ");

           String answer = bufferedReader.readLine();

           if (answer.equals("y")) {

System.out.println("");

} else if (answer.equals("n")) {

scanner.close();

isWorking = false;

                         }

                     }

                System.out.println("Finished");

       }

}

You might be interested in
Definition of laptop
zaharov [31]
A device that sucks bc mien broke
7 0
3 years ago
Read 2 more answers
Helen is filling her persönal details on her résumé. Which detail should she include in this section?
svetoff [14.1K]

I would think option A.

b doesn't give enough information and c would go under last work experience

4 0
3 years ago
JAVVVAAAAAA HELPPPP EDHESIVE ​
Mekhanik [1.2K]

Answer:

Here's some really bad code that works:

public static double average(int a, int b, int c, int d, int e)

{

return (((double)a + b + c + d + e) / 5);

}

5 0
3 years ago
Recent trends on operating system
katovenus [111]

Answer:

Windows 10 if this is what I think u mean

7 0
3 years ago
All of these (except the ______) go unnoticed by the computer
astra-53 [7]
VIRUS I SERIOUSLY DONT KNOW THOUGH

5 0
3 years ago
Other questions:
  • Joaquin is considering a career as an animator and wants to know more about the daily work of an average animator. Which strateg
    11·1 answer
  • Which player type focuses on level progression?
    13·1 answer
  • If you were going to construct a table that only included shape names with number prefixes, which shape would you include
    11·1 answer
  • The software used to help run the computer hardware is the _____.
    9·2 answers
  • Someone learn me more American Sign Language (ASL). Please.
    13·1 answer
  • Imagine that you have access to a class named MyCircle that has void setRadius(double r) and double getRadius() methods. Write a
    14·1 answer
  • A deluxe meal, represented by a DeluxeMeal object, includes a side dish and a drink for an additional cost of $3. The DeluxeMeal
    14·1 answer
  • Dora has inserted a text box into a Word document that she is formatting. Which strategy will not format text boxes? Create a li
    6·2 answers
  • Which memory can be removed from motherboard? RAM OR ROM?​
    7·1 answer
  • Submit your business presentation that clearly compares and contrasts three different cell phone service plans. I have TO HAVE I
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!