Question

Create an application that allows you to enter student data that consists of an ID number,...

Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. 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 (located at StudentsGoodStanding.txt) or those on academic probation (located at StudentsAcademicProbation.txt).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

output

//StudentsGoodStanding.txt

//StudentAcademicProbation.txt

//copyable code

// Students_Standing.java

import java.io.File;

import java.io.FileWriter;

import java.io.IOException;

public class Students_Standing {

   //main method

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

        //input from the user

        java.util.Scanner Sca = new java.util.Scanner(System.in);

        File GoodstandFile=new File("StudentsGoodStanding.txt");

        File ProbationFile=new File("StudentAcademicProbation.txt");

        FileWriter fpvalue1 = new FileWriter(GoodstandFile);

        FileWriter fpvalue2 = new FileWriter(ProbationFile);

        String NameFirst;

        String NameLast;

        int Student_ID;

        double Grade_Average;

        String temp_Str1 = "", temp_Str2 = "";

        while(true){

        System.out.println("Enter the student ID: ");

        Student_ID = Sca.nextInt();

        System.out.println("Enter the First Name: ");

        NameFirst = Sca.next();

        System.out.println("Enter the Last Name: ");

        NameLast = Sca.next();

        System.out.println("Enter the Grade average: ");

        Grade_Average = Sca.nextDouble();

        if(Grade_Average >= 2.0){

        temp_Str1 = temp_Str1 + Student_ID +"\t"+NameFirst+"\t"+NameLast+"\t"+Grade_Average+"\n";

        }

        else{

        temp_Str2 = temp_Str2 + Student_ID +"\t"+NameFirst+"\t"+NameLast+"\t"+Grade_Average+"\n";

        }

        System.out.println("Enter q to exit OR press any key to continue");

        char Choice = Sca.next().charAt(0);

        if(Choice == 'q' || Choice == 'Q'){

            fpvalue1.write(temp_Str1);

            fpvalue1.flush();

            fpvalue1.close();

            fpvalue2.write(temp_Str2);

            fpvalue2.flush();

            fpvalue2.close();           

            System.out.println("Data stored in File");

            break;

        }

        }

   }

}

Add a comment
Know the answer?
Add Answer to:
Create an application that allows you to enter student data that consists of an ID number,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create an application that allows you to enter student data that consists of an ID number,...

    Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. 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 (located at StudentsGoodStanding.txt) or those on academic probation (located at StudentsAcademicProbation.txt). Enter ZZZ to Quit. This is in Java

  • Create a class named Student, where each Student consists of a student id (a number between...

    Create a class named Student, where each Student consists of a student id (a number between 0 and 99999), grade level (1-12), and a full name. Include set and get methods for all fields. Save this as Student.java. Then, write an application that declares a Student object and prompts the user for the three required pieces of information, one at a time. For student id, keep prompting until the user enters a valid number (0-99999). Likewise, keep prompting for a...

  • Java - In NetBeans IDE: • Create a class called Student which stores: - the name...

    Java - In NetBeans IDE: • Create a class called Student which stores: - the name of the student - the grade of the student • Write a main method that asks the user for the name of the input file and the name of the output file. Main should open the input file for reading . It should read in the first and last name of each student into the Student’s name field. It should read the grade into...

  • Shell Programming USA College wants you to create a simple application. The program will enter the...

    Shell Programming USA College wants you to create a simple application. The program will enter the student name, student id, Student Level, Enter the marks for four (4) courses. Calculate the total marks and the SGPA. If the SGPA less than 2.0 then students will enter into probation.display the appropriate output.

  • Language: C++ Write a program that will allow the instructor to enter the student's names, student...

    Language: C++ Write a program that will allow the instructor to enter the student's names, student ID, and their scores on the various exams and projects. A class has a number of students during a semester. Those students take 4 quizzes, one midterm, and one final project. All quizzes weights add up to 40% of the overall grade. The midterm exam is 25% while the final project 35%. The program will issue a report. The report will show individual grades...

  • Must be written in JAVA Code Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written...

    Must be written in JAVA Code Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). The following shows part of a typical...

  • Graded Exercise Create a class named Student. A Student has fields for an ID number, number...

    Graded Exercise Create a class named Student. A Student has fields for an ID number, number of credit hours earned, and number of points earned. (For example, many schools compute grade point averages based on a scale of 4, so a three-credit-hour class in which a student earns an A is worth 12 points.) Include methods to assign values to all fields. A Student also has a field for grade point average. Include a method to compute the grade point...

  • In python, Implement a function studentID() which allows the user to enter the 7-digit student ID....

    In python, Implement a function studentID() which allows the user to enter the 7-digit student ID. The program will keep prompting the user for a last name and first name. If the student does not have a student ID on record, the program will then ask for the student ID, and store that information. If the student already has a student ID, the program will display it, and ask for confirmation whether a new studentID should be assigned (and, if...

  • We will build one Python application via which users can perform various analytics tasks on data...

    We will build one Python application via which users can perform various analytics tasks on data in 2-D table (similar to Spreadsheet) format which looks like: Column Name 1 Column Name 2 Column Name 3 Column Name N … … … … … In this table, each row represents the data of one object that we are interested in. Columns, on the other hand, represent the attributes of these objects. For example, this table could represent students’ academic records. Each...

  • you must implement public class Student by following the instructions as follows exactly. You may reference...

    you must implement public class Student by following the instructions as follows exactly. You may reference Chapter 7 for the similar examples to get the ideas and concepts. Each student must have the following 5 attributes (i.e., instance variables): private String   studentID ;              // student’s ID such as                         1 private String lastName   ;                         // student’s last name such as              Doe private String firstName ;             // student’s first name such as            John private double gpa...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT