Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull #3

Merged
merged 26 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
efe7892
Add files via upload
SadeeshaJayaweera Sep 26, 2023
e04fe0a
test
Oct 5, 2023
a125531
remove duplicate [ MTH 130 ] and merge both (#152)
Oct 5, 2023
3b42de8
Revert "Data structure and algorithm handwritten notes.."
Oct 5, 2023
6781162
Merge pull request #149 from NamelesssNerd/master
theonlyNischal Sep 26, 2023
71b6de9
Revert "remove duplicate [ MTH 130 ] and merge both (#152)"
Oct 5, 2023
510e9b2
remove duplicate [ MTH 130 ] and merge both (#152)
Oct 5, 2023
63b892a
remove duplicate [ MTH 130 ] and merge both (#152)
Oct 5, 2023
7d96765
Create Scan folder test.txt
EmpSwarup Dec 12, 2023
3771a7e
Added Book Scans
EmpSwarup Dec 12, 2023
31ecc1a
Deleted test.txt
EmpSwarup Dec 12, 2023
664ad0e
Merge pull request #154 from EmpSwarup/master
AaganMaskey Dec 13, 2023
780bc1b
Merge pull request #151 from SadeeshaJayaweera/master
AaganMaskey Dec 13, 2023
c4adf28
Merge pull request #153 from NamelesssNerd/fix/MTH130
AaganMaskey Dec 13, 2023
be54b52
Delete CMP 331_AOS-Applied Operating System/Amit Sir Material/Assignm…
dhunganaPradeep Jan 27, 2024
7a00ebf
Delete CMP 331_AOS-Applied Operating System/Amit Sir Material/Assignm…
dhunganaPradeep Jan 27, 2024
bbf417d
Add files via upload
dhunganaPradeep Jan 27, 2024
d299d35
Merge branch 'theonlyNischal:master' into master
dhunganaPradeep Jan 27, 2024
09373b2
Rename Assignment1 Question.pdf to Assignment_2_Question.pdf
dhunganaPradeep Jan 27, 2024
55a9c0c
Rename Assignment1 Solution.pdf to Assignment_2_Solution.pdf
dhunganaPradeep Jan 27, 2024
f862168
Add files via upload
dhunganaPradeep Jan 27, 2024
0d04786
EAPD Rishi Sir Notes Added
Bibekdhkl Mar 4, 2024
e4e00d1
Merge pull request #156 from dhunganaPradeep/master
Bibekdhkl Mar 4, 2024
821a3f7
Update readme.md
Bibekdhkl Mar 10, 2024
4592944
Merge pull request #157 from theonlyNischal/eapd-note
theonlyNischal Apr 3, 2024
df61a6c
Merge pull request #159 from theonlyNischal/Bibekdhkl-Course-Update
theonlyNischal Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions CMP 212_Programming in Java/Animal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
This is the Question No 10 Part two - Example code for Abstract classes and methods
the object code is Animal_Main.java
*/
// Abstract class Animal
public abstract class Animal {
// Abstract method without implementation
abstract void makeSound();

// Concrete method with implementation
void sleep() {
System.out.println("Zzzz...");
}
}

// Subclass Dog inheriting from Animal
class Dog extends Animal {
@Override
void makeSound() {
System.out.println("Woof Woof!");
}
}

// Subclass Cat inheriting from Animal
class Cat extends Animal {
@Override
void makeSound() {
System.out.println("Meow Meow!");
}
}

12 changes: 12 additions & 0 deletions CMP 212_Programming in Java/Animmal_Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class Animmal_Main {
public static void main(String[] args) {
Dog dog = new Dog();
Cat cat = new Cat();

dog.makeSound();
dog.sleep();

cat.makeSound();
cat.sleep();
}
}
22 changes: 22 additions & 0 deletions CMP 212_Programming in Java/Car.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
This is the 9th Question of the Assignment which has many child classes
child classes - Truck,Ford,Sedan
*/
public class Car {
private int speed;
double regularprice;
private String color;

public Car(int speed, double regularprice, String color)
{
this.speed=speed;
this.regularprice=regularprice;
this.color=color;
}

public double getSalepPrice()
{
return regularprice;
}

}
67 changes: 67 additions & 0 deletions CMP 212_Programming in Java/Date.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
This is the question number 6 in the java assignment
the object code can be found as the DateTest class.
refer the DateTest Class to have a good idea regarding this code and use of constructer, set&get methods used.
*/
public class Date {
private int month,day,year;

public Date(int month, int day, int year)
{
this.month=month;
this.day=day;
this.year=year;

}

//Getter Method for Month
public int getMonth()
{
return month;
}

// Setter Method for Month
public void setMonth(int month)
{
this.month=month;
}

//Gettter Method for Day
public int getDay()
{
return day;
}

//Setter Method for Day
public void setDay(int day)
{
this.day=day;
}


//Getter Method for Year
public int getYear()
{
return year;
}

//Setter Method for Year
public void setYear(int year)
{
this.year=year;
}

public void displayDate()
{
System.out.print(" "+month);
System.out.print("/"+day);
System.out.print("/"+year);
}







}
20 changes: 20 additions & 0 deletions CMP 212_Programming in Java/DateTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class DateTest {
public static void main( String [] args )
{
Date date1 = new Date(8,28,2000);
System.out.println("The Initial Date ");
date1.displayDate();


date1.setMonth(2);
date1.setDay(12);
date1.setYear(2003);

System.out.println("\nThe Updated Date ");
date1.displayDate();




}
}
16 changes: 16 additions & 0 deletions CMP 212_Programming in Java/Ford.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
public class Ford extends Car {
private int year,manufacturerDiscount;
public Ford(int speed, double regularprice,String color, int year, int manufacturerDiscount )
{
super(speed,regularprice,color);
this.year=year;
this.manufacturerDiscount=manufacturerDiscount;
}

public double getSalePrice()
{
return super.getSalepPrice()-manufacturerDiscount;
}


}
47 changes: 47 additions & 0 deletions CMP 212_Programming in Java/Item.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
This is the 7th Question of the assignment
*/
public class Item {
protected static int Location;
protected static String Description;

//constructor - method
public Item (int Location, String Description)
{
this.Description =Description;
this.Location = Location;
}

// Getter Method for Location

public static int getLocation()
{
return Location;
}

//Setter Method for Location

public static void setLocation(int Location)
{
Item.Location = Location;
}


//Getter Method for Description

public static String getDescription()
{
return Description;
}

//Setter Method for Description

public static void setDescription(String Description)
{
Item.Description = Description;
}




}
35 changes: 35 additions & 0 deletions CMP 212_Programming in Java/Item_Monster_Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
This is the main Class that we created to perform and check all the methods within the monster and Item
class - Question No 7
*/
public class Item_Monster_Main {
public static void main( String [] args)
{
// Creating an Object for Item Class
Item obj1 = new Item(200,"Kandy");
System.out.println("Location: " +Item.getLocation());
System.out.println("Description: " +Item.getDescription());

//Creating an Object for Monster Class
Monster obj2 = new Monster(300, "Pasikuda");
System.out.println("Location: " +Monster.getLocation());
System.out.println("Description: " +Monster.getDescription());


System.out.println("");
//Using Setter Method and Getter Method to Update Item
Item.setLocation(900);
Item.setDescription("Canada");
System.out.println("The Updated Location is: " +Item.getLocation());
System.out.println("The Updated Description is: " +Item.getDescription());


//Using Setter and Getter Method to Update Monster
Monster.setLocation(1500);
Monster.setDescription("California");
System.out.println("The Updated Location is: " +Monster.getLocation());
System.out.println("The Updated Description is: " +Monster.getDescription());


}
}
Binary file added CMP 212_Programming in Java/Java Assignmemnt.pdf
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions CMP 212_Programming in Java/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class Main {
public static void main(String[] args) {
// Polymorphism in action
Shape[] shapes = {new Circle(), new Triangle(), new Square()};

for (Shape shape : shapes) {
shape.draw();
shape.erase();
System.out.println();
}
}
}
11 changes: 11 additions & 0 deletions CMP 212_Programming in Java/Monster.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
This is the Sub Class of Item - Question Number 7
*/
public class Monster extends Item {
public Monster(int Location, String Description )
{
super(Location,Description);
}


}
21 changes: 21 additions & 0 deletions CMP 212_Programming in Java/MyOwnAutoShop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
public class MyOwnAutoShop {
public static void main(String [] args)
{
//Creating an instance of Sedan Class
Sedan sedan = new Sedan(280,25000,"Black", 20);

//Creating two instances of Ford Class
Ford ford1 = new Ford(180,15000,"Blue",2022, 2500);
Ford ford2 = new Ford(190,18000,"White",2023,1500);

//Creating an instance of Car Class
Car car1 = new Car(290,25000, "Gray");


//Displaying the Sale prices of all the instances
System.out.println("Sedan Sale Price: $" +sedan.getSalePrice());
System.out.println("Ford1 Sale Price: $" +ford1.getSalePrice());
System.out.println("Ford2 Sale Price: $" +ford2.getSalepPrice());
System.out.println("Car Sale Price: $" +car1.getSalepPrice());
}
}
39 changes: 39 additions & 0 deletions CMP 212_Programming in Java/ProjectClass.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
This is the 3rd Part of the Question 10 in the Assignment Regarding Abstract classes and methods
the object code is Project_Main.java
*/
// Abstract base class providing a common interface
public abstract class ProjectClass {
// Common method that all subclasses should implement
abstract void debug();

// Other common methods can be included here if needed
}

// Subclass 1 inheriting from the abstract base class
class Subclass1 extends ProjectClass {
@Override
void debug() {
System.out.println("Debugging Subclass1...");
// Implement debug-specific functionality here
}
}

// Subclass 2 inheriting from the abstract base class
class Subclass2 extends ProjectClass {
@Override
void debug() {
System.out.println("Debugging Subclass2...");
// Implement debug-specific functionality here
}
}

// Subclass 3 inheriting from the abstract base class
class Subclass3 extends ProjectClass {
@Override
void debug() {
System.out.println("Debugging Subclass3...");
// Implement debug-specific functionality here
}
}

12 changes: 12 additions & 0 deletions CMP 212_Programming in Java/Project_Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class Project_Main {
public static void main(String[] args) {
// Create instances of the subclasses and call their debug() methods
ProjectClass obj1 = new Subclass1();
ProjectClass obj2 = new Subclass2();
ProjectClass obj3 = new Subclass3();

obj1.debug();
obj2.debug();
obj3.debug();
}
}
23 changes: 23 additions & 0 deletions CMP 212_Programming in Java/Question_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.util.Scanner;
/*
This is a first question answer for the java assignment
which is to write a simple text based application using java to display your name
*/
public class Question_1 {

public static void main(String [] args){
String forename,lastname ;
Scanner input = new Scanner(System.in);
System.out.println("Please Enter Your First Name: ");
forename = input.next();

System.out.println("Please Enter Your Last Name: ");
lastname = input.next();


System.out.println("The name is: " +forename+" "+lastname);


}

}
Loading