9:53 774 1. Create a Tombstone class that has instance variables to store a person's name, burialDate, age (as an int, more info to follow), and address, as well as applicable constructor and getter methods. 2. Open the Cemetery class. Create one instance variable, an ArrayList of Tombstone objects. The Cemetery's constructor should have a parameter String fileName, which represents a text file containing the information on the interred for this cemetery. Don't forget to initialize the PIV as a new ArrayList. The Cemetery constructor will parse the information in the text file to create and store Tombstone objects. Each line in the file represents one Tombstone object. a. Use a Scanner object to scan in the entire input file. Use another Scanner object to get a single line (use hasNextLine() and nextLine()) from the input file at a time, until the end of the file. Be careful when parsing each line! As you can see from the data above, a person can have two or three names - it is suggested that you use Scanner's next () method until the input source has a next integer (the day at the beginning of the burial date) to parse the names. b. This constructor will be parsing the name, burial date, age and address of each person in the file. A method parseÃge (String ageString) 9:53 774 2. Open the Cemetery class. Create one instance variable, an ArrayList of Tombstone objects. The Cemetery's constructor should have a parameter String fileName, which represents a text file containing the information on the interred for this cemetery. Don't forget to initialize the PIV as a new ArrayList. The Cemetery constructor will parse the information in the text file to create and store Tombstone objects. Each line in the file represents one Tombstone object. a. Use a Scanner object to scan in the entire input file. Use another Scanner object to get a single line (use hasNextLine() and nextLine()) from the input file at a time, until the end of the file. Be careful when parsing each line! As you can see from the data above, a person can have two or three names - it is suggested that you use Scanner's next () method until the input source has a next integer (the day at the beginning of the burial date) to parse the names. b. This constructor will be parsing the name, burial date, age and address of each person in the file. A method parseAge (String ageString) has been written for you, that will take the String version of a person's age (e.g. "11.5" or "22d") from the input file and return the (rounded) total number of days that person was alive when they were interred.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

how would you do this in a simple way? this is a non graded practice lab

9:53
774
1. Create a Tombstone class that has instance
variables to store a person's name,
burialDate, age (as an int, more info to
follow), and address, as well as applicable
constructor and getter methods.
2. Open the Cemetery class. Create one
instance variable, an ArrayList of
Tombstone objects. The Cemetery's
constructor should have a parameter
String fileName, which represents a
text file containing the information on the
interred for this cemetery. Don't forget to
initialize the PIV as a new ArrayList.
The Cemetery constructor will parse the
information in the text file to create and
store Tombstone objects. Each line in the
file represents one Tombstone object.
a. Use a Scanner object to scan in the
entire input file. Use another
Scanner object to get a single line
(use hasNextLine() and nextLine())
from the input file at a time, until
the end of the file.
Be careful when parsing each line!
As you can see from the data above,
a person can have two or three
names - it is suggested that you use
Scanner's next () method until the
input source has a next integer (the
day at the beginning of the burial
date) to parse the names.
b. This constructor will be parsing the
name, burial date, age and address
of each person in the file. A method
parseÃge (String ageString)
Transcribed Image Text:9:53 774 1. Create a Tombstone class that has instance variables to store a person's name, burialDate, age (as an int, more info to follow), and address, as well as applicable constructor and getter methods. 2. Open the Cemetery class. Create one instance variable, an ArrayList of Tombstone objects. The Cemetery's constructor should have a parameter String fileName, which represents a text file containing the information on the interred for this cemetery. Don't forget to initialize the PIV as a new ArrayList. The Cemetery constructor will parse the information in the text file to create and store Tombstone objects. Each line in the file represents one Tombstone object. a. Use a Scanner object to scan in the entire input file. Use another Scanner object to get a single line (use hasNextLine() and nextLine()) from the input file at a time, until the end of the file. Be careful when parsing each line! As you can see from the data above, a person can have two or three names - it is suggested that you use Scanner's next () method until the input source has a next integer (the day at the beginning of the burial date) to parse the names. b. This constructor will be parsing the name, burial date, age and address of each person in the file. A method parseÃge (String ageString)
9:53
774
2. Open the Cemetery class. Create one
instance variable, an ArrayList of
Tombstone objects. The Cemetery's
constructor should have a parameter
String fileName, which represents a
text file containing the information on the
interred for this cemetery. Don't forget to
initialize the PIV as a new ArrayList.
The Cemetery constructor will parse the
information in the text file to create and
store Tombstone objects. Each line in the
file represents one Tombstone object.
a. Use a Scanner object to scan in the
entire input file. Use another
Scanner object to get a single line
(use hasNextLine() and nextLine())
from the input file at a time, until
the end of the file.
Be careful when parsing each line!
As you can see from the data above,
a person can have two or three
names - it is suggested that you use
Scanner's next () method until the
input source has a next integer (the
day at the beginning of the burial
date) to parse the names.
b. This constructor will be parsing the
name, burial date, age and address
of each person in the file. A method
parseAge (String ageString)
has been written for you, that will
take the String version of a person's
age (e.g. "11.5" or "22d") from the
input file and return the (rounded)
total number of days that person
was alive when they were interred.
Transcribed Image Text:9:53 774 2. Open the Cemetery class. Create one instance variable, an ArrayList of Tombstone objects. The Cemetery's constructor should have a parameter String fileName, which represents a text file containing the information on the interred for this cemetery. Don't forget to initialize the PIV as a new ArrayList. The Cemetery constructor will parse the information in the text file to create and store Tombstone objects. Each line in the file represents one Tombstone object. a. Use a Scanner object to scan in the entire input file. Use another Scanner object to get a single line (use hasNextLine() and nextLine()) from the input file at a time, until the end of the file. Be careful when parsing each line! As you can see from the data above, a person can have two or three names - it is suggested that you use Scanner's next () method until the input source has a next integer (the day at the beginning of the burial date) to parse the names. b. This constructor will be parsing the name, burial date, age and address of each person in the file. A method parseAge (String ageString) has been written for you, that will take the String version of a person's age (e.g. "11.5" or "22d") from the input file and return the (rounded) total number of days that person was alive when they were interred.
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education