PROJECT OVERVIEWObject-oriented programming takes the view that what we really care about are the objects than the logic. Examples of objects range from human beings (described by name, address, and so forth) to buildings and floors (whose properties can be described and managed) down to the little items in your life (such as pencil and eye-glass).
The first step in Object Oriented Programming is to identify all the objects you want to manipulate and how they relate to each other, an exercise often known as data modeling. Once you've identified an object, you generalize it as a class of objects and define the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. A real instance of a class is called an "object" or, an "instance of a class".
Based on this situation you are required to design a class which represents an object in the real world. The class must fulfill all the criteria listed below:1. At least two instance variables that specify the attributes of the object
2. Two constructors that initialize instance variables of class.
3. Provide list of set & get methods for all the attributes.
4. Provide at least three overloaded method
5. Provide at least two subclasses which represent sub categories of the object.
6. You need to override minimum one method in each subclass.
7. You should create at least 2 objects of each class and call all the methods available for that object.
8. There will be additional 2 s for implementing interface by any of classes (interface should contains at least 3 methods)
9. Write your classes in separate files.
10. You should draw a class diagram for this assignment. (In a class diagram we can show the member variables, and methods of a class. We can also show whether one class inherits from another). Figure 1 shows an example of class diagram.
11. Don’t forget to include screenshot to your report
12. Any project which is found to be the same as another will be penalized. If someone cheats by using your work, you will be penalized.Figure 1
OBJECTIVE• The objective of this Individual Assignment is for students to showcase their skill in Object Oriented Programming features.DEADLINE• Before the end of Week 7
• Submit during the Lab OR Lecture ONLY.SUBMISSION INFORMATION• Submit hardcopy personally to the unit controller of Java Programming II.
• Hardcopy must have the Limkokwing University of Creative Technology cover page with your names, ID, course name, semester, coursework title and lecturer name correctly printed, attached in front of the source codes and stapled together or bind together.
• Print out the source code by using COURIER NEW font style and size of 9 by using Microsoft Word. Include PAGE NUMBER on the bottom right.
• Student who submits this piece of Assignment 1 later than the deadline date stated above will have his/her s deducted accordingly as stated in the course outline.WORK ALLOCATION• This project should be carried out individually only.ASSIGNMENT SECURITY• Backup copy: You are required to keep a backup copy of everything related to this coursework in case you need to refer to it in the future.
RULES AND REGULATIONS• You are to complete this assignment individually.
• You are NOT allowed to work with any other students, individual or do your work based on another program that is available from the Internet, or any other source.
• If there is too much collaboration from your common discussion by looking at the solutions, in such instances of academic dishonesty may result in you getting zero s for this piece of assignment.
• If someone cheats by using your work, you will be penalized.
The first step in Object Oriented Programming is to identify all the objects you want to manipulate and how they relate to each other, an exercise often known as data modeling. Once you've identified an object, you generalize it as a class of objects and define the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. A real instance of a class is called an "object" or, an "instance of a class".
Based on this situation you are required to design a class which represents an object in the real world. The class must fulfill all the criteria listed below:1. At least two instance variables that specify the attributes of the object
2. Two constructors that initialize instance variables of class.
3. Provide list of set & get methods for all the attributes.
4. Provide at least three overloaded method
5. Provide at least two subclasses which represent sub categories of the object.
6. You need to override minimum one method in each subclass.
7. You should create at least 2 objects of each class and call all the methods available for that object.
8. There will be additional 2 s for implementing interface by any of classes (interface should contains at least 3 methods)
9. Write your classes in separate files.
10. You should draw a class diagram for this assignment. (In a class diagram we can show the member variables, and methods of a class. We can also show whether one class inherits from another). Figure 1 shows an example of class diagram.
11. Don’t forget to include screenshot to your report
12. Any project which is found to be the same as another will be penalized. If someone cheats by using your work, you will be penalized.Figure 1
OBJECTIVE• The objective of this Individual Assignment is for students to showcase their skill in Object Oriented Programming features.DEADLINE• Before the end of Week 7
• Submit during the Lab OR Lecture ONLY.SUBMISSION INFORMATION• Submit hardcopy personally to the unit controller of Java Programming II.
• Hardcopy must have the Limkokwing University of Creative Technology cover page with your names, ID, course name, semester, coursework title and lecturer name correctly printed, attached in front of the source codes and stapled together or bind together.
• Print out the source code by using COURIER NEW font style and size of 9 by using Microsoft Word. Include PAGE NUMBER on the bottom right.
• Student who submits this piece of Assignment 1 later than the deadline date stated above will have his/her s deducted accordingly as stated in the course outline.WORK ALLOCATION• This project should be carried out individually only.ASSIGNMENT SECURITY• Backup copy: You are required to keep a backup copy of everything related to this coursework in case you need to refer to it in the future.
RULES AND REGULATIONS• You are to complete this assignment individually.
• You are NOT allowed to work with any other students, individual or do your work based on another program that is available from the Internet, or any other source.
• If there is too much collaboration from your common discussion by looking at the solutions, in such instances of academic dishonesty may result in you getting zero s for this piece of assignment.
• If someone cheats by using your work, you will be penalized.
解决方案 »
- java中如何使用正则表达式找出一个字符串中小写单词的个数
- 时间格式转换
- 读取图片文件
- java 反编译的问题。
- ==用jbuilder开发的工程怎样打包出来,独立jbuilder运行?==
- 在ms-dos里编译java(就是没有界面)如可实现响应键盘事件呢
- ibm 网站的中文问题
- 编译完成的.class怎么才能运行呀?
- 现在网页上有许多java写的文本编辑器(如西瓷的留言版),我想做一个,但不知道如何下手,有没有现成的例子,谢谢!给下载地点一定送分!(三问)
- comparator接口与Comparable接口的区别。
- netbeans界面设计问题
- java int getWidth()获取图片宽度为-1...为什么
/**
* This is the main class for testing! I create two objects of each class. these
* objects call all the methods available for that object.
*
*/
public class MainTest
{ public static void main(String[] args)
{
ObjectTest obj1 = new ObjectTest("Jack", 22);
ObjectTest obj2 = new ObjectTest("Jones", 21);
ObjectTest subObj1 = new SubObjTest1();
ObjectTest subObj2 = new SubObjTest1();
ObjectTest subObj3 = new SubObjTest2();
ObjectTest subObj4 = new SubObjTest2(); obj1.print();
obj1.print(22);
obj1.print("JACK&JONES");
obj1.SayBye();
obj1.sayHi();
obj1.dOIt(); subObj1.print();
subObj1.print(22);
subObj1.print("JACK");
subObj1.SayBye();
subObj1.sayHi();
subObj1.dOIt(); subObj3.print();
subObj3.print(21);
subObj3.print("JONES");
subObj3.SayBye();
subObj3.sayHi();
subObj3.dOIt(); }}第二个java文件,父类
/*
* Creat a class which has two constructors and
* two instance variables, as well as some setter and getter
* methods. It also offers three overloaded methods.
* It absolutely implements all three methods
* of an interface named InterfaceTest
*/
public class ObjectTest implements InterfaceTest
{
String name;
int age; public ObjectTest()
{ } public ObjectTest(String name, int age) {
this.name = name; this.age = age;
} public String getName()
{
return name;
} public void setName(String name)
{
this.name = name;
} public int getAge()
{
return age;
} public void setAge(int age)
{
this.age = age;
} public void print()
{
System.out.println("Hello JAVA");
} public void print(String name)
{
System.out.println("My name is " + name);
} public void print(int age)
{
System.out.println("I am " + age + " years old");
} @Override
public void sayHi()
{
System.out.println("Hello,ObjectTest has implemented the interface"); } @Override
public void SayBye()
{
System.out.println("bye! I am father"); } @Override
public void dOIt()
{
System.out.println("Father does it");
}}
/**
* This is the first sub class of class ObjectTest.
* it overrides the method "print" that implemented
* by ObjectTest. it implements three methods which
* are stated in the interface as well.
*
*/
public class SubObjTest1 extends ObjectTest
{
public void print()
{
System.out.println("Hello. I am the first subclass of ObjectTest ");
}
@Override
public void sayHi()
{
System.out.println("Hello,sub1 has implemented the interface");
}
@Override
public void SayBye()
{
System.out.println("bye! I am child no.1");
}
@Override
public void dOIt()
{
System.out.println("child no.1 does it");
}
}/**
* This is the second sub class of class ObjectTest.
*
*/
public class SubObjTest2 extends ObjectTest
{
public void print()
{
System.out.println("Hello. I am the second subclass of ObjectTest");
} @Override
public void sayHi()
{
System.out.println("Hello,sub2 has implemented the interface"); } @Override
public void SayBye()
{
System.out.println("bye! I am child no.2"); } @Override
public void dOIt()
{
System.out.println("child no.2 does it");
}
}
public interface InterfaceTest
{
public abstract void sayHi();
public abstract void SayBye();
public abstract void dOIt();
}
至少有2个指定对象属性的实例变量
2. Two constructors that initialize instance variables of class.
写2个初始化对象的构造函数象考试题,不象面试题,简单。
楼主慢慢来,刚看了一下,很基础的东西,编程思想很重要的喔。
• If someone cheats by using your work, you will be penalized.
看到最后一句,蛋疼的喔。
如果你要别人帮你完成作业的话,你会受到处罚喔。
不是楼主你做的,老师应该很容易就检查出来滴。
楼主給点力吧。