Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class named StudentEntry that has instance fields for a person's name, phone number, and email (all are Strings). The class should have a

image text in transcribedimage text in transcribed

Write a class named StudentEntry that has instance fields for a person's name, phone number, and email (all are Strings). The class should have a constructor that takes three parameters (the student's name, phone number, and email) and appropriate accessor methods (getters) and mutator methods (setters) StudentEntry name : String - phone : String - email: String + StudentEntry (n: String, p : String, e: String) : + setName (n : String) : void + setPhone (p : String) : void + setEmail (e : String) : void + getName(): String + getPhone (): String + getEmail(): String Then write a class StudentEntryDemo (this is the driver program used to test the other class), in the main method, create three StudentEntry objects with the names, phone numbers, and emails shown as below: entry1 entry2 entry3 name James Smith Catherine Byrd Bill Wang phone 662-915-1234 662-801-1678 901-380-8972 email jsmith@go.olemiss.edu cbyrd@go.olemiss.edu bwang@go.olemiss.edu Now create an ArrayList of StudentEntry objects, add the objects to the ArrayList one by one. Use a for loop to display the info for each student in the ArrayList (remember the example we did in class for the BankAccount objects, you need to use the get method of the ArrayList to get each individual object, and then use the accessor methods in StudentEntry to get the name, phone number, and email for each student). Check the sample output on next page. You can name your programs StudentEntry.java and StudentEntryDemo.java Student 1 Name: James Smith Phone number: 662-915-1234 Email: jsmith@go.olemiss.edu Student 2 Name: Catherine Byrd Phone Number: 662-801-1678 Email: cbyrd@go.olemiss.edu Student 3 Name: Bill Wang Phone number: 901-380-8972 Email: bwang@go.olemiss.edu

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

8. Managers are not trained to be innovation leaders.

Answered: 1 week ago