Professional Documents
Culture Documents
6
Zaryab Ahmed Khan
20-CS-84
Submitted to: Ma’am Rabia Mahum
Activity # 1
package zaryab.khan.assignment;
System.out.println("20-CS-84");
System.out.println("==============================================");
E1.display();
System.out.println("==============================================");
Staff S1 = new Staff("Staff Class Called", "Ali Khattak", 348514555, "Taxila", "alihere89@gmail.com",
"8-C", 95000, "9th April,2013");
S1.display();
System.out.println("==============================================");
Class PERSON
package zaryab.khan.assignment;
this.name = name;
this.phone = phone;
this.address = address;
this.email = email;
}
Class Employee
package zaryab.khan.assignment;
String Office;
int Salary;
String joining_date;
public Employee(String name, int phone, String address, String email,String Office, int Salary, String
joining_date) {
this.Office = Office;
this.Salary = Salary;
this.joining_date = joining_date;
System.out.println("Name :: "+name);
System.out.println("Address :: "+address);
System.out.println("Email :: "+email);
System.out.println("Office :: "+Office);
System.out.println("Salary :: "+Salary);
}
Class Student
package zaryab.khan.assignment;
String Status;
public Student(String Status, String name, int phone, String address, String email) {
this.Status = Status;
System.out.println("Name :: "+name);
System.out.println("Address :: "+address);
System.out.println("Email :: "+email);
System.out.println("Status :: "+Status);
Class Staff
package zaryab.khan.assignment;
String Title;
public Staff(String Title, String name, int phone, String address, String email, String Office, int Salary,
String joining_date) {
this.Title = Title;
System.out.println("Name :: "+name);
System.out.println("Address :: "+address);
System.out.println("Email :: "+email);
System.out.println("Office :: "+Office);
System.out.println("Title :: "+Title);
Class Faculty
package zaryab.khan.assignment;
String Office_hour;
int Rank;
public Faculty(String Office_hour, int Rank, String name, int phone, String address, String email, String
Office, int Salary, String joining_date) {
this.Office_hour = Office_hour;
this.Rank = Rank;
}
public void display() {
System.out.println("Name :: "+name);
System.out.println("Address :: "+address);
System.out.println("Email :: "+email);
System.out.println("Office :: "+Office);
System.out.println("Salary :: "+Salary);
System.out.println("Rank :: "+Rank);
OUTPUT:
Activity # 2
package lab.assignment.pkg2;
System.out.println("20-CS-84");
System.out.println("=======================================");
B1.display_func();
System.out.println("=======================================");
T1.display_func();
Class Books
package lab.assignment.pkg2;
this.Page_number = Page_number;
public Books(){
return Page_number;
this.Page_number = Page_number;
System.out.println("Title :: "+getTitle());
Class Publication
package lab.assignment.pkg2;
this.Title = Title;
this.Price = Price;
public Publication() {
return Title;
this.Title = Title;
return Price;
}
public void setPrice(String Price) {
this.Price = Price;
Class Tape
package lab.assignment.pkg2;
super(Title, Price);
this.time_minutes = time_minutes;
public Tape(){
return time_minutes;
this.time_minutes = time_minutes;
}
System.out.println("Title :: "+getTitle());
OUTPUT:
Activity # 3
package question.pkg3;
System.out.println("20-CS-84");
System.out.println("==========================================");
L1.display();
System.out.println("==========================================");
Laptop L2 = new Laptop(5, 18, 27, 20, 16, 64, 128, 144);
L2.display();
Class Computer
package question.pkg3;
Computer(){
Word_Size=64;
Memory_Size=1;
Storage_Size=1024;
Speed=1.5;
this.Word_Size = Word_Size;
this.Memory_Size = Memory_Size;
this.Storage_Size = Storage_Size;
this.Speed = Speed;
Class Laptop
package question.pkg3;
int Length;
int Width;
int Height;
int Weight;
public Laptop() {
Length=8;
Height=8;
Width=16;
Weight=32;
public Laptop(int Length, int Width, int Height, int Weight, int Word_Size, int Memory_Size, int
Storage_Size, double Speed) {
this.Length = Length;
this.Width = Width;
this.Height = Height;
this.Weight = Weight;
OUTPUT: