Java Programming
Java Programming
9th Edition
ISBN: 9780357238530
Author: Joyce Farrell
Publisher: Cengage Limited
bartleby

Videos

Question
Book Icon
Chapter 13, Problem 8PE

a.

Program Plan Intro

Student progression

Program plan:

  • Import necessary packages and create a class “StudentsStanding”,
    • Define the method “main()”,
      • Create “Scanner” object.
      • Get both the file paths.
      • Initialize required string and final variables.
      • Set the cutoff value for grade point average.
      • Execute “try” statement,
        • Create output stream object.
        • Create object for “BufferedWriter”.
        • Create another output stream object.
        • Create another object for “BufferedWriter”.
        • Prompt the user to enter student id.
        • Get the student id from the user.
        • Execute “while” loop till the string is equal to “zzz”,
          • Prompt the user to enter first name.
          • Get the first name from the user.
          • Prompt the user to enter last name.
          • Get the last name from the user.
          • Prompt the user to enter grade point average.
          • Get the grade point average from the user.
          • Concatenate the resultant string.
          • Check if gpa is less than cutoff value,
            • Write the data into the corresponding file.
          • Otherwise,
            • Write the data into another file.
          • Prompt the user to enter the input.
          • Get the input from the user.
        • Close both the files.
      • Catch if exception occurs,
        • Handle the exception.

b.

Program Plan Intro

Printing the details of student progression

Program plan:

  • Import necessary packages and create a class “StudentsStanding2”,
    • Define the method “main()”,
      • Get both the file paths.
      • Initialize required string variable.
      • Execute “try” statement,
        • Create input stream object.
        • Create object for “BufferedReader”.
        • Create another input stream object.
        • Create another object for “BufferedReader”.
        • Print heading.
        • Read line from a file.
        • Execute till there are records,
          • Call the method “display()”.
          • Read next line from a file.
        • Print another heading.
        • Read line from another file.
        • Execute till there are records,
          • Call the method “display()”.
          • Read next line from a file.
        • Close both the files.
      • Catch if exception occurs,
        • Handle the exception.
    • Define the method “display()”,
      • Create string array.
      • Declare necessary variables.
      • Set the cutoff value.
      • Split the values using the delimiter “,”.
      • Assign the value for string id.
      • Assign the value for first name.
      • Assign the value for last name.
      • Assign the value for gpa.
      • Print the resultant string to the console.

Blurred answer
Students have asked these similar questions
Pllleasassseee ssiiirrrr soolveee thissssss questionnnnnnn
Pllleasassseee ssiiirrrr soolveee thissssss questionnnnnnn
Pllleasassseee ssiiirrrr soolveee thissssss questionnnnnnn
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License