Java Programming, Loose-Leaf Version
Java Programming, Loose-Leaf Version
9th Edition
ISBN: 9781337685900
Author: FARRELL, Joyce
Publisher: Cengage Learning
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
Using Java, Write an interactive console application for an employee management service. The user can enter the following options for the apps 1-List all employees, sorted by Name. 2-Hire a new employee (add to list) 3-show the lowest salary and highest salary and average of the salaries 0-exit - At the beginning of the application, data will be read from a text file. - And at the end of it when user chooses 0, data will be saved to the same file. - The date format needs to be YYYY-MM-DD and The fields needs to be separated by semicolon(;) Example of data in the text file : Alice P.;2012-09-22;Shoes;40 Emma W.;2016-07-07;Furniture;30 Eva;2021-08-08;Pizza;50 EmployeeSchedule class has the following attributes private String name; private String department; private Date dateHired; private double hourSalary; name : between 2-50 characters and not permitted to have ;^?@!~* department : between 2-50 characters and not permitted to have ;^?@!~* dateHired : between 1900 and 2100 salary :…
Files Assignment #2 Based on what you took thus far in this chapter, your boss(me) needs you to create an application that will that accept a student’s 2019 Spring schedule thru input.  Name the file XXXM7HW2 where XXX is your last name. You will need to get the student’s course number, course name, days it meets and times it will meet. Once you get this information, you will need to write the information to a text file called schedule.txt and also create a student schedule report called report.txt. You can ask the user what to call the file or just name the files within the program. You will need to create a menu that can be ran more than once. Below is an example of a menu you can use: File Assignments Menu Create Schedule File Create Report File Exit Please enter your choice:   Example of a schedule file ( notice class info is stored as a record containing three fields ( class name, class number, meeting days and meeting time) with each field on a separate line : CIS 115 mw 10-12…
Create a file in your project named employees.txt with the following data (you can simply create the file by hand rather than with Python code): 123 Bob Smith345 Anne Jones256 Carol Lee845 Steve Robert Anderson132 Jill Thompson From your program's main function, give the user the following options: lookup a name based on ID number, lookup an ID number based on name, and quit the program. OPTION 1: The user chooses to lookup a name based on ID number: Use a try/except and ask the user to enter an integer. If they don't enter an integer, print an error message. If they do enter an integer, call a function named lookup_employee which takes the id as a parameter. If an employee with the given id number is found, return the name. Otherwise, return the string “Employee not found” Back in main, print the return result. OPTION 2: The user chooses to lookup an ID based on name: Ask the user to enter the first and last name (don't ask for the middle name).  Call a function named…

Chapter 13 Solutions

Java Programming, Loose-Leaf Version

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
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,
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