Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program 1 : Program 2 : Reading / Writing multiple data types Read employee names from given file ( employees . txt ) , for
Program : Program :
Reading Writing multiple data types
Read employee names from given file employeestxt for each employee generate random numbers of:
Hours
Rate
Calculate Gross Pay hours rate
The output to console looks as follows:
Copy the employees.txt file to your Eclipse workspace. The directory name looks like:
yournameeclipseworkspaceInputoutput Program :
Must Compile or Zero points
incorrect results lose points
Do not turn in code that does not compile
Do not turn in code that has not been tested
All variable declarations are at the top and followed by a blank line
All output must be aligned as shown above
All files must have correct data type written to it
Error handling must be done for all file access operations
File name that is being used must printed
Program :
Must Compile or Zero points
incorrect results lose points
Do not turn in code that does not compile
Do not turn in code that has not been tested
All variable declarations are at the top and followed by a blank line
All output must be aligned as shown above
Must read and print all names from file
Must calculate Gross Pay correctly for each name in file
Use doubles not floats
All double values are rounded to decimal places
Reading Writing multiple data types
Write files each with lines of different data types.
Integers
Write a series of random integers to a file "integers.txt
Read those integers from the file
Doubles
Write a series of random doubles to a file "doubles.txt
Read those doubles from the file
Strings
Write a series of random strings to a file "strings.txt
Read those strings from the file
For each of the data types and their specified file:
Open the file for writing
Write lines of the respective data type
Close the file
Open the file for reading
Read all lines from the file and print them to the console
Print the file name that is being opened and closed
Use the following to create a random string:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started