Semester Project - Assignment 3 & 4 .
Semester Project - Assignment 3 & 4 .
Semester Project - Assignment 3 & 4 .
Question 1:
Think about any management system, no need to develop an extensive system, you have to
implement simple functionality. For reference, example is given below
o Online Food Order (Customer End)
First of all your program should display complete menu to user
To place order, there should be complete list of food items with price
In next step, customer will place order and provide his information for food
delivery
Complete order information should be saved in database
In last step customer should be able to see his bill
First, you have to identify classes in your project and then instance variable and method for each
classes. Carefully think about access modifiers of instance variable and methods.
Once you have identified your classes, you have to make detailed UML class diagram.
To read and write data you have to use database connectivity
No need to implement GUI.
You program should handle all possible exceptions.
You have to implement all OOP concepts in your project specifically encapsulation, inheritance,
polymorphism, abstraction and interfaces.
Submission Guideline:
You have to submit a pdf file (project idea 40-50 words, UML diagram, your code of all
classes and screenshot of output) on cu-online.
Upload you project folder in zip form on MS Teams.
Submission deadline: January 02, 2021 at 11:59 pm
Late submission will not be accepted
Project Idea:
A store that contains mainly soft drinks and food items is formed. It has a parent class
called items. Its subclass is known as food items and soft drinks. The added interface is called
CalculatebBill, which is called in the other classes. It is to be added in the main class about how
many items are to be entered in it whether which item; food items or soft drinks. Add the data
according to it. There are 2 tables made that the data is saved in the database.
Code:
package store;
package store;
public Items() {
}
return 0;
}
}
FoodItems:
package store;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
public FoodItems() {
}
public FoodItems(String flavour, double price, double quantity, double id, String name) {
super(id, name);
this.flavour = flavour;
this.price = price;
this.quantity = quantity;
}
return getPrice()*getQuantity();
}
}
SoftDrinks:
package store;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
public SoftDrinks() {
}
public SoftDrinks(String flavour, double price, double quantity, double id, String name) {
super(id, name);
this.flavour = flavour;
this.price = price;
this.quantity = quantity;
}
Store:
package store;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Scanner;
try{
//Connection
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost","root" ,
"ea23");
if(choice==1){
System.out.println("Enter id:");
double id = db.nextDouble();
System.out.println("Enter Name:");
String name = sc.nextLine();
System.out.println("Enter Flavour:");
String flavour = sc.nextLine();
System.out.println("Enter Price:");
double price = db.nextDouble();
System.out.println("Enter Quantity:");
double quanity = db.nextDouble();
food.FoodItems();
}
else{
System.out.println("Enter Food items ;");
System.out.println("Enter id:");
double id = db.nextDouble();
System.out.println("Enter Name:");
String name = sc.nextLine();
System.out.println("Enter Flavour:");
String flavour = sc.nextLine();
System.out.println("Enter Price:");
double price = db.nextDouble();
System.out.println("Enter Quantity:");
double quanity = db.nextDouble();
soft.SoftDrinks();
}
}
}catch(SQLException e){
System.out.println(e.getMessage());
}
}
}
UML Diagram:
Screenshots of output:
DataBase Screenshots: