Java Microproject
Java Microproject
TITLE OF PROJECT
Certificate
This is to certify that Mr.Sujal Mahadev Dhadve . Roll No. : 58 of 4th Semester of Diploma in
Computer engineering of Institute Pillai HOC college of engineering and technology (Code:
1148) marks has completed the term work satisfactorily in Subject -Java
Programming(22412) for the academic year 2023 To 2024 as Prescribed in curriculum.
3
WEEKLY PROGRESS
REPORT MICRO
PROJECT
Major learning outcomes achieved by students by doing the project: Hence, we developed Food delivery
Application
Practical Outcome: 1,4,20,23,25,26,31,32.
Unit outcomes in Cognitive domain: Hence, we created the Food delivery Application using Switch case, If- Else
statements, Exception Handling , Packages, File Handling, etc.
Outcomes in Affective domain: Hence, we understand the concepts of File Handling, Exception Handling, Switch
Cases and if else Statements for development of project.
(Signature of Faculty)
Introduction :
A Food Deliver Application is a software solution designed to order online food from any restaurant at
anytime and anywhere . Food delivery app for delicious meals delivered straight to your doorstep. It typically
includes Ordering convenience , restaurant selection , customization , delivery options , payment methods ,
promotions This application aim to provide a seamless and enjoyable experience for usera to enjoy restaurant-
quality meals from the comfort of thrie home or office and it enables the schedule deliveries , advanced
payment methods , restaurant management portal real-time order tracking , delivery options .
sure , lets break down the functions used in the provided code :
1. accept () :
This function responsible for accepting user input , particularly the customer name , password .
It prompts the user to enter the valid otp which is send by the application .
2. display () :
This function is display the information which is enter by the user like customer name ,
password and otp .
3. hotel() :
This function is accepting the hotel name and this function provides the selection cases for
food which is avialble at that restaurant .
It prompts the user to enter the choice of their food and it provides the information about menu
which is aviable at the restaurant and user have to enter correct choice about their food
otherwise it will print message Invalid choice .
4. pay() :
This function provides the information about the payment method (Cash On Deliver , Credit
Card or Debit Card , Paypal , Click to pay ) like this option provide by this application which
is helpful to user to enter their choice about payment method .
It prompts the user to enter their correct choice about their payment method and if user
enter incorrect choice then it will print message Invalid Choice.
5. delivery():
In this function user have to enter their current address for the delivery or where they want
to send their delivery.
This function provides the information about the food order , food order id and who is
your delivery partner .
Source file
package mj;
importjava.util.*;
import java.io.*;
public class Custom
{
int
pass;
int otp;
String name;
public void
accept()
{
Scanner s = new Scanner(System.in);
System.out.println("*** Customer Information ***");
System.out.println("Enter your name = ");
name = s.next();
System.out.println("Enter your password =
"); pass = s.nextInt();
System.out.println("Enter the OTP send on your device =
"); otp = s.nextInt();
try
{
RandomAccessFile f1 = new
RandomAccessFile("record.txt","rw"); f1.writeUTF(name);
f1.writeInt(pass)
;
f1.writeInt(otp);
f1.close();
}
catch (IOException e)
{
//System.out.println("Error");
}
}
}
catch (IOException e)
{
//System.out.println("Invalid OTP");
}
}
}
Main file:
import mj.*;
importjava.util.Scanner
; public class Food
{
String hot,adf;
int
choice,choice1
; void hotel()
{
Scanner s = new Scanner(System.in);
System.out.println("*** Hotel Information ***");
System.out.println("Enter Hotel name:");
hot = s.next();
System.out.println("1. Cookies And Cream
Toasties"); System.out.println("2. Belgian Chocolate
Tub"); System.out.println("3. Rocky Road Tub");
System.out.println("4. Black Forest Tubsters");
System.out.println("Enter Choice:");
choice = s.nextInt(); switch (choice)
{
case 1:
System.out.println("Cookies And Cream Toasties"); break;
case 2:
System.out.println("Belgian Chocolate Tub"); break;
case 3:
System.out.println("Rocky Road Tub");
break; case 4:
System.out.println("Black Forest Tubsters"); break;
default:
System.out.println("Invalid choice"); break;
}
}
void pay()
{
Scanner s = new Scanner(System.in);
System.out.println("1. Cash On Delivery");
System.out.println("2. Credit Card Or Debit card");
System.out.println("3. Paypal");
System.out.println("4. Click to Pay");
System.out.println("Enter Payment
Method:"); choice1 = s.nextInt();
switch (choice)
{
case 1:
System.out.println("Cash On Delivery");
System.out.println("You have to pay:
$155"); break;
case 2:
System.out.println("Credit Card Or Debit Card");
System.out.println("You have to pay: $150");
break;
case 3: System.out.println("Paypal");
System.out.println("You have to pay:
$140"); break;
case 4:
System.out.println("Click to Pay");
System.out.println("You have to pay:
$145"); break;
default:
System.out.println("Invalidchoice");
break;
}
void delivery()
{
System.out.println("Add your current Address:");
adf =s.next();
System.out.println("Congratulations your order is confirmed!");
System.out.println("Order Id :345562816");
System.out.println("Mukesh is your delivery partner.");
s.close();
}
}
public static void main(String args[])
{
Custom d = new Custom
(); d.accept();
d.display();
Food k = new Food();
k.hotel();
k.pay();
k.delivery();
}
}