2. Write an application with the following features: Create a class called Customers YourStudentid a. i. Private fields:
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
2. Write an application with the following features: Create a class called Customers YourStudentid a. i. Private fields:
company, email_address Accessor and mutators for the private fields ii. iii. A constructor that accepts 4 parameters: first_name, last_name, ip_address, company iv. Default constructor - to initialize the private fields to empty String b. Create a class called CustomerInfo_YourStudentld Must have public static void main Method: public static Customers YourStudentid [] getCustomers(String filename) 1. reads the contents of the file, stores the data in an array, and return the array Customers YourStudentid [] 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. CPSC 1204 Assignment #1 i. ii. 2. make sure to close the file before the return statement iii. Method: public static void generateEmail(Customers_YourStudentid [] data) 2. 1. Generates an email for every customer and store in the private field email_address Email address: first letter of the first_name, last name, @company, randomly selected top-level domain Examples of TLD: .com, .edu, .ca, .gov You must have at least 5 different TLDs to randomly pick from. iv. Method: public static void display(final Customers_YourStudentid [] data) 1. Displays the headers and contents of the array. Use printf for proper formatting. Make sure that the data does not occupy the space of another column 2. If last_name is displayed on the 2nd column, no parts or characters should appear on the adjacent columns (e.g. #1 and #3) 2|Page Due: July 6, 2022 1:00PM v. Implement 2 methods demonstrating the use of overloading in the context of the application.
2. Write an application with the following features: Create a class called Customers YourStudentid a. i. Private fields: first_name, last_name, ip_address,