subject
Engineering, 14.11.2019 07:31 lyly214

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

ansver
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, bckyanne3
Afull journal bearing has a journal diameter of 27 mm, with a unilateral tolerance of -0.028 mm. the bushing bore has a diameter of 27.028 mm and a unilateral tolerance of 0.04 mm. the l/d ratio is 0.5. the load is 1.3 kn and the journal runs at 1200 rev/min. if the average viscosity is 50 mpa-s, find the minimum film thickness, the power loss, and the side flow for the minimum clearance assembly.
Answers: 1
image
Engineering, 04.07.2019 18:10, Talos02
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
image
Engineering, 04.07.2019 18:10, chadatkin
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
image
Engineering, 04.07.2019 18:20, alexis9263
Have a greater impact on maintenance productivity than any other support group. (clo5) a)-the top management b)-inventory and purchasing c)-sub-contracting d)-cmms
Answers: 2
You know the right answer?
Your java program will be reading input from a file name strinput. txt. each record contains string...

Questions in other subjects:

Konu
Physics, 15.04.2021 14:00
Konu
Biology, 15.04.2021 14:00
Konu
Mathematics, 15.04.2021 14:00