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, 03.07.2019 23:20
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
question
Engineering, 04.07.2019 18:10
Aplate clutch has a single pair of mating friction surfaces 250-mm od by 175-mm id. the mean value of the coefficient of friction is 0.30, and the actuating force is 4 kn. a) find the maximum pressure and the torque capacity using the uniform-wear model. b) find the maximum pressure and the torque capacity using the uniform-pressure model.
Answers: 3
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:10
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
You know the right answer?
Your java program will be reading input from a file name strinput. txt. each record contains string...
Questions
question
Biology, 16.12.2020 20:00
question
Biology, 16.12.2020 20:00
question
Mathematics, 16.12.2020 20:00
question
French, 16.12.2020 20:00
question
Mathematics, 16.12.2020 20:00
Questions on the website: 13722367