Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java. For java intro. Please after you write the code, run the code and take a screenshot of the code. I need the output

In java. For java intro. Please after you write the code, run the code and take a screenshot of the code. I need the output too.
image text in transcribed
Your Java program will be reading input from a file name strInput.txt. Each record contains String firstname String lastName String strSalary (which will be converted to a double if it's valid- see below) char status String cityState (city and state and combine together but separated by a comma) Sample input: Ira Rudowsky 87654.32 F Brooklyn.NY Jane Doe 987609.87 F NY NY Mickey Mantle 345678.30 D Orlando FL Fran Young 10456A.82 G Boston MA Richard Clark 67890.32 D Serena liams 1295609.87 D Denver, CO Read from the file one record at a time and process as follows: 1. Any record whose status code is neither D or F should be written to the screen indicating the error. The next record should be read in 2. If the status code is D or F, validate the salary that it contains only digits and one decimal point 3 positions from the right (indicating cents) a. If the salary is invalid, print the entire record to the screen, indicating the error (char at position x is not a digit or period is missing or period is in the wrong position) b. If the salary is valid, convert it to a double c. If the status code is D, compute the bonus (double) as 12.5% of salary and 18% if the status code is F 3. Separate the cityState into two individual Strings named city and state. Use the comma to extract the city portion before the comma and the state after the comma 4. Each record that has a status of D should be written to a file named strOutputD and those record with status of F should be written to a file named strOutputRE. a. For both files, each record printed should include firstName, lastName, status, salary, bonus, city and state 5. When all records have been read in, print to the screen the number of D, F and incorrect records processed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to Figure 3.6, page

Answered: 1 week ago