Don't use static variables and methods • Encapsulation: make sure you protect your class variables and provide access to them through get and set methods • all the classes are required to have a constructor that receives all the attributes as parameters and updates the attributes accordingly • all the classes are required to have an "empty" constructor that receives no parameters but updates all the attributes as needed • Follow Horstmann's Java Language Coding Guidelines • Organized in packages (MVC - Model - View Controller) Contents App Creates a Model object Student • int studentid • Sring firstName • String lastName BirthDate birthday Model Creates three Student objects Compares their birth dates • Displays a message stating who is the oldest Address address • String phoneNumber Address BirthDate addresslinel int month addressline2 int day city int year state zipCode • Start with this NetBeans project or create one with o • App.java o Model • Model.java - Student.java
Don't use static variables and methods • Encapsulation: make sure you protect your class variables and provide access to them through get and set methods • all the classes are required to have a constructor that receives all the attributes as parameters and updates the attributes accordingly • all the classes are required to have an "empty" constructor that receives no parameters but updates all the attributes as needed • Follow Horstmann's Java Language Coding Guidelines • Organized in packages (MVC - Model - View Controller) Contents App Creates a Model object Student • int studentid • Sring firstName • String lastName BirthDate birthday Model Creates three Student objects Compares their birth dates • Displays a message stating who is the oldest Address address • String phoneNumber Address BirthDate addresslinel int month addressline2 int day city int year state zipCode • Start with this NetBeans project or create one with o • App.java o Model • Model.java - Student.java
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
Related questions
Question
- Start with this NetBeans project or create one with
- <default package>
- App.java
- Model
- Model.java
- Student.java
- Address.java
- BirthDate.java
- <default package>
Functionality
- The application App creates a Model object
- The Model class
- creates 3 Student objects
- displays information about the three students
- compares the birth dates of the three Student objects
- displays a message stating who is the oldest
The classes
- App
- it has the main method which is the method that Java looks for and runs to start any application
- it creates an object (an instance) of the Model class
- Model
- this is the class where all the action is going to happen
- it creates three students and compare their birth dates and displays a message stating who is older or if they are of the same age
- make sure you test your application for all the possible cases
- Student
- has the following attributes
- int studentId;
- String firstName;
- String lastName;
- BirthDate birthday;
- Address address;
- String phoneNumber;
- has the following attributes
- BirthDate
- it is a class (or type) which is used in Student defining the type of the attribute birthday
- it has three attributes
- int month;
- int day;
- int year;
- it also has a method that returns a formatted string with month, day, year:
- for instance: 10/10/2000
- Address
- it is a class (or type) which is used in Student defining the type of the attribute address
- it has the following attributes:
- String addressLine1
- String addressLine2
- String city
- String state
- int zipCode
- it also has a method that returns a formatted string such as (without the bullets):
- 25 Yearsley Mill Rd
- Media, PA 19063
![Don't use static variables and methods
• Encapsulation: make sure you protect your class variables and provide access to them through get and set methods
• all the classes are required to have a constructor that receives all the attributes as parameters and updates the
attributes accordingly
• all the classes are required to have an "empty" constructor that receives no parameters but updates all the attributes
as needed
• Follow Horstmann's Java Language Coding Guidelines
• Organized in packages (MVC - Model - View Controller)
Contents
App
Creates a Model object
Student
• int studentid
• Sring firstName
• String lastName
BirthDate birthday
Model
Creates three Student objects
Compares their birth dates
• Displays a message stating who is the oldest
Address address
• String phoneNumber
Address
BirthDate
addresslinel
int month
addressline2
int day
city
int year
state
zipCode
• Start with this NetBeans project or create one with
o <default package>
• App.java
o Model
• Model.java
- Student.java](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fd3bef84f-767f-4b75-bd83-a63d9d706bb2%2F99e36b84-a6d3-4942-817c-696280e9a91a%2Fnb8saoh.png&w=3840&q=75)
Transcribed Image Text:Don't use static variables and methods
• Encapsulation: make sure you protect your class variables and provide access to them through get and set methods
• all the classes are required to have a constructor that receives all the attributes as parameters and updates the
attributes accordingly
• all the classes are required to have an "empty" constructor that receives no parameters but updates all the attributes
as needed
• Follow Horstmann's Java Language Coding Guidelines
• Organized in packages (MVC - Model - View Controller)
Contents
App
Creates a Model object
Student
• int studentid
• Sring firstName
• String lastName
BirthDate birthday
Model
Creates three Student objects
Compares their birth dates
• Displays a message stating who is the oldest
Address address
• String phoneNumber
Address
BirthDate
addresslinel
int month
addressline2
int day
city
int year
state
zipCode
• Start with this NetBeans project or create one with
o <default package>
• App.java
o Model
• Model.java
- Student.java
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education