Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is what you do: create a class named MyRecord (MyRecord.java) with the
- variables firstname, lastname, email, idnumber, color and balance. Use the
- appropriate data type for each field.
- public class MyRecord {
- String firstname, lastname, email, color;
- double idnumber, balance;
- }
- MyRecord recarray[] = new MyRecord[ARRAYSIZE];
- //ARRAYSIZE is 10
- String filename = "data.txt";
- File fileobject = new File(filename);
- Scanner input = new Scanner(fileobject);
- for(int i = 0; i <= 5; i++) {
- recarray[i] = input.next();
- }
- Mary, Jane, maryj@gmail.com, 7654321, blue, 27.54
- John, Doe, jd@yahoo.com, 123456, green, 19.24
- Curly, Howard, nyuknyuk@msn.com, 888765, purple, 0.0
- Bart, Simpson, donthaveacow@hotmail.com, 457673, magenta, 432.23
- Clark, Kent, superdude@dailyplanet.com, 976834, red, 11.10
Add Comment
Please, Sign In to add comment