1. Create the dummy data a. Go to https://www.mockaroo.com/ b. Create the following fields and generate 10 random data in CSV format c. Download the data and rename the file to mydata.csv d. Store...


1. Create the dummy data


a. Go to
https://www.mockaroo.com/


b. Create the following fields and generate 10 random data in CSV format







c. Download the data and rename the file to
mydata.csv


d. Store the file to your src folder


e. Check your data. Some pet names are enclosed in a double quote.




Example:







2. Write an application with the following features:


a. Create a class called Owner



i. Private fields: firstName, lastName, petName, password



ii. Accessor and mutators for the private fields



iii. A constructor that accepts 3 parameters: firstname, lastname, and petname


b. Create a class called PetApp



i. Must have public static void main




ii.
Method:
public static Owner[] getOwners(String filename)


1. reads the contents of the file, stores the data in an array, and return the array



Owner [] yourvariable


Since you do not know how many rows you have in the file, you need to find an algorithm that would solve that. Do not use ArrayList. You can create additional methods as needed.


2. make sure to close the file before the return



iii. Method:
public static void generatePassword(Owner[] data)


1. Generates a password for every owner and store in the private field password


2. Temporary password:


first 3 characters of the lastName + first 2 characters of the firstName + “_” + random


random number: between 1 and 200 (inclusive)







iv. Implement method overloading.


1. One method to display the firstName, lastName, and PetName


2. Another method to display firstName, lastName, and Password


3. Method name: display (you determine the appropriate parameters)



Your code must also include calls to the different methods mentioned above to test that they are

Feb 16, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here