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

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Items are similar to the free issue items, but their access is limited. (clo5) a)-bin stock items free issue b)-bin stock controlled issue c)-critical or insurance spares d)-rebuildable spares e)-consumables
Answers: 1
question
Engineering, 04.07.2019 18:20
Air flows over a heated plate àt a velocity of 50m/s. the local skin factor coefficient at a point on a plate is 0.004. estimate the local heat transfer coefficient at this point.the following property data for air are given: density = 0.88kg/m3 , viscosity 2.286 x 10 ^-5 kgm/s , k = 0.035w/mk ,cp = 1.001kj/kgk. use colburn reynolds analogy.
Answers: 1
question
Engineering, 04.07.2019 19:10
An electric kettle is made out of stainless steel, weighs two pounds (when empty) and is equipped with a heating element that consumes 2 kw of electricity. assuming that the water and the kettle are at the same uniform temperature at any moment of time, calculate the shortest possible time to bring 2 quarts of water from room temperature to the onset of boiling
Answers: 2
question
Engineering, 04.07.2019 19:20
Acircular pipe of 30mm outside diameter is placed in an airstream at 30 c and latm pressure. the air moves in cross flow over the pipe at 20 m/s, while the outer surface of the pipe is maintained at 110 c. what is the drag force exerted on the pipe per unit length? what is the rate of heat transfer from the pipe per unit length?
Answers: 1
You know the right answer?
Your java program will be reading input from a file name strinput. txt. each record contains string...
Questions
question
English, 31.07.2019 21:00
question
Mathematics, 31.07.2019 21:00
Questions on the website: 13722363