EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
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 :…
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…
Creates a sales receipt, displays the receipt entries and totals,  and saves the receipt entries to a file .Prompt the user to enter the  - Item Name Item Quantity Item Price Display the item name, the quantity, and item price, and the extended price (Item Quantity multiplied by Item Price) after the entry is made Save the item name, quantity, item price, and extended price to a file When you create the file, prompt the user for the name they want to give the file  Separate the items saved with commas Each entry should be on a separate line in the text file Ask the user if they have more items to enter Once the user has finished entering items Close the file with the items entered Display the sales total If the sales total is more than $100 Calculate and display a 10% discount Calculate and display the sales tax using 8% as the sales tax rate The sales tax should be calculated on the sales total after the discount Display the total for the sales receipt

Chapter 13 Solutions

EBK JAVA PROGRAMMING

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