Total members 10261 | Gratitudes |It is currently Tue May 22, 2012 5:44 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: Attributes Name Java Type
PostPosted: Tue Oct 27, 2009 1:49 am 
Offline
Newbie
User avatar

Joined: Tue Oct 27, 2009 1:40 am
Posts: 1
Has thanked: 0 time
Have thanks: 0 time

Person class that contain the following info. and inherit the
Attributes Name Java Type
m_Age (stores the age) public Int
m_Name (stores the name) public String
Method Name Accessor Type
Person Constructor that takes a
String for the name. This single
parameter should be assigned
to m_Name. m_Age initially
should be set to zero.
Default
ToString method that returns
String. This method must
concatenates the name and age
together in a descriptive way
and returns the result.
protected
Access methods to get/set each
data member
Default
a)
PersonAbstract class that has one abstract method: ToString
b) Create Teacher Class that inherits the Person Class andextend that to the following:
• A single Private Boolean data member named m_Tenure.
m_Tenure indicates if the teacher has tenure or not.
• Access methods (get/set) for m_Tenure.
• A Constructor that simply takes the name of the teacher
as a parameter. In this constructor,
i. Pass this name up to the base class constructor.
ii. Initialize m_Tenure to false.
• A ToString method as described in Person Class. The
ToString method in Teacher should first call up to the
ToString method in Person in to order to retrieve the
Person part of the string. It should then return a string
output saying whether the teacher has tenure or not,

according to m_Tenure.

Student and add the following:
• A single int data member named m_StudentNumber.
m_StudentNumber will store the student’s student
number.
• A Constructor that simply takes the name of the student
as a parameter. In this constructor,
i. Pass this name up to the base class constructor.
ii. Initialize m_StudentNumber to 0.
• Access methods for m_StudentNumber.
• Add a toString method, check whether m_StudentNumber is
zero or not, then return a string with the student number if it is
• on, Teacher and Student.
Print out the object reference name that you have just constructed .
• Create two new instances of Teacher
Initialize both teachers to the same name.
• Compare the two teachers with the equals method.
Print out if the teachers are the same or different.
with the name Teacher 1 and Teacher 2.
Create an instance of Pers
With empty constructor.
not zero.
• Create 10 instances of Student with Student Number from
And use a loop to display a list.
1 Student1
1 to 10 and name the Students as Student1 to Student10.
2 Student2
3 Student3
10 Student10



e.g.
Note: Comments and Indentation (3 )
Identify where in your code that use has- a and is- a relationship (2)
c) Create another class
d) Create a PersonTest Class and do the following:


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Attributes Name Java Type
PostPosted: Tue Oct 27, 2009 11:53 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
hey , this is an assignment , you have to try by yourself , and if you have a specific problem , post it .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

 Similar topics
 video chat application in java
 navigating to database using java
 java mobile apps
 need help in java
 Read your gmail using Java code
 Java Programing to communicating port parallel
 Java Chat
 Steganography in java
 java code for listing folder contents from remote folder
 java

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 8 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team