Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
parthasarathy27 authored May 7, 2024
1 parent b9ffc43 commit 71a8aa4
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
Binary file added ClassObject/Hotal.class
Binary file not shown.
37 changes: 37 additions & 0 deletions ClassObject/Hotal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import java.util.*;

public class Hotal {
int Tea = 10;
int Coffee = 20;
int vada = 6;

public static void main(String[] args) {
System.out.println("Welcome to Hotal");
System.out.println("Actual Price: ");

Hotal server = new Hotal();

System.out.println("Tea: " + server.Tea);
System.out.println("Coffee: " + server.Coffee);
System.out.println("Vada: " + server.vada);

//Hotal One
System.out.println("Hotal1 Price");

Hotal server1 = new Hotal();

Scanner sc = new Scanner(System.in);
System.out.println("Enter Tea Price: ");
server1.Tea = sc.nextInt();
System.out.println("Tea: " + server1.Tea);

//Hotal Two
System.out.println("Hotal2 Price");

Hotal server2 = new Hotal();

System.out.println("Enter Coffee Price: ");
server2.Coffee = sc.nextInt();
System.out.println("Coffee: " + server2.Coffee);
}
}
Binary file added ClassObject/Laptop.class
Binary file not shown.
59 changes: 59 additions & 0 deletions ClassObject/Laptop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
public class Laptop {
String brandname = "";
String Processor = "";
String Ram = "";
int price = 0;

public static void main(String[] args) {
System.out.println("Welcome to Laptop Store");
System.out.println("*************************");
System.out.println("Laptop1 Price");
System.out.println("*************************");

Laptop server = new Laptop();

server.brandname = "Dell";
server.Processor = "i5";
server.Ram = "8GB";
server.price = 50000;

System.out.println("Brand Name: " + server.brandname);
System.out.println("Processor: " + server.Processor);
System.out.println("Ram: " + server.Ram);
System.out.println("Price: " + server.price);

//Laptop One
System.out.println("*************************");
System.out.println("Laptop2 Price");
System.out.println("*************************");

Laptop server1 = new Laptop();

server1.brandname = "HP";
server1.Processor = "i3";
server1.Ram = "4GB";
server1.price = 30000;

System.out.println("Brand Name: " + server1.brandname);
System.out.println("Processor: " + server1.Processor);
System.out.println("Ram: " + server1.Ram);
System.out.println("Price: " + server1.price);

//Laptop Two
System.out.println("*************************");
System.out.println("Laptop3 Price");
System.out.println("*************************");

Laptop server2 = new Laptop();

server2.brandname = "Lenovo";
server2.Processor = "i7";
server2.Ram = "16GB";
server2.price = 70000;

System.out.println("Brand Name: " + server2.brandname);
System.out.println("Processor: " + server2.Processor);
System.out.println("Ram: " + server2.Ram);
System.out.println("Price: " + server2.price);
}
}

0 comments on commit 71a8aa4

Please sign in to comment.