Question: Part 3 : Create a text file. The text file must have each line in the input file represent one item. The line must include
Part :
Create a text file. The text file must have each line in the input file represent one item. The line must include the following values separated by tab: an int to specify whether the line represents an ItemA, ItemB, or Item object of no subtype respectively, string value, integer value, and an Integer value for ItemA or boolean value for ItemB.
For instance, suppose your Item class were Pet, where your parameters were pet name and weight. Your file might have looked like this:
Fido
Callie
Polly
Snoopy
Clifford
Felix
Dumbo
The new file would also have an int in the first field indicating the subtype of Pet, and a final field indicating the new instance variable. Lets say the new instance variable for Dog was age, and the new field for Cat was isMale. Then the new input file would look something like this if the types of Pet were Dog Cat no subtype
Fido
Callie false
Polly
Snoopy
Clifford
Felix true
Dumbo
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
