Question: need EXPERT help in java with binary files Question: Ask the user for an account balance. Show, in descending order, all the accounts that have

need EXPERT help in java with binary files

Question:

Ask the user for an account balance. Show, in descending order, all the accounts that have a balance greater than what the user input.

Each entry is int, string, long, double, boolean (name length, name, credit card number, balance, cashback).

I need to display this exact required outputs but am having trouble with accessing the information of the names, act num, balance, cash back an results from the binary file

Enter a balance 7500ENTER Accounts with a balance of at least $7500.00 (sorted by balance) Name Account Number Balance Cash Back Brand Hallam 3573877643495486 9985.21 No Paco Verty 4508271490627227 9890.51 No Stanislaw Dhenin 4405942746261912 9869.27 No Eachelle Balderstone 30526110612015 9866.30 No Reube Worsnop 3551244602153760 9409.97 Yes Tiphanie Oland 5100172198301454 9315.15 No Jordan Rylstone 201715141501700 9135.90 Yes Anjela Himsworth 3573904891259172 8985.27 Yes Howie Royson 3581572129932389 8965.07 Yes Blinni Mattke 3549214734886202 8960.76 No Dorotea Nolli 6396392530990977 8790.59 Yes Carita Savill 6767642427889745 8738.77 No Mateo Mollene 5100174906912671 8659.35 Yes Cathleen Schurcke 4041598930132416 8596.39 Yes Adriana Bru 3574931681854879 8482.46 Yes Orlando Nutbeem 6372756913380048 8346.07 No Leland Vasilyev 6394213548410265 8249.76 No Ambrosi Fussie 3581429661693202 8207.40 Yes Valentine Montford 3533184590527943 8176.80 Yes Sarette Springell 5100146117467372 8161.69 Yes Rich Yakovl 490337929898976334 8099.58 Yes Conney Sizeland 3588215263928408 8036.12 Yes Lindi Ekins 5602244683247667 7936.01 Yes Alex Fillon 5100138314605151 7919.11 Yes Amble Wasielewski 670994840439201473 7759.66 No Rodney Gyurko 4903385560959694166 7744.36 Yes 26 results

----

Enter a balance 8500ENTER Accounts with a balance of at least $8500.00 (sorted by balance) Name Account Number Balance Cash Back Brand Hallam 3573877643495486 9985.21 No Paco Verty 4508271490627227 9890.51 No Stanislaw Dhenin 4405942746261912 9869.27 No Eachelle Balderstone 30526110612015 9866.30 No Reube Worsnop 3551244602153760 9409.97 Yes Tiphanie Oland 5100172198301454 9315.15 No Jordan Rylstone 201715141501700 9135.90 Yes Anjela Himsworth 3573904891259172 8985.27 Yes Howie Royson 3581572129932389 8965.07 Yes Blinni Mattke 3549214734886202 8960.76 No Dorotea Nolli 6396392530990977 8790.59 Yes Carita Savill 6767642427889745 8738.77 No Mateo Mollene 5100174906912671 8659.35 Yes Cathleen Schurcke 4041598930132416 8596.39 Yes 14 results

-------

I have started my code but need help finishing it to display the required output

here is my code so far

import java.io.*; public class AccountBalance { public static void main(String[] args) { try { FileInputStream basic = new FileInputStream("accounts-with-names.dat"); DataInputStream inputFile = new DataInputStream(basic); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter a balance"); String input = br.readLine(); double minBalance = Double.parseDouble(input); int count = 0; String header = String.format("%20s%20s%15s%10s%n", "Name", "Account Number", "Balance", "Cash Back"); String format = "%20s%20s%15.2f%6s%n"; System.out.printf("Accounts with a balance of at least $%.2f (sorted by balance)%n", minBalance); System.out.print(header);

can an expert help finish my code in order to display the name, account number, balance, cash back and results using int, string, long, double, boolean (name length, name, credit card number, balance, cashback) as per the question,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!