Oop Assignment 1
Oop Assignment 1
programming
Class Assignment #1
Submitted by :
Muhammad Zohaib (sp23-bcs-071)
Submitted to :
Mam Hasina Kainat
Question no 1
import java.util.Random;
class Circle {
public float radius;
public Circle() {
this.radius = 5.5f;
}
public Rectangle() {
this.length = 20;
this.width = 10;
this.color = "Blue";
this.length = length;
this.width = width;
this.color = color;
maxRectangle = r2;
maxRectangle = r3;
}
Question No 3
class Car {
public Car() {
colour = "black";
milage = 0;
price = 120000000;
owner = "Unknown";
this.colour = colour;
this.milage = milage;
this.price = price;
this.owner = owner;
return colour;
return milage;
}
public long getPrice() {
return price;
return owner;
this.price = newPrice;
}
}
car.setPrice(newPrice);