Back to: Java Program’s
0
Dear Learners
This section is for you to post your mini projects.
What you need to do :
- Click Here to Enter your Mini project Title (Project title selected by one student cannot be selected by other.
- Write a program for you mini project, Compile it, Test it and make sure there is no Error.
- Log in to www.rocktheit.com –> Click on Java Programs Course –> Scroll Down to Mini Projects Maximum 20 marks –> click to “Post your Mini Projects ” (Please Note: If you are not enrolled to the course, First enroll before posting your project)
- Go to Comment window in this section, Mention your Full Name, Grade and Division. and then Paste your code.
- Click on “Post Comment”
- Refresh and check you code is posted.
Mahendra Kanojia X A
Project Description :
Code:
Output:
Name : Taasha Shukla : 10 : A
Project Title : Meeting Room
Description : This program will block the meeting room for the user on different slots for a particular day.This program will also display free as well as occupied slots and allow the user to occupy the free slots.
import. java.util.*;
public class meetingroom
{
public static void main()
{
boolean slot1=true,slot2=true,slot3=true,slot4=true;//track the free slots
String bname1=””,bname2=””,bname3=””,bname4=””;
int choice;
boolean quit=false;
int tmp;
Scanner Sc=new Scanner(System.in);
while (!quit )
{
System.out.println(“\f*****WELCOME TO YOUR MEETING ROOM*****”);
System.out.println(“Current Meeting Room status”);
System.out.println(“SLOT\t\t\tSTATUS”);
System.out.print(“10:00am to 12:00pm”);
if (slot1)
{ System.out.println(“\tAVAILABLE”);
}
else
{
System.out.println(“\tBOOKED BY “+bname1 );
}
System.out.print(“12:00pm to 2:00pm”);
if (slot2)
{ System.out.println(“\tAVAILABLE”);
}
else
{
System.out.println(“\tBOOKED BY “+bname2 );
}
System.out.print(“2:00pm to 4:00pm”);
if (slot3)
{ System.out.println(“\tAVAILABLE”);
}
else
{
System.out.println(“\tBOOKED BY “+bname3 );
}
System.out.print(“4:00pm to 6:00pm “);
if (slot4)
{ System.out.println(“\tAVAILABLE”);
}
else
{
System.out.println(“\tBOOKED BY “+bname4 );
}
System.out.println(“enter the slot you want to book “);
System.out.println(“1:10am\n2:12pm\n3:2pm\n4:4pm\nany other no to quit:”);
choice=Sc.nextInt();
switch (choice)
{
case 1:
{
if (slot1)
{System.out.println(“enter your name”);
bname1=Sc.next();
slot1=false;
}
else
{System.out.println(“slot booked,select another slot\npress any no key to continue “);
tmp=Sc.nextInt();
}
break;}
case 2:
{
if (slot2)
{System.out.println(“enter your name”);
bname2=Sc.next();
slot2=false;
}
else
{System.out.println(“slot booked,select another slot\npress any no key to continue”);
tmp=Sc.nextInt();
}
break;}
case 3:
{
if (slot3)
{System.out.println(“enter your name”);
bname3=Sc.next();
slot3=false;
}
else
{System.out.println(“slot booked,select another slot\npress any no key to continue”);
tmp=Sc.nextInt();
}
break;}
case 4:
{
if (slot4)
{System.out.println(“enter your name”);
bname4=Sc.next();
slot4=false;
}
else
{System.out.println(“slot booked,select another slot\npress any no key to continue “);
tmp=Sc.nextInt();
}
break;}
default:
{quit=true;}
}
}
}
}
OUTPUT DEMO:
*****WELCOME TO YOUR MEETING ROOM*****
Current Meeting Room status
SLOT STATUS
10:00am to 12:00pm BOOKED BY Taasha
12:00pm to 2:00pm AVAILABLE
2:00pm to 4:00pm AVAILABLE
4:00pm to 6:00pm AVAILABLE
enter the slot you want to book
1:10am
2:12pm
3:2pm
4:4pm
any other no to quit:
5
import java.util.Scanner;
import java.util.Random;
public class project {
@SuppressWarnings(“resource”)
public static void main(String agrs[]) {
Scanner s = new Scanner(System.in);
Random rand = new Random();
double ct=0; //cart total
int ac; //add to cart?
int z; //converts user input into index for string
int x=0; //to exit loop
int le=0; //to exit- ‘do u want to exit’
//i put comments to help everyone understand (i feel like i should get extra marks for that)
//An array is a container object that holds a fixed number of values of a single type.
//list of games
String horror[] = {“Resident Evil 2 Remake”,”Resident Evil 3 Remake”,”Resident Evil 4″,”Resident Evil 5″,”Resident Evil 6″,”Resident Evil 7″,”Outlast”,”Outlast 2″,”Alien Isolation”};
double hocost[] = {1000,3500,1200,1200,1800,2000,530,700,850};
double hiscore[] = {9.4,9.2,9.5,9.3,7.9,7.7,7.8,8.3,5.9};
int ich[]= {0,0,0,0,0,0,0,0,0};
int hcode[]= {0,1,2,3,4,5,6,7,8};
String fpsrpg[] = {“Wolfenstien: The New Order”,”Wolfenstien: The New Colossus”,”Wolfenstien: Old Blood”,”Deus Ex:Mankind Divided”,”Far Cry 3″,”Far Cry 4″,”Far Cry 5″,”Far Cry New Dawn”,”Doom Eternal”};
double frcost[] = {1180,2000,565,500,1000,1500,3000,2250,4000};
double friscore[] = {7.8,9.1,7,9,8.6,8.5,8.9,7.5,9};
int icfr[]= {0,0,0,0,0,0,0,0,0};
int frcode[]= {10,11,12,13,14,15,16,17,18};
String onlfps[] = {“Call Of Duty Black Ops 3″,”Rainbow six seige”,”Overwatch”,”PUBG”,”ARMA 3″,”apex legends”,”CS:GO”,”fortnite”,”destiny 2″};
double ofcost[] = {4000,1000,1800,500,2000,0,0,0,0};
double ofiscore[] = {9.2,8.5,9.4,9.5,7,9,8,0.1,8.5};
int icof[]= {0,0,0,0,0,0,0,0,0};
int ofcode[]= {20,21,22,23,24,25,26,27,28};
String actadv[] = {“Sekiro: Shadows Die Twice”,” Dark Souls: Remastered”,” Dark Souls 2″,” Dark Souls 3″,”The Witcher”,”The Witcher 2″,”The Withcer 3: Wild Hunt”,”Devil May Cry 4″,”Devil May Cry 5″};
double aacost[] = {4000,1200,2650,4300,370,570,1000,1500,2000};
double aaiscore[] = {10,9,9,8.5,7,8,10,8.7,9.5};
int icaa[]= {0,0,0,0,0,0,0,0,0};
int aacode[]= {30,31,32,33,34,35,36,37,38};
outermost:
while (x==0){
//main menu
System.out.println(“\f”);
System.out.println(“welcome to Advaith’s game store”);
System.out.println(“enter 0 to browse by genre”);
System.out.println(“enter 1 to browse by cost”);
System.out.println(“enter 2 to browse by cost and genre”);
System.out.println(“enter 3 to browse by IGN score”);
System.out.println(“enter 4 to veiw special offers”);
int c1=s.nextInt(6);
if(c1>-1) {
switch(c1){
//start of genre (case 0 of main menu)
case 0:{
System.out.println(“enter 0 to browse horror games”);
System.out.println(“enter 1 to browse fps-rpg games”);
System.out.println(“enter 2 to browse online fps games”);
System.out.println(“enter 3 to browse action adventure games”);
int ch2=s.nextInt(4);
//checking if number entered is negative
if(ch2>-1){
switch(ch2) {
case 0:{
for(int i=0;i-1&&ac<39) {
z=ac-0;
ct=ct+hocost[z];
ich[z]=1;
System.out.println(horror[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}
break;
}//end of printing horror
case 1:{
for(int i=0;i-1&&ac<39) {
z=ac-10;
ct=ct+frcost[z];
icfr[z]=1;
System.out.println(fpsrpg[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}
break;
}//end of printing fps-rpg
case 2:{
for(int i=0;i-1&&ac<39) {
z=ac-20;
ct=ct+ofcost[z];
icof[z]=1;
System.out.println(onlfps[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}//end of add to cart
break;
}//end of online fps
case 3:{
System.out.println("\f" );
for(int i=0;i-1&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}
break;
}//end of printing action adventure
default:{
System.out.println("error");
}//end of default
}//end of switch
}//end of genre
break;
}//end of genre
//start of price range (case 1 of main menu)
case 1:{
System.out.println("enter the lower limit of the cost range");
double ll=s.nextDouble();
System.out.println("enter the upper limit of the cost range");
double ul=s.nextDouble();
//to check if thee upper or lower limit is not negative
if(ll <= 0 && ul <= 0 ) {
System.out.println("price range must be above 0");
}//end of error for negative price range
else {
for(int i=0;ill && hocost[i]-1&&ac<39) {
z=ac-0;
ct=ct+hocost[z];
ich[z]=1;
System.out.println(horror[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;tll && frcost[i]-1&&ac<39) {
z=ac-10;
ct=ct+frcost[z];
icfr[z]=1;
System.out.println(fpsrpg[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;tll && ofcost[i]-1&&ac<39) {
z=ac-20;
ct=ct+ofcost[z];
icof[z]=1;
System.out.println(onlfps[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;tll && aacost[i]-1&&ac<39&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}//end of add to cart?
}//done checking
}//end of loop for price range
}
break;
}//end of price range
//start of genre+price range(case 2 of main menu)
case 2:{
System.out.println("enter the lower limit of the cost range");
double ll=s.nextDouble();
System.out.println("enter the upper limit of the cost range");
double ul=s.nextDouble();
//to check if thee upper or lower limit is not negative
if(ll < 0 && ul -1){
switch(ch2) {
case 0:{
for(int i=0;ill && hocost[i]-1&&ac<39) {
z=ac-0;
ct=ct+hocost[z];
ich[z]=1;
System.out.println(horror[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost2t }
}
}//end of do u want to exit
}//end of add to cart?
//done checking
break;
}}//end of horror
case 1:{
for(int i=0;ill && frcost[i]-1&&ac<39) {
z=ac-10;
ct=ct+frcost[z];
icfr[z]=1;
System.out.println(fpsrpg[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}//end of add to cart?
//done checking
break;
}//end of fps-rpg
case 2:{
for(int i=0;ill && ofcost[i]-1&&ac<39) {
z=ac-20;
ct=ct+ofcost[z];
icof[z]=1;
System.out.println(onlfps[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}//end of add to cart?
//done checking
break;
}//end of online fps
case 3:{
for(int i=0;ill && aacost[i]-1&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}//end of do u want to exit
}//end of add to cart?
//done checking
break;
}//end of action adventure
default:{
System.out.println("error");
}//end of default
}//end of switch
}//end of switch for genre
}//end of else(if theere is no error)
break;
}//end of genre+price range
//start of IGN (case 3 of main menu)
case 3:{
System.out.println("enter the lower limit of the IGN score range");
double ls=s.nextDouble();
System.out.println("enter the upper limit of the IGN score range");
double us=s.nextDouble();
//to check if thee upper or lower limit is not negative
if(ls <= 0 && us <= 0 ) {
System.out.println("price range must be above 0");
}//end of error for negative price range
else {
for(int i=0;ils && hiscore[i]-1&&ac<39) {
z=ac-0;
ct=ct+hocost[z];
ich[z]=1;
System.out.println(horror[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;tls && friscore[i]-1&&ac<39) {
z=ac-10;
ct=ct+frcost[z];
icfr[z]=1;
System.out.println(fpsrpg[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;tls && ofiscore[i]-1&&ac<39) {
z=ac-20;
ct=ct+ofcost[z];
icof[z]=1;
System.out.println(onlfps[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;tls && aaiscore[i]-1&&ac<39&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t-1&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t-1&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t-1&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t-1&&ac<39) {
z=ac-30;
ct=ct+aacost[z];
icaa[z]=1;
System.out.println(actadv[z]+"added to cart");
outer:
while(le==0){
System.out.println("enter 0 to return to main menu");
System.out.println("enter 1 to proceed to checkout");
System.out.println("enter 2 to clear cart and return to main menu");
int exit=s.nextInt(3);
//checks if the number is negative
if(exit<=-1){
System.out.println("plese enter a positive number");
continue outer;
}
else if(exit==0){
continue outermost;
//takes console to outermost
}
else if(exit==1){
x=1;
le=1;
continue outermost;
}
else if(exit==2){
for(int t=0;t<=8;){
t++;
ich[t]=0;
icfr[t]=0;
icof[t]=0;
icaa[t]=0;
ct=0;
continue outermost;
//takes console to outermost
}
}
}}//end of do u want to exit
break;
}
//start of default
default:{
System.out.println("it was literaly impossible to get an error.idk how you did it but good job");
}
}//end of switch for main menu
}//end of main menu
}//end of main loop loop
System.out.println("\f");
System.out.println("your cart: ");
//checking for games in cart
for(int i=0;i<=8;i++){
//checking for horror games in cart
if(ich[i]==1) {
System.out.println("__________________");
System.out.println("name: "+horror[i] );
System.out.println("cost: "+hocost[i]);
System.out.println("IGN score: "+hiscore[i]);
System.out.println("enter "+hcode[i]+" to add to cart");
System.out.println("type -1 to to continue browsing");
System.out.println("__________________");
}//end of checking for horror games in cart
if(icfr[i]==1) {
System.out.println("__________________");
System.out.println("name: "+horror[i] );
System.out.println("cost: "+hocost[i]);
System.out.println("IGN score: "+hiscore[i]);
System.out.println("enter "+frcode[i]+" to add to cart");
System.out.println("__________________");
}//end of checking for fps-rpg games in cart
if(icof[i]==1) {
System.out.println("__________________");
System.out.println("name: "+onlfps[i] );
System.out.println("cost: "+ofcost[i]);
System.out.println("IGN score: "+ofiscore[i]);
System.out.println("enter "+ofcode[i]+" to add to cart");
System.out.println("type -1 to to continue browsing");
System.out.println("__________________");
}//end of checking for online fps games in cart
if(icaa[i]==1) {
System.out.println("name: "+actadv[i] );
System.out.println("cost: "+aacost[i]);
System.out.println("IGN score: "+aaiscore[i]);
System.out.println("metacritic score(out of 100)");
System.out.println("enter "+aacode[i]+" to add to cart");
}//end of checking for action adventure games games in cart
}//end loop for printing items in cart
System.out.println("~~~~~~~~~~~~~~~~~~~~");
System.out.println("");
System.out.println("cart total: "+ct);
System.out.println("");
System.out.println("~~~~~~~~~~~~~~~~~~~~");
}//end of main
}//end of class
NAME.: GRADE: DIV:
PROJECT TITLE :
Name – Shalini Majumdar
Grade – 10 Div – C
Project Title – Enrollment in Hogwarts
Description – I want to make a project on the basis of the famous series, Harry Potter. In my program I will provide variety of options for all the essentials needed to enrol in the magical school of Hogwarts, and print the sum total of all the products bought
Approved
import java.util.Scanner;
public class Hogwarts
{
double pet_price = 0.0;
double wand_price = 0.0;
double broom_price = 0.0;
void pet()//to choose the pet one desires
{
Scanner sc = new Scanner(System.in);
int ch;
System.out.println(“1 – Cat”);
System.out.println(“2 – Toad”);
System.out.println(“3 – Owl”);
ch = sc.nextInt();
switch(ch)//switch case1 begins
{
case 1:
{
System.out.println(“It costs 3450 knuts”);
pet_price = 3450;
break;
}
case 2 :
{
System.out.println(“It costs 2380 knuts”);
pet_price = 2380;
break;
}
case 3 :
{
System.out.println(“It costs 6720 knuts”);
pet_price = 6720;
break;
}
}//switch case1 ends
}
void wand()//one can choose the wand
{
Scanner sc = new Scanner(System.in);
int ch;
System.out.println(“1 – Holly with a phoenix feather”);
System.out.println(“2 – Vine wood with dragon heartstring”);
System.out.println(“3 – Willow with unicorn hair”);
ch = sc.nextInt();
switch(ch)//switch case2 begins
{
case 1:
{
System.out.println(“It costs 629 knuts”);
wand_price = 629;
break;
}
case 2 :
{
System.out.println(“It costs 560 knuts”);
wand_price = 560;
break;
}
case 3 :
{
System.out.println(“It costs 345 knuts”);
wand_price = 345;
break;
}
}// switch case2 begins
}
void broom()//One can choose the broom one desires
{
Scanner sc = new Scanner(System.in);
int ch;
System.out.println(“1 – Firebolt”);
System.out.println(“2 – Comet two ninety”);
System.out.println(“3 – Nimbus 2000”);
ch = sc.nextInt();
switch(ch)//Switch case3 begins
{
case 1:
{
System.out.println(“It costs 23450 knuts”);
broom_price= 23450;
break;
}
case 2 :
{
System.out.println(“It costs 5600 knuts”);
broom_price = 5600;
break;
}
case 3 :
{
System.out.println(“It costs 3490 knuts”);
broom_price = 3490;
break;
}
}//switch case3 ends
}
public static void main()
{
Scanner sc = new Scanner(System.in);
Hogwarts obj = new Hogwarts();
int ch;
System.out.println(“\f”);
System.out.println(“Hello witches and wizards!! Congratulations on being eligible to Hogwarts! \n Here is a list of all the essentials you require to enrol in Hogwarts. Happy Stay!”);
System.out.println(“Caution : you can only choose one item from each category. \n Incase you choose again from the same category, the amount will not be considered in your final bill”);
do{ //to make the program run till one presses exit
System.out.println(“Pls choose any one of the following”);
System.out.println(“1 – pet”);
System.out.println(“2 – wand”);
System.out.println(“3 – broom”);
System.out.println(“4 – bill”);
System.out.println(“5 – exit”);
ch=sc.nextInt();
switch(ch)
{
case 1:
{
obj.pet();
break;
}
case 2 :
{
obj.wand();
break;
}
case 3 :
{
obj.broom();
break;
}
case 4:
{
double total = obj.pet_price+obj.wand_price+obj.broom_price;
System.out.println(“Bill amount = ” +total);
break;
}
case 5:
{
System.out.println(“Thank you”);
break;
}
default:
{
System.out.println(“Invalid input”);
break;
}
}
}
while(ch!=5);
}//end of void main
}
Output~
Hello witches and wizards!! Congratulations on being eligible to Hogwarts!
Here is a list of all the essentials you require to enrol in Hogwarts. Happy Stay!
Caution : you can only choose one item from each category.
Incase you choose again from the same category, the amount will not be considered in your final bill
Pls choose any one of the following
1 – pet
2 – wand
3 – broom
4 – bill
5 – exit
1
1 – Cat
2 – Toad
3 – Owl
1
It costs 3450 knuts
Pls choose any one of the following
1 – pet
2 – wand
3 – broom
4 – bill
5 – exit
2
1 – Holly with a phoenix feather
2 – Vine wood with dragon heartstring
3 – Willow with unicorn hair
1
It costs 629 knuts
Pls choose any one of the following
1 – pet
2 – wand
3 – broom
4 – bill
5 – exit
3
1 – Firebolt
2 – Comet two ninety
3 – Nimbus 2000
1
It costs 23450 knuts
Pls choose any one of the following
1 – pet
2 – wand
3 – broom
4 – bill
5 – exit
4
Bill amount = 27529.0
Pls choose any one of the following
1 – pet
2 – wand
3 – broom
4 – bill
5 – exit
4
Bill amount = 27529.0
Pls choose any one of the following
1 – pet
2 – wand
3 – broom
4 – bill
5 – exit
5
Thank you
Sameer barodawala
Div-B
Title-online phone recharge
Discription -I am writing a program in which the user would just enter which recharge pack he/she wants for the mobile and the program will calculate the final amount
Approved
code:-
import java.util.Scanner;
public class mini_project
{
static int mon;
public static void main()
{
System.out.println(“\f”);
Scanner java=new Scanner(System.in);
System.out.println(“hello”);
System.out.println(“which recharge pack would you like to buy “);
System.out.println(“press 1 if you want to buy the 50 rupees pack”);
System.out.println(“press 2 if you want to buy the 100 rupees pack” );
System.out.println(“press 3 if you want to buy the 200 rupees pack”);
System.out.println(“press 4 if you want to buy some other packs”);
int cho=java.nextInt();
switch(cho)
{
case 1:
{
System.out.println(“you chose the 50 rupees pack”);
mon=50;
System.out.println(“how would you like to pay your amount\n 1-paypal \n 2-paytm \n 3-google pay\n 4-phone pe”);
int r=java.nextInt();
payment();
break;
}//end of case one
case 2:
{
System.out.println(“you chose the 100 rupees pack”);
mon=100;
System.out.println(“how would you like to pay your amount\n 1-paypal \n 2-paytm \n 3-google pay\n 4-phone pe”);
int r=java.nextInt();
payment();
break;
}//end of case 2
case 3:
{
System.out.println(“you chose the 200 rupees pack”);
mon=200;
System.out.println(“how would you like to pay your amount\n 1-paypal \n 2-paytm \n 3-google pay\n 4-phone pe”);
int r=java.nextInt();
payment();
break;
}//end of case 3
default:
{
other_packs();
break;
}
}//end of the switch of the normal packs
}//end of the main
public static void payment()
{//this for the payment process
Scanner java= new Scanner(System.in);
System.out.print(“enter your mobile number-“);
double mob=java.nextDouble();
System.out.print(“enter your operator-“);
String op=java.next();
System.out.print(“enter your name-“);
String nam=java.next();
System.out.print(“enter your credit number-“);
String q=java.next();
System.out.print(“enter expiry date of your card-“);
String date=java.next();
System.out.print(“enter CVV-“);
double cvv=java.nextDouble();
System.out.println(“you are in luck!!!”);
System.out.println(“you get a discount of 5%”);
double discount=5;
double dis=mon*(discount/100);
double tol=mon-dis;
double round=Math.floor(tol);
System.out.println(“your final amount is “+round);
System.out.println(“you saved rupees”+dis);
}//end of payment
public static void other_packs()
{//this is for the other packs
Scanner java=new Scanner(System.in);
System.out.println(“which pack do you want?”);
System.out.println(“press 1 for free calls for a month”);
System.out.println(“press 2 for free messages for a month”);
System.out.println(“press 3 for both of the above options”);
int op=java.nextInt();
switch(op)
{
case 1:
{
mon=75;
System.out.println(“how would you like to pay your amount\n 1-paypal \n 2-paytm \n 3-google pay\n 4-phone pe”);
int r=java.nextInt();
payment();
break;
}//end of case1
case 2:
{
mon=75;
System.out.println(“how would you like to pay your amount\n 1-paypal \n 2-paytm \n 3-google pay\n 4-phone pe”);
int r=java.nextInt();
payment();
break;
}//end of case2
case 3:
{
mon=140;
System.out.println(“how would you like to pay your amount\n 1-paypal \n 2-paytm \n 3-google pay\n 4-phone pe”);
int r=java.nextInt();
payment();
break;
}//end of case 3
}//end of switch of other packs
}//end of other packs
}//end of the block
output:-
hello
which recharge pack would you like to buy
press 1 if you want to buy the 50 rupees pack
press 2 if you want to buy the 100 rupees pack
press 3 if you want to buy the 200 rupees pack
press 4 if you want to buy some other packs
4
which pack do you want?
press 1 for free calls for a month
press 2 for free messages for a month
press 3 for both of the above options
3
how would you like to pay your amount
1-paypal
2-paytm
3-google pay
4-phone pe
2
enter your mobile number-9821133445
enter your operator-Airtel
enter your name-Sameer
enter your credit number-123412341234
enter expiry date of your card-12/2040
enter CVV-546
you are in luck!!!
you get a discount of 5%
your final amount is 133.0
you saved Rupees-7.0
Name : Preksha Bhandari
Grade : 10th B
Project Title: Appointment for
Doctors skilled in
various sectors
Project Discription :
There woul be 4 types of skilled doctors (like cardiologist, dermatologist, etc.)
The patient need to insert all the information including the doctor he or she wants to visit.
He will then get to know the charges and the room no. where the doctor sits.
Approved
NAME : MAHEK GAJRE
GRADE : X DIVISION : C
PROJECT TITLE : BUILDING PROJECT ANALYSIS
PROJECT DESCRIPTION :
Costing of building includes plaster , brick work & R.C.C
Approve
CODE:
import java.util.Scanner;
public class ESTIMATING_COSTING
{
public static void main()
{
System.out.println(“\f”);
System.out.println(“ACCORDING TO MUMBAI REGION”);
Scanner sc= new Scanner (System.in);
System.out.println(“ENTER YOUR CHOICE 🙁 1, 2 OR 3)”);
System.out.println(“1) COST OF PLASTER “);
System.out.println(“2) COST OF BRICK WORK”);
System.out.println(“3) COST OF R.C.C”);
int choice = sc.nextInt();
switch (choice)
{
case 1:
{
if (choice==1)
{
System.out.println(“ENTER YOUR CHOICE: (1 OR 2)”);
System.out.println(“1) SINGLE COAT PLASTERING “);
System.out.println(“2) DOUBLE COAT PLASTERING “);
int wish = sc.nextInt();
if(wish==1)
{
System.out.println(“ENTER AREA TO PLASTERED IN SQUARE FOOT “);
double a = sc.nextDouble();
double c = (2.2*a)/100;
System.out.println(“CEMENT BAGS NEEDED WOULD BE “+c);
double r = c*350 ;
System.out.println(“RATE OF CEMENT WOULD BE “+r+ ” RS/- “);
double s = (13*a)/100;
System.out.println(“VOLUME OF SAND NEEDED WOULD BE “+s);
double rs = s*95;
System.out.println(“RATE OF SAND WOULD BE “+r+ ” RS/- “);
double l = 25*a;
System.out.println(“RATE OF LABOURS WOULD BE “+l+ ” RS/- “);
double m = 3*a ;
System.out.println(“RATE OF MISCELLAEOUS WORK WOULD BE “+m+” RS/- “);
double res = r + rs + l + m;
System.out.println(“TOTAL COSTING OF SINGLE COAT WOULD BE “+res+” RS/- “);
}
else if(wish==2)
{
System.out.println(“ENTER AREA TO PLASTERED IN SQUARE FOOT “);
double a = sc.nextDouble();
double c = (3.5*a)/100.0d;
System.out.println(“CEMENT BAGS NEEDED WOULD BE “+c);
double r = c*350 ;
System.out.println(“RATE OF CEMENT WOULD BE “+r+ ” RS/- “);
double s = (20*a)/100;
System.out.println(“VOLUME OF SAND NEEDED WOULD BE “+s);
double rs = s*95;
System.out.println(“RATE OF SAND WOULD BE “+r+” RS/- “);
double l = 32*a;
System.out.println(“RATE OF LABOURS WOULD BE “+l+” RS/- “);
double m = 5*a ;
System.out.println(“RATE OF MISCELLAEOUS WORK WOULD BE “+m+” RS/- “);
double res = r + rs + l + m;
System.out.println(“TOTAL COSTING OF DOUBLE COAT WOULD BE “+res+” RS/- “);
}
else
{
System.out.println(“WRONG INPUT”);
break ;
}
}
}
case 2:
{
if (choice==2)
{
System.out.println(“ENTER YOUR CHOICE: (1 OR 2)”);
System.out.println(“1) 4 INCH THICK BRICK WORK “);
System.out.println(“2) 9 INCH THICK BRICK WORK “);
int desire= sc.nextInt();
if(desire==1)
{
System.out.println(“ENTER AREA OF BRICK WORK IN SQUARE FOOT “);
double a = sc.nextDouble();
double c = (2.2*a)/100;
System.out.println(“CEMENT BAGS NEEDED WOULD BE “+c);
double r = c*350 ;
System.out.println(“RATE OF CEMENT WOULD BE “+r+ ” RS/- “);
double s = (12*a)/100;
System.out.println(“VOLUME OF SAND NEEDED WOULD BE “+s);
double rs = s*95;
System.out.println(“RATE OF SAND WOULD BE “+r+ ” RS/- “);
double l = 18*a;
System.out.println(“RATE OF LABOURS WOULD BE “+l+ ” RS/- “);
double m = 3*a ;
System.out.println(“RATE OF MISCELLAEOUS WORK WOULD BE “+m+” RS/- “);
double brick = (500*a)/100;
System.out.println(“BRICKS NEEDED WOULD BE “+brick);
double bs = brick * 7;
System.out.println(“RATE OF BRICK WOULD BE “+bs+ ” RS/- “);
double res = r + rs + l + m + bs;
System.out.println(“TOTAL COSTING OF 4 INCH THICK BRICK WORK WOULD BE “+res+” RS/- “);
}
else if(desire==2)
{
System.out.println(“ENTER AREA OF BRICK WORK IN SQUARE FOOT “);
double a = sc.nextDouble();
double c = (5.5*a)/100;
System.out.println(“CEMENT BAGS NEEDED WOULD BE “+c);
double r = c*350 ;
System.out.println(“RATE OF CEMENT WOULD BE “+r+ ” RS/- “);
double s = (30*a)/100;
System.out.println(“VOLUME OF SAND NEEDED WOULD BE “+s);
double rs = s*95;
System.out.println(“RATE OF SAND WOULD BE “+r+” RS/- “);
double l = 30*a;
System.out.println(“RATE OF LABOURS WOULD BE “+l+” RS/- “);
double m = 3*a ;
System.out.println(“RATE OF MISCELLAEOUS WORK WOULD BE “+m+” RS/- “);
double brick = (1100*a)/100;
System.out.println(“BRICK NEEDED WOULD BE “+brick);
double bs = brick * 7;
System.out.println(“RATE OF BRICK WOULD BE “+bs+ ” RS/- “);
double res = r + rs + l + m +bs;
System.out.println(“TOTAL COSTING OF 9 INCH BRICK WORK WOULD BE “+res+” RS/- “);
}
else
{
System.out.println(“WRONG INPUT”);
break ;
}
}
break;
}
case 3:
{
if (choice==3)
{
System.out.println(“ENTER YOUR CHOICE: (1 OR 2)”);
System.out.println(“1) R.C.C OF M15 “);
System.out.println(“2) R.C.C OF M20 “);
int wanting = sc.nextInt();
if(wanting==1)
{
System.out.println(“ENTER AREA TO GET R.C.C DONE IN CUBIC FOOT “);
double a = sc.nextDouble();
double c = (18*a)/100;
System.out.println(“CEMENT BAGS NEEDED WOULD BE “+c);
double r = c*350 ;
System.out.println(“RATE OF CEMENT WOULD BE “+r+ ” RS/- “);
double s = (60*a)/100;
System.out.println(“VOLUME OF SAND NEEDED WOULD BE “+s);
double rs = s*95;
System.out.println(“RATE OF SAND WOULD BE “+rs+ ” RS/- “);
double l = 110*a;
System.out.println(“RATE OF LABOURS WOULD BE “+l+ ” RS/- “);
double m = 8*a ;
System.out.println(“RATE OF MISCELLAEOUS WORK WOULD BE “+m+” RS/- “);
double metal = (90*a)/100;
System.out.println(“METAL NEEDED WOULD BE “+metal+”CUBIC FOOT”);
double mp = metal * 35;
System.out.println(“RATE OF METAL WOULD BE “+mp+ ” RS/- “);
double res = r + rs + l + m + mp ;
System.out.println(“TOTAL COSTING OF R.C.C OF GRADE (M15) WORK WOULD BE “+res+” RS/- “);
}
else if(wanting==2)
{
System.out.println(“ENTER AREA TO GET R.C.C DONE IN CUBIC FOOT “);
double a = sc.nextDouble();
double c = (22*a)/100;
System.out.println(“CEMENT BAGS NEEDED WOULD BE “+c);
double r = c*350 ;
System.out.println(“RATE OF CEMENT WOULD BE “+r+ ” RS/- “);
double s = (52*a)/100;
System.out.println(“VOLUME OF SAND NEEDED WOULD BE “+s);
double rs = s*95;
System.out.println(“RATE OF SAND WOULD BE “+r+” RS/- “);
double l = 110*a;
System.out.println(“RATE OF LABOURS WOULD BE “+l+” RS/- “);
double m = 8*a ;
System.out.println(“RATE OF MISCELLAEOUS WORK WOULD BE “+m+” RS/- “);
double metal = (75*a)/100;
System.out.println(“METAL NEEDED WOULD BE “+metal+”CUBIC FOOT”);
double mp = metal * 35;
System.out.println(“RATE OF METAL WOULD BE “+mp+ ” RS/- “);
double res = r + rs + l + m +mp;
System.out.println(“TOTAL COSTING OF R.C.C OF GRADE(M20) WOULD BE “+res+” RS/- “);
}
else
{
System.out.println(“WRONG INPUT”);
}
}
break;
}
default :
{
System.out.println(“WRONG INPUT!!”);
break;
}
}
}
}
OUTPUT EXAMPLE :
ACCORDING TO MUMBAI REGION
ENTER YOUR CHOICE 🙁 1, 2 OR 3)
1) COST OF PLASTER
2) COST OF BRICK WORK
3) COST OF R.C.C
1
ENTER YOUR CHOICE: (1 OR 2)
1) SINGLE COAT PLASTERING
2) DOUBLE COAT PLASTERING
2
ENTER AREA TO PLASTERED IN SQUARE FOOT
530
CEMENT BAGS NEEDED WOULD BE 18.55
RATE OF CEMENT WOULD BE 6492.5 RS/-
VOLUME OF SAND NEEDED WOULD BE 106.0
RATE OF SAND WOULD BE 6492.5 RS/-
RATE OF LABOURS WOULD BE 16960.0 RS/-
RATE OF MISCELLAEOUS WORK WOULD BE 2650.0 RS/-
TOTAL COSTING OF DOUBLE COAT WOULD BE 36172.5 RS/-
NAME: NEEL SHAH GRADE:10 DIV:C
PROJECT TITLE: DIAGNOSIS YOUR DISEASE
PROJECT DESCRIPTION:IN THIS PROGRAM THE USER WILL BE TESTED FOR THE DISEASES HE SELECTES.
import java.util.Scanner;
public class Digonose_Your_Disease
{
public static void main()
{
int x=0,y=0,z=0,a=0,b=0;
Digonose_Your_Disease d = new Digonose_Your_Disease();
Scanner sc = new Scanner(System.in);
System.out.println(“Welcome To Disease Test Centre”);
System.out.println(“1-Bubonic Plague”);
System.out.println(“2-SARS A.K.A. COVID-19”);
System.out.println(“3-Measles”);
System.out.println(“4-Yellow Fever”);
System.out.println(“5-Ebola”);
System.out.println(“Select the disease on which you want to be tested:”);
int ch=sc.nextInt();
switch(ch)
{
case 1:
{
w1:
while(x==0)
{
System.out.println(“1-Pain in abdomen or muscles”);
System.out.println(“2-Blood in cough”);
System.out.println(“3-Fever, chills or fatigue”);
System.out.println(“4-Diarrhoea, nausea, or vomiting”);
System.out.println(“5-None of the above”);
System.out.println(“Select a symptom from the above that you have:”);
int ch2=sc.nextInt();
if(1<=ch2&&ch2<=4)
{
System.out.println("You may have Bubonic Plague, please consult a doctor");
x = 1;
}//end of if 1
else if(ch2==5)
{
System.out.println("You don't have Bubonic Plague");
x = 1;
} //end of else if 1
else
{
System.out.println("Please chose from the given options");
continue w1;
}//end of else 1
}//end of while 1
break;
}//end of case 1
case 2:
{
w2:
while(y==0)
{
System.out.println("1-Pain in muscles");
System.out.println("2-Respiratory distress or shortness of breath");
System.out.println("3-Fever or chills ");
System.out.println("4-Coughing, infection, or headache");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch3=sc.nextInt();
if(1<=ch3&&ch3<=4)
{
System.out.println("You may have SARS A.K.A. COVID-19, please consult a doctor");
y=1;
}//end of if 2
else if(ch3==5)
{
System.out.println("You don't have SARS A.K.A. COVID-19");
y=1;
}//end of else if 2
else
{
System.out.println("Please chose from the given options");
continue w2;
}//end of else 2
}//end of while 2
break;
}//end of case 2
case 3:
{
w3:
while(z==0)
{
System.out.println("1-Pain in muscles");
System.out.println("2-Fever, malaise, fatigue, or loss of appetite");
System.out.println("3-Runny nose or sneezing");
System.out.println("4-skin rash, dry cough, diarrhoea, headache, sore throat, or swollen lymph nodes");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch4=sc.nextInt();
if(1<=ch4&&ch4<=4)
{
System.out.println("You may have Measles, please consult a doctor");
z=1;
}//end of if 3
else if(ch4==5)
{
System.out.println("You don't have Measles");
z=1;
}//end of else if 3
else
{
System.out.println("Please chose from the given options");
continue w3;
}//end of else 3
}//end of while 3
break;
}//end of case 3
case 4:
{
w4:
while(a==0)
{
System.out.println("1-Pain in abdomen or muscles");
System.out.println("2-Chills, fatigue, fever, or loss of appetite");
System.out.println("3-Nausea or vomiting");
System.out.println("4-Bleeding, delirium, headache, or yellow skin and eyes");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch5=sc.nextInt();
if(1<=ch5&&ch5<=4)
{
System.out.println("You may have Yellow Fever, please consult a doctor");
a=1;
} //end of if 4
else if(ch5==5)
{
System.out.println("You don't have Yellow Fever");
a=1;
}//end of else if 4
else
{
System.out.println("Please choose from the given options");
continue w4;
} //end of else 4
}//end of while 4
break;
}//end of case 4
case 5:
{
w5:
while(b==0)
{
System.out.println("1-Pain in abdomen, chest, joints, or muscles");
System.out.println("2-Chills, dehydration, fatigue, fever, loss of appetite, or sweating");
System.out.println("3-Diarrhoea, nausea, vomiting, or vomiting blood");
System.out.println("4-Eye redness, headache, mental confusion, red spots on skin, or sore throat");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch6=sc.nextInt();
if(1<=ch6&&ch6<=4)
{
System.out.println("You may have Ebola, please consult a doctor");
b=1;
}//end of if 5
else if(ch6==5)
{
System.out.println("You don't have Ebola");
b=1;
}//end of else if 5
else
{
System.out.println("Please chose from the given options");
continue w5;
}//end of else 5
break;
}//end of while 5
}//end of case 5
default:
{
System.out.println("There are only 5 options, please choose from one of them");
d.main();
}//end of default
}//end of switch
d.exit();
}//end of void main
void exit()
{
Digonose_Your_Disease d2 = new Digonose_Your_Disease();
Scanner sc2 = new Scanner(System.in);
System.out.println("If you want exit the program press 0 \nIf you want to test yourself on another disease press any number");
int ch7 = sc2.nextInt();
switch(ch7)
{
case 0:
{
System.out.println("Thank You \nStay Home Stay Safe");
System.exit(0);
}//end of case 0
default :
{
d2.main();
}//end of default
}//end of switch
}//end of void exit
}//end of class
OUTPUT DEMO:
Welcome To Disease Test Centre
1-Bubonic Plague
2-SARS A.K.A. COVID-19
3-Measles
4-Yellow Fever
5-Ebola
Select the disease on which you want to be tested:
1
1-Pain in abdomen or muscles
2-Blood in cough
3-Fever, chills or fatigue
4-Diarrhoea, nausea, or vomiting
5-None of the above
Select a symptom from the above that you have:
5
You don't have Bubonic Plague
If you want exit the program press 0
If you want to test yourself on another disease press any number
0
Thank You
Stay Home Stay Safe
Name : Megh Mehta
Grade : X Div : C
Project Title : Apple Products
Description : This would be a menu driven program and a bill would be generated after the Apple
products are selected.
Approved
Name: Aadishree Kale
Grade:10, Div:C
Project topic: Virtual share market
Project description: Working of a share brokerage company giving a brief intro of buying or selling of shares, brokerage and government taxes involved, income, and profit and loss percent incurred during selling
Approved
CODE
import java.util.Scanner;
public class Virtual_share_market
{
public static void main()
{
System.out.println(“\f”);
Scanner sc=new Scanner(System.in);
System.out.println(“Input your full name”);
String name=sc.next();
System.out.println(“Input mobile number”);
String MOB = sc.next();
System.out.println(“Input email address”);
String email=sc.next();
System.out.println(“PAN number”);
String pan = sc.next();
System.out.println(“Share\tLarsen\t\tPrice: 900\tchoose 1”);
System.out.println(“Share\tHindalco\tPrice: 450\tchoose 2”);
System.out.println(“Share\tAdani Ports\tPrice: 600\tchoose 3”);
System.out.println(“Pls enter your choice”);
int share=sc.nextInt();
System.out.println(“How many shares do you wish to buy?”);
int nos=sc.nextInt();
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~Bill~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~AK STOCK MARKETS~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Name: “+name);
System.out.println(“Mobile Number: “+MOB);
System.out.println(“Email Address: “+email);
System.out.println(“PAN number: “+pan);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(” Details of purchase “);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
switch(share)
{
case 1:
{
System.out.println(“Share of Company: Larsen”);
System.out.println(“Price per share: 900”);
System.out.println(“Number of shares purchased: “+nos);
System.out.println();
int price1=900; //variable price=cost of one share
int inv1=price1*nos; //variable inv1=total amount to be invested in all the shares
System.out.println(“You will have to invest Rs “+inv1);
System.out.println();
double n1=(4*inv1)/100.0;//amount of brokerage tax
double n2=(2*inv1)/100.0;//amount of service tax
double n3=(3*inv1)/100.0;//amount of transaction tax
System.out.println(“Brokerage tax @4%: Rs “+n1);
System.out.println(“Service tax @2%: Rs “+n2);
System.out.println(“Transaction tax @3%: “+n3);
System.out.println();
double netamount1=inv1+n1+n2+n3;//total amount of ruppees that has to be paid including taxes
double tax_amount1=netamount1-inv1;//amount that will be spent in taxes
System.out.println(“Total taxes due for this transaction: “+tax_amount1);
System.out.println(“Total Amount payable by you: “+netamount1);
System.out.println();
System.out.println(“The dividend % per share: 12%”);
double d1=12;//variable d1=dividend %per share
double dpershare=(d1*price1)/100.0;
System.out.println(“Dividend you will recieve per share: “+dpershare);
double dividend1=dpershare*nos; //total income from the shares
System.out.println(“Your total income will be: “+dividend1);
System.out.println();
double eom1=inv1+dividend1;//eom1=selling price
System.out.println(“At the current market rate, if you were to sell your shares,”);
System.out.println(“the total amount you would recieve: “+eom1);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Do you wish to sell your shares?”);
System.out.println(“Enter one for yes and two for no”);
int ch=sc.nextInt();
if(ch==1)
{
System.out.println(“Selling price: “+eom1);
if(eom1>netamount1)
{
System.out.println(“You are in profit”);
double profit=eom1-netamount1;
double rop1=(profit*100.0)/netamount1;//var rop1=rate of profit in double datatype
double rop1a=Math.ceil(rop1);//rop1a=rate of profit rounded up
System.out.println(“The profit you will recieve: “+profit);
System.out.println(“The rate of profit you will recieve: “+rop1a+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of if within if(ch==1)loop
else
{
System.out.println(“You are in Loss”);
double loss=netamount1-eom1;
double l1=(loss*100.0)/netamount1;//var l1=rate of loss in double datatype
double l1a=Math.ceil(l1);//var l1a=rate of loss rounded up
System.out.println(“Amount of loss you will incur: “+loss);
System.out.println(“The rate of loss you will incur: “+l1a+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Markets will surely perk up some other day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of else within if(ch==1)loop
}
else
{
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of outer else loop
break;
}//end of case 1
case 2:
{
System.out.println(“Share of Company: Hindalco”);
System.out.println(“Price per share: 450”);
System.out.println(“Number of shares purchased: “+nos);
System.out.println();
int price2=450;//variable price2=cost of one share
int inv2=price2*nos;//variable inv2=total amount to be invested in all the shares
System.out.println(“You will have to invest Rs “+inv2);
System.out.println();
double n1=(4*inv2)/100.0;//amount of brokerage tax
double n2=(2*inv2)/100.0;//amount of service tax
double n3=(3*inv2)/100.0;//amount of transaction tax
System.out.println(“Brokerage tax @4%: Rs “+n1);
System.out.println(“Service tax @2%: Rs “+n2);
System.out.println(“Transaction tax @3%: “+n3);
System.out.println();
double netamount2=inv2+n1+n2+n3;//total amount of ruppees that has to be paid including taxes
double tax_amount2=netamount2-inv2;//amount that will be spent in taxes
System.out.println(“Total taxes due for this transaction: “+tax_amount2);
System.out.println(“Total Amount payable by you: “+netamount2);
System.out.println();
System.out.println(“The dividend % per share: 15%”);
double d2=15;//variable d2=dividend %per share
double dpershare=(d2*price2)/100.0;
System.out.println(“Dividend you will recieve per share: “+dpershare);
double dividend2=dpershare*nos; //total income from the shares
System.out.println(“Your total income will be: “+dividend2);
System.out.println();
double eom2=inv2+dividend2;//eom2=selling price
System.out.println(“At the current market rate, if you were to sell your shares,”);
System.out.println(“the total amount you would recieve: “+eom2);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Do you wish to sell your shares?”);
System.out.println(“Enter one for yes and two for no”);
int ch=sc.nextInt();
if(ch==1)
{
System.out.println(“Selling price: “+eom2);
if(eom2>netamount2)
{
System.out.println(“You are in profit”);
double profit=eom2-netamount2;
double rop2=(profit*100.0)/netamount2;//var rop2=rate of profit in double datatype
double rop2b=Math.ceil(rop2);//var rop2b=rate of profit rounded up
System.out.println(“The profit you will recieve: “+profit);
System.out.println(“The rate of profit you will recieve: “+rop2b+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of if within if(ch==1)loop
else
{
System.out.println(“You are in Loss”);
double loss=netamount2-eom2;
double l2=(loss*100.0)/netamount2;//var l2=rate of loss in double datatype
double l2b=Math.ceil(l2);//var l2b=rate of loss rounded up
System.out.println(“Amount of loss you will incur: “+loss);
System.out.println(“The rate of loss you will incur: “+l2b+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Markets will surely perk up some other day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of else within if(ch==1)loop
}//end of outer if loop
else
{
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of outer else loop
break;
}//end of case 2
case 3:
{
System.out.println(“Share of Company: Adani Ports”);
System.out.println(“Price per share: 600”);
System.out.println(“Number of shares purchased: “+nos);
System.out.println();
int price3=600;//variable price3=cost of one share
int inv3=price3*nos;//variable inv3=total amount to be invested in all the shares
System.out.println(“You will have to invest Rs “+inv3);
System.out.println();
double n1=(4*inv3)/100.0;//Amount of brokerage tax
double n2=(2*inv3)/100.0;//Amount of service tax
double n3=(3*inv3)/100.0;//Amount of transaction tax
System.out.println(“Brokerage tax @4%: Rs “+n1);
System.out.println(“Service tax @2%: Rs “+n2);
System.out.println(“Transaction tax @3%: “+n3);
System.out.println();
double netamount3=inv3+n1+n2+n3;//total amount of ruppees that has to be paid including taxes
double tax_amount3=netamount3-inv3;//amount that will be spent in taxes
System.out.println(“Total taxes due for this transaction: “+tax_amount3);
System.out.println(“Total Amount payable by you: “+netamount3);
System.out.println();
System.out.println(“The dividend % per share: 8%”);
double d3=8;//variable d3=dividend %per share
double dpershare=(d3*price3)/100.0;
System.out.println(“Dividend you will recieve per share: “+dpershare);
double dividend3=dpershare*nos; //total income from the shares
System.out.println(“Your total income will be: “+dividend3);
System.out.println();
double eom3=inv3+dividend3;//eom3=selling price
System.out.println(“At the current market rate, if you were to sell your shares,”);
System.out.println(“the total amount you would recieve: “+eom3);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Do you wish to sell your shares?”);
System.out.println(“Enter one for yes and two for no”);
int ch=sc.nextInt();
if(ch==1)
{
System.out.println(“Selling price: “+eom3);
if(eom3>netamount3)
{
System.out.println(“You are in profit”);
double profit=eom3-netamount3;
double rop3=(profit*100.0)/netamount3;//var rop3=rate of profit in double datatype
double rop3c=Math.ceil(rop3);//var rop3c=rate of profit rounded up
System.out.println(“The profit you will recieve: “+profit);
System.out.println(“The rate of profit you will recieve: “+rop3c+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of if within if(ch==1)loop
else
{
System.out.println(“You are in Loss”);
double loss=netamount3-eom3;
double l3=(loss*100.0)/netamount3;//var l3=rate of loss in double datatype
double l3c=Math.ceil(l3);//var l3c=rate of loss rounded up
System.out.println(“Amount of loss you will incur: “+loss);
System.out.println(“The rate of loss you will incur: “+l3c+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Markets will surely perk up some other day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of else within if(ch==1)loop
}
else
{
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of outer else loop
break;
}//end of case 3
}//end of switch share
}//end of void main
}//end of class
OUTPUT
Input your full name
Aadishree
Input mobile number
1111111111
Input email address
abc@gmail.com
PAN number
og1245699873
Share Larsen Price: 900 choose 1
Share Hindalco Price: 450 choose 2
Share Adani Ports Price: 600 choose 3
Pls enter your choice
1
How many shares do you wish to buy?
5
~~~~~~~~~~~~~~~~~~~~~~~~~~Bill~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~AK STOCK MARKETS~~~~~~~~~~~~~~~~~~~~~~~
Name: Aadishree
Mobile Number: 1111111111
Email Address: abc@gmail.com
PAN number: og1245699873
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Details of purchase
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Share of Company: Larsen
Price per share: 900
Number of shares purchased: 5
You will have to invest Rs 4500
Brokerage tax @4%: Rs 180.0
Service tax @2%: Rs 90.0
Transaction tax @3%: 135.0
Total taxes due for this transaction: 405.0
Total Amount payable by you: 4905.0
The dividend % per share: 12%
Dividend you will recieve per share: 108.0
Your total income will be: 540.0
At the current market rate, if you were to sell your shares,
the total amount you would recieve: 5040.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do you wish to sell your shares?
Enter one for yes and two for no
1
Selling price: 5040.0
You are in profit
The profit you will recieve: 135.0
The rate of profit you will recieve: 3.0%
Thank you for choosing AK STOCK MARKETS
Have a great day
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CODE
import java.util.Scanner;
public class Virtual_share_market
{
public static void main()
{
System.out.println(“\f”);
Scanner sc=new Scanner(System.in);
System.out.println(“Input your full name”);
String name=sc.next();
System.out.println(“Input mobile number”);
String MOB = sc.next();
System.out.println(“Input email address”);
String email=sc.next();
System.out.println(“PAN number”);
String pan = sc.next();
System.out.println(“Share\tLarsen\t\tPrice: 900\tchoose 1”);
System.out.println(“Share\tHindalco\tPrice: 450\tchoose 2”);
System.out.println(“Share\tAdani Ports\tPrice: 600\tchoose 3”);
System.out.println(“Pls enter your choice”);
int share=sc.nextInt();
System.out.println(“How many shares do you wish to buy?”);
int nos=sc.nextInt();
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~Bill~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~AK STOCK MARKETS~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Name: “+name);
System.out.println(“Mobile Number: “+MOB);
System.out.println(“Email Address: “+email);
System.out.println(“PAN number: “+pan);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(” Details of purchase “);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
switch(share)
{
case 1:
{
System.out.println(“Share of Company: Larsen”);
System.out.println(“Price per share: 900”);
System.out.println(“Number of shares purchased: “+nos);
System.out.println();
int price1=900; //variable price=cost of one share
int inv1=price1*nos; //variable inv1=total amount to be invested in all the shares
System.out.println(“You will have to invest Rs “+inv1);
System.out.println();
double n1=(4*inv1)/100.0;//amount of brokerage tax
double n2=(2*inv1)/100.0;//amount of service tax
double n3=(3*inv1)/100.0;//amount of transaction tax
System.out.println(“Brokerage tax @4%: Rs “+n1);
System.out.println(“Service tax @2%: Rs “+n2);
System.out.println(“Transaction tax @3%: “+n3);
System.out.println();
double netamount1=inv1+n1+n2+n3;//total amount of ruppees that has to be paid including taxes
double tax_amount1=netamount1-inv1;//amount that will be spent in taxes
System.out.println(“Total taxes due for this transaction: “+tax_amount1);
System.out.println(“Total Amount payable by you: “+netamount1);
System.out.println();
System.out.println(“The dividend % per share: 12%”);
double d1=12;//variable d1=dividend %per share
double dpershare=(d1*price1)/100.0;
System.out.println(“Dividend you will recieve per share: “+dpershare);
double dividend1=dpershare*nos; //total income from the shares
System.out.println(“Your total income will be: “+dividend1);
System.out.println();
double eom1=inv1+dividend1;//eom1=selling price
System.out.println(“At the current market rate, if you were to sell your shares,”);
System.out.println(“the total amount you would recieve: “+eom1);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Do you wish to sell your shares?”);
System.out.println(“Enter one for yes and two for no”);
int ch=sc.nextInt();
if(ch==1)
{
System.out.println(“Selling price: “+eom1);
if(eom1>netamount1)
{
System.out.println(“You are in profit”);
double profit=eom1-netamount1;
double rop1=(profit*100.0)/netamount1;//var rop1=rate of profit in double datatype
double rop1a=Math.ceil(rop1);//rop1a=rate of profit rounded up
System.out.println(“The profit you will recieve: “+profit);
System.out.println(“The rate of profit you will recieve: “+rop1a+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of if within if(ch==1)loop
else
{
System.out.println(“You are in Loss”);
double loss=netamount1-eom1;
double l1=(loss*100.0)/netamount1;//var l1=rate of loss in double datatype
double l1a=Math.ceil(l1);//var l1a=rate of loss rounded up
System.out.println(“Amount of loss you will incur: “+loss);
System.out.println(“The rate of loss you will incur: “+l1a+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Markets will surely perk up some other day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of else within if(ch==1)loop
}
else
{
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of outer else loop
break;
}//end of case 1
case 2:
{
System.out.println(“Share of Company: Hindalco”);
System.out.println(“Price per share: 450”);
System.out.println(“Number of shares purchased: “+nos);
System.out.println();
int price2=450;//variable price2=cost of one share
int inv2=price2*nos;//variable inv2=total amount to be invested in all the shares
System.out.println(“You will have to invest Rs “+inv2);
System.out.println();
double n1=(4*inv2)/100.0;//amount of brokerage tax
double n2=(2*inv2)/100.0;//amount of service tax
double n3=(3*inv2)/100.0;//amount of transaction tax
System.out.println(“Brokerage tax @4%: Rs “+n1);
System.out.println(“Service tax @2%: Rs “+n2);
System.out.println(“Transaction tax @3%: “+n3);
System.out.println();
double netamount2=inv2+n1+n2+n3;//total amount of ruppees that has to be paid including taxes
double tax_amount2=netamount2-inv2;//amount that will be spent in taxes
System.out.println(“Total taxes due for this transaction: “+tax_amount2);
System.out.println(“Total Amount payable by you: “+netamount2);
System.out.println();
System.out.println(“The dividend % per share: 15%”);
double d2=15;//variable d2=dividend %per share
double dpershare=(d2*price2)/100.0;
System.out.println(“Dividend you will recieve per share: “+dpershare);
double dividend2=dpershare*nos; //total income from the shares
System.out.println(“Your total income will be: “+dividend2);
System.out.println();
double eom2=inv2+dividend2;//eom2=selling price
System.out.println(“At the current market rate, if you were to sell your shares,”);
System.out.println(“the total amount you would recieve: “+eom2);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Do you wish to sell your shares?”);
System.out.println(“Enter one for yes and two for no”);
int ch=sc.nextInt();
if(ch==1)
{
System.out.println(“Selling price: “+eom2);
if(eom2>netamount2)
{
System.out.println(“You are in profit”);
double profit=eom2-netamount2;
double rop2=(profit*100.0)/netamount2;//var rop2=rate of profit in double datatype
double rop2b=Math.ceil(rop2);//var rop2b=rate of profit rounded up
System.out.println(“The profit you will recieve: “+profit);
System.out.println(“The rate of profit you will recieve: “+rop2b+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of if within if(ch==1)loop
else
{
System.out.println(“You are in Loss”);
double loss=netamount2-eom2;
double l2=(loss*100.0)/netamount2;//var l2=rate of loss in double datatype
double l2b=Math.ceil(l2);//var l2b=rate of loss rounded up
System.out.println(“Amount of loss you will incur: “+loss);
System.out.println(“The rate of loss you will incur: “+l2b+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Markets will surely perk up some other day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of else within if(ch==1)loop
}//end of outer if loop
else
{
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of outer else loop
break;
}//end of case 2
case 3:
{
System.out.println(“Share of Company: Adani Ports”);
System.out.println(“Price per share: 600”);
System.out.println(“Number of shares purchased: “+nos);
System.out.println();
int price3=600;//variable price3=cost of one share
int inv3=price3*nos;//variable inv3=total amount to be invested in all the shares
System.out.println(“You will have to invest Rs “+inv3);
System.out.println();
double n1=(4*inv3)/100.0;//Amount of brokerage tax
double n2=(2*inv3)/100.0;//Amount of service tax
double n3=(3*inv3)/100.0;//Amount of transaction tax
System.out.println(“Brokerage tax @4%: Rs “+n1);
System.out.println(“Service tax @2%: Rs “+n2);
System.out.println(“Transaction tax @3%: “+n3);
System.out.println();
double netamount3=inv3+n1+n2+n3;//total amount of ruppees that has to be paid including taxes
double tax_amount3=netamount3-inv3;//amount that will be spent in taxes
System.out.println(“Total taxes due for this transaction: “+tax_amount3);
System.out.println(“Total Amount payable by you: “+netamount3);
System.out.println();
System.out.println(“The dividend % per share: 8%”);
double d3=8;//variable d3=dividend %per share
double dpershare=(d3*price3)/100.0;
System.out.println(“Dividend you will recieve per share: “+dpershare);
double dividend3=dpershare*nos; //total income from the shares
System.out.println(“Your total income will be: “+dividend3);
System.out.println();
double eom3=inv3+dividend3;//eom3=selling price
System.out.println(“At the current market rate, if you were to sell your shares,”);
System.out.println(“the total amount you would recieve: “+eom3);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.println(“Do you wish to sell your shares?”);
System.out.println(“Enter one for yes and two for no”);
int ch=sc.nextInt();
if(ch==1)
{
System.out.println(“Selling price: “+eom3);
if(eom3>netamount3)
{
System.out.println(“You are in profit”);
double profit=eom3-netamount3;
double rop3=(profit*100.0)/netamount3;//var rop3=rate of profit in double datatype
double rop3c=Math.ceil(rop3);//var rop3c=rate of profit rounded up
System.out.println(“The profit you will recieve: “+profit);
System.out.println(“The rate of profit you will recieve: “+rop3c+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of if within if(ch==1)loop
else
{
System.out.println(“You are in Loss”);
double loss=netamount3-eom3;
double l3=(loss*100.0)/netamount3;//var l3=rate of loss in double datatype
double l3c=Math.ceil(l3);//var l3c=rate of loss rounded up
System.out.println(“Amount of loss you will incur: “+loss);
System.out.println(“The rate of loss you will incur: “+l3c+”%”);
System.out.println();
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Markets will surely perk up some other day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of else within if(ch==1)loop
}
else
{
System.out.println(“Thank you for choosing AK STOCK MARKETS”);
System.out.println(“Have a great day”);
System.out.println(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”);
}//end of outer else loop
break;
}//end of case 3
}//end of switch share
}//end of void main
}//end of class
OUTPUT
Input your full name
Aadishree
Input mobile number
1111111111
Input email address
abc@gmail.com
PAN number
og1245699873
Share Larsen Price: 900 choose 1
Share Hindalco Price: 450 choose 2
Share Adani Ports Price: 600 choose 3
Pls enter your choice
1
How many shares do you wish to buy?
5
~~~~~~~~~~~~~~~~~~~~~~~~~~Bill~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~AK STOCK MARKETS~~~~~~~~~~~~~~~~~~~~~~~
Name: Aadishree
Mobile Number: 1111111111
Email Address: abc@gmail.com
PAN number: og1245699873
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Details of purchase
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Share of Company: Larsen
Price per share: 900
Number of shares purchased: 5
You will have to invest Rs 4500
Brokerage tax @4%: Rs 180.0
Service tax @2%: Rs 90.0
Transaction tax @3%: 135.0
Total taxes due for this transaction: 405.0
Total Amount payable by you: 4905.0
The dividend % per share: 12%
Dividend you will recieve per share: 108.0
Your total income will be: 540.0
At the current market rate, if you were to sell your shares,
the total amount you would recieve: 5040.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do you wish to sell your shares?
Enter one for yes and two for no
1
Selling price: 5040.0
You are in profit
The profit you will recieve: 135.0
The rate of profit you will recieve: 3.0%
Thank you for choosing AK STOCK MARKETS
Have a great day
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Name: Nafisa Kanpurwala
Grade: x Div: B
Project Title: Online Bookstore
Project Description: I want to create an online bookstore where the customer can buy as well as rent books. I have chosen two specific genres which are – Horror and Sci-Fi . The user can decide the genre of his /her choice . I will enlist 5 books under each genre and the user can decide the book of his/her choice and thus make his purchase.
Approve
import java.util.Scanner;
public class Project_Book
{
public static void main(){
System.out.println(“\f”);
Scanner sc=new Scanner(System.in);
System.out.println(“1-HORROR”);
System.out.println(“2-SCIENCE-FICTION”);
System.out.println(“Enter the genre of your choice by selecting 1 for horror and 2 for Sci-Fi”);
int ch=sc.nextInt();
switch(ch){// for the genre of the user”s choice
case 1:{//books for Horror genre
System.out.println(” 1-‘THE EXORCIST’ BY WILLIAM PETER BLATTY”);
System.out.println(“2-‘THE HAUNTING OF THE HILL HOUSE’ BY SHIRLEY JACKSON”);
System.out.println(“3-‘IT’ BYSTEPHEN KING “);
System.out.println(“4-‘CARRIE’ BY STEPHEN KING”);
System.out.println(“5-‘BIRD BOX’ BY JOSH MALERMAN”);
System.out.println(“Press any from 1-5 to choose the book of your choice”);
int bOOk=sc.nextInt();//
switch(bOOk){//to purchase the book of choice
case 1:
{ System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //to either buy or rent the book
case 1://to BUY the book
{System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 250;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:The Exorcist”);
System.out.println(“Author: William Peter Blatty”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”); break;}//end of buying the 1st book
case 2:{
//for renting the book
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=100;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days =sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:The Exorcist”);
System.out.println(“Number of copies rented: ” +quan);
System.out.println(“Author: William Peter Blatty”);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the first book
}//end of switch(choice)
break;
}//end of 1st book’s case
case 2:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 200;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:The Haunting Of The Hill House”);
System.out.println(“Author: Shirley Jackson”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”); break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:The Haunting Of The Hill”);
System.out.println(“Author:Shirley Jackson”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the second book
}
break;
}//end of 2nd book’s case
case 3:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 250;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:It”);
System.out.println(“Author: Stephen King”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:It”);
System.out.println(“Author: Stephen King”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the third book
}
break;
}//end of 3rd book’case
case 4:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 300;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:Carrie”);
System.out.println(“Author: Stephen King”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book: Carrie”);
System.out.println(“Author: Stephen King”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the first book
}
break;
}//end of 4th book’s case
case 5:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 299;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:The Bird Box”);
System.out.println(“Author: Josh Malerman”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:The Bird Box”);
System.out.println(“Author: Josh Malerman”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the second book
}
break;
}//end of 5th book’s case
}//end of switch(bk)
break;
}//end of horror genre
case 2:{//books for Sci-FI genre
System.out.println(” 1-‘DIVERGENT’ BY VERONICA ROTH”);
System.out.println(“2-‘THE LORD OF THE RINGS’ BY J.R TOLKIEN”);
System.out.println(“3-‘A WRINKLE IN TIME’BY MADELEINE L’ENGLE “);
System.out.println(“4-‘THE HUNGER GAMES’BY SUZANNE COLLINS “);
System.out.println(“5-‘THE MAZE RUNNER’ BY JAMES DASHNER”);
System.out.println(“Press any from 1-5 to choose the book of your choice”);
int bk=sc.nextInt();
switch(bk){//to purchase the book of choice
case 1:
{ System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 250;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:Divergent”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Author: Veronica”);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:Divergent”);
System.out.println(“Author: Veronica Roth”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the first book
}//end of switch(choice)
break;
}//end of 1st book’s case
case 2:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 200;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:The Lord Of The Rings”);
System.out.println(“Author:J.R Tolkien”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:The Lord Of The Rings”);
System.out.println(“Author:J.R Tolkien”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the second book
}
break;
}//end of 2nd book’s case
case 3:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 250;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:A Wrinkle In Time”);
System.out.println(“Author: Madeleine L’engle”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“290”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:A Wrinkle In Time”);
System.out.println(“Author: Madeleine L’engle”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the third book
}
break;
}//end of 3rd book’case
case 4:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 300;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book: The Hunger Games”);
System.out.println(“Author: Suzanne Collins”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 0r 90 days “);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book: The Hunger Games”);
System.out.println(“Author: Suzanne Collins”);
System.out.println(“Number of copies reted: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the fourth book
}
break;
}//end of 4th book’s case
case 5:{
System.out.println(“1-BUY”);
System.out.println(“2-RENT”);
System.out.println(“Enter 1 or 2 according to your choice”);
int choice=sc.nextInt();
switch(choice){ //first case-to buy
case 1: {System.out.println(“Enter the number of copies you wish to purchase”);
int quan=sc.nextInt();
double price= 299;
double taxamt=(price*20)/100.0;
double netamt=taxamt+(price*quan);
System.out.println(“Name of the book:The Maze Runner”);
System.out.println(“Author: James Dashner”);
System.out.println(“Number of copies purchased: ” +quan);
System.out.println(“Price of the book:” +price);
System.out.println(“Tax amount ” +taxamt);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;}
case 2:{
System.out.println(“Enter the number of copies you wish to rent”);
int quan=sc.nextInt();
int pricebk=0;
int initprice=0;
System.out.println(“45”);
System.out.println(“90”);
System.out.println(“Enter whether you want to rent the book for 45 or 90 days”);
int days=sc.nextInt();
switch(days){
case 45:{
pricebk=initprice;
break;
}
case 90:{
pricebk=initprice+50;
break;
}
default:{
System.out.println(“Books cannot be rented for more than 3 months”);
break;
}
}
double netamt=pricebk*quan;
System.out.println(“Name of the book:The Maze Runner”);
System.out.println(“Author: James Dashner”);
System.out.println(“Number of copies rented: ” +quan);
System.out.println(“Price for renting the book:” +initprice);
System.out.println(“Days you wish to rent the book for:” +days);
System.out.println(“Your total is:” +netamt);
System.out.println(“Thank for shopping with us”);
System.out.println(“~~~~~~~~~Enjoy your reading~~~~~~~”);
break;
}//end of renting the fifth book
}
break;
}//end of 5th book’s case
}//end of switch(bk)
break;
}//end of Sci-Fi genre
}//end of switch(ch)
}//end of main
}//end of class
output:
1-HORROR
2-SCIENCE-FICTION
Enter the genre of your choice by selecting 1 for horror and 2 for Sci-Fi
1
1-‘THE EXORCIST’ BY WILLIAM PETER BLATTY
2-‘THE HAUNTING OF THE HILL HOUSE’ BY SHIRLEY JACKSON
3-‘IT’ BYSTEPHEN KING
4-‘CARRIE’ BY STEPHEN KING
5-‘BIRD BOX’ BY JOSH MALERMAN
Press any from 1-5 to choose the book of your choice
2
1-BUY
2-RENT
Enter 1 or 2 according to your choice
2
Enter the number of copies you wish to rent
1
45
90
Enter whether you want to rent the book for 45 0r 90 days
2
Books cannot be rented for more than 3 months
Name of the book:The Haunting Of The Hill
Author:Shirley Jackson
Number of copies reted: 1
Price for renting the book:0
Days you wish to rent the book for:2
Your total is:0.0
Thank for shopping with us
~~~~~~~~~Enjoy your reading~~~~~~~
NAME:- Rohan Joshi
GRADE:- 10 DIV:- B
PROJECT TITLE:- ONLINE MASK
PROJECT DESCRIPTION:- In this project i will be giving the user to choose which kind of mask will the user require like N-19 etc.The user will be able choose one mask at a time but the quantity can be as per the preference of the user. When the user is done then there will be a final bill .On the basis of the basis of which mask has the user taken and what is the quantity.
Approved
import java.util.Scanner;
public class Buymasks {
public static void main(String args[]){
System.out. println( “Please select the mask of your choice:”);
System.out..println(“1) N 95 Mask-Rs 200″);
System.out. println(” 2) V 410 Mask-Rs 474″);
System.out. println(“3) V 200 Mask -Rs 599”);
System.out. println(“4) 2600 Mask- Rs 800 “);
System.out println(“5) 3600 Mask-Rs 300”);
System.out. println(“Please enter your choice:”);
Scanner sc =new Scanner (System.in);
int choice;
choice = sc. nextInt();
System.out. println(“please enter the quantity required:”);
int quantity;
quantity= sc. nextInt();
int price;
if(choice == 1){
price= 200;
}
else if(choice==2){
price= 474;
}
else if(choice==3){
price=599;
}
else if(choice==4){
price =800;
}
else if(choice==5){
System.out .println(“SORRY OUT OF STOCK PLEASE SELECT ANOTHER MASK”);
price=0;
}
else{
System.out .println(“WRONG CHOICE”);
price = 0;
}
int total=price* quantity;
int tax= total/ 10;
int sum= total/20;
double bill= total+sum+tax;
if(bill> 3000){
bill=0.9*bill;
System.out. println(“Discount applied is 10%”);
}
else{
System.out. println(“No discount”)
}
System.out .println(“~~~~~~~BILL FOR THE MASK ~~~~~~~~~~”);
System.out .println(“Discount is 10% when purchase is above 3000”);
System.out. println(“Amount for the selected mask is Rs “+ total);
System.out. println(“SGST = 10%”);
System.out. println(“CGST = 5%”);
System.out. println(“Total bill is Rs”+ bill);
System.out. println(“~~~~~~~~~~Thank you for purchase ~~~~~~~~~~”);
System.out. pintln(“~~~~~~~~~HAVE A NICE DAY~~~~~~~~~”) ;
}
}
NAME:-Rujula Chohan
GRADE:-X DIV:-A
PROJECT TITLE:-Zodiac Signs
PROJECT DESCRIPTION:-In this project, the user will have to enter their birth date along with the birth year. I will code a program such that the user will be able to see his/her Zodiac Sign.
I will also provide information regarding the respective signs.
Later I will also calculate the birth year with the present year and find the user’s age.
Project title is school report card
Description the project the user will enter name of name of the student his marks the total marks percentage and the grade
Approved
Name: Sanskriti Malaviya
Standard : X A
Project title- Online hotel booking simulator
Description:- With the help of this program, the user will be able to book for his stay at a hotel, he will be given different preferences for the same, the bill for the breakfast buffet and for all his meals and services which he purchases. I will list a range of facilities that the user can avail.At the time of checkout, he will be presented with a bill including all the above expenses.
Approved. Its lengthly for 20 marks
import java.util.Scanner;
public class Hotel_Del_Luna
{
static int no1, no2;
public static void main()
{
System.out.println(“\f”);
System.out.println(“Welcome to Hotel Del Luna”);
Scanner sc = new Scanner(System.in);
System.out.println(“Please enter the details about your stay at Del Luna below -“);
System.out.println(“Enter the check-in date”);
no1 = sc.nextInt(); System.out.print(no1+” May , 2020″);
System.out.println();
System.out.println(“Enter the check-out date”);
no2 = sc.nextInt(); System.out.println(no2+” May , 2020″);
System.out.println();
int resSub = (no2 – no1);
System.out.print(“The stay duration is for ” +resSub+ ” days”);
System.out.println();
System.out.println(” 1 – Supreme”);
int roomprice = (17500);
System.out.println(” 2 – Luxury”);
int roomprice2 = (22000);
System.out.println(” 3 – Suite”);
int roomprice3 = (27000);
System.out.println(“Enter your choice of room :”);
int ch = sc.nextInt();
System.out.println(“Enter the number of rooms :”);
int chi = sc.nextInt();
double totalcost = (roomprice*resSub*chi);
double totalcost2 = (roomprice2*resSub*chi);
double totalcost3 = (roomprice3*resSub*chi);
switch(ch)//room cost
{
case 1:
{
System.out.println(“The total rent of the room = “+totalcost);
break;
}
case 2:
{
System.out.println(“The total rent of the room =”+totalcost2);
break;
}
case 3:
{
System.out.println(“The total rent of the room =”+totalcost3);
break;
}
case 4:
{
System.out.println(“Wrong input given by the guest”);
}
}//end of total roomcost
System.out.println(“Enter your meal package -“);
System.out.println(” 1 : Only breakfast”);
int mealb = (2400);
System.out.println(” 2 : Breakfast + Dinner”);
int mealbd = (4600);
int cho = sc.nextInt();
System.out.println(“Enter the number of people who will avail this service”);
int num = sc.nextInt(); double tot = (mealb*num); double tot2 = (mealbd*num);
switch(cho)//meal package
{
case 1:
{
System.out.println(“The price for breakfast per head is :”+mealb); //per day charges
break;
}
case 2:
{
System.out.println(“The price for breakfast and dinner per head is “+mealbd);//per day charges
break;
}
}
//end of meal
System.out.println(“Enter one (1) kind of additional service that you would were facilitated with :”);
System.out.println(” 1 – Laundry + Ironing”);
int coste = (2500);
System.out.println(” 2 – Appointment at the Tres Belle ~ our luxurious spa and wellness centre”);
int coste2 = (3400);
System.out.println(” 3 – Airport-valet pick-up facility”);
int coste3 = (2000);
int ser = sc.nextInt();
switch(ser)//facilities
{
case 1:
{
System.out.println(“The cost of Laundry + Ironing service :”+coste);
}
case 2:
{
System.out.println(“The cost of an appointment at the Tres Belle :”+coste2);
}
case 3:
{
System.out.println(“The cost of the airport-valet facility : “+coste3);
}
}
//end of services
double baseamt = (ch*cho*ser);
double gstcost = 12/100*baseamt;
double totalbill = (gstcost+baseamt);
System.out.println();//start of the bill layout
System.out.println(” ~Hotel Del Luna~ “);
System.out.println(” Invoice “);
System.out.println(” Check-in date :” +no1);
System.out.println(” Check-out date :” +no2);
System.out.println(” Duration of the stay :”+resSub);
System.out.println(” The total room cost :” +ch);
System.out.println(” The meal package cost :” +cho);
System.out.println(” The additional facility cost :” +ser);
System.out.println(” The GST on the base amount :” +gstcost);
System.out.println(” The total amount to be paid is Rupees” +totalbill);
System.out.println();
System.out.println(” Message from the owner,”);
System.out.println(” We hope we provided you with the best hotel experience that we could offer, visit us again!”);
System.out.println(” Regards,”);
System.out.println(” Jang Man-wol”);
}//end of main
}//end of class
The edited and final version of the program.
import java.util.Scanner;
import java.lang.System;
public class Hotel_Del_Luna
{
static int no1, no2;
static double roomprice, coste, mealb, tot, totalcost;
public static void main()
{
System.out.println(“\f”);
System.out.println(“Welcome to Hotel Del Luna _ a seven star property in the heart of the bustling city of Seoul, South Korea”);
Scanner sc = new Scanner(System.in);
System.out.println(“Please enter the details about your stay at Del Luna below -“);
System.out.println(“Enter the check-in date”);
no1 = sc.nextInt(); System.out.print(no1+” July , 2020″);
System.out.println();
System.out.println(“Enter the check-out date”);
no2 = sc.nextInt(); System.out.println(no2+” July , 2020″);
System.out.println();
System.out.println(“* We are only accepting bookings scheduled in the month of July, due to the ongoing COVID-19 pandemic *”);
if(no1<=31&&no2<=31)
{
System.out.println("Please proceed !");
}
else
{
System.out.println("Wrong input!!");
System.exit(0);
}
System.out.println();
int resSub = (no2 – no1);
System.out.print("The stay duration is for " +resSub+ " day(s)");
System.out.println();
System.out.println(" 1 – Supreme ~ Rs. 17,500 + taxes ^per night");
int roomprice = 17500;
System.out.println(" 2 – Luxury ~ Rs. 22,000 + taxes ^per night");
int roomprice2 = 22000;
System.out.println(" 3 – Suite ~ Rs. 27,000 + taxes ^per night");
int roomprice3= 27000;
System.out.println();
System.out.println("Enter your choice of room :");
int ch = sc.nextInt();
System.out.println();
System.out.println("Enter the number of rooms :");
int chi = sc.nextInt();
switch(ch)//room cost
{
case 1:
{
roomprice = 17500;
totalcost = (roomprice*resSub*chi);
System.out.println("The total rent of the room = "+totalcost);
break;
}
case 2:
{
roomprice = 22000;
totalcost = (roomprice*resSub*chi);
System.out.println("The total rent of the room ="+totalcost);
break;
}
case 3:
{
roomprice = 27000;
totalcost = (roomprice*resSub*chi);
System.out.println("The total rent of the room ="+totalcost);
break;
}
case 4:
{
System.out.println("Wrong input given by the guest");
}
}//end of total roomcost
System.out.println();
System.out.println("Enter your meal package -");
System.out.println(" 1 : Only breakfast");
System.out.println(" Buffet cost – 2400 rupees");
System.out.println(" 2 : Breakfast + Dinner");
System.out.println(" Buffet cost – 4800 rupees");
int cho = sc.nextInt();
System.out.println("Enter the number of people who will avail this service");
int num = sc.nextInt();
switch(cho)//meal package
{
case 1:
{
mealb = 2400; tot = (mealb*num);
System.out.println("The total price for breakfast is :"+tot); //per day charges
break;
}
case 2:
{
mealb = 4800; tot = (mealb*num);
System.out.println("The total price for breakfast and dinner is "+tot);//per day charges
break;
}
}//end of meal package
System.out.println();
System.out.println("Enter one (1) kind of additional service that you would like to be facilitated with :");
System.out.println(" 1 – Laundry + Ironing");
System.out.println(" 2 – Appointment at the Tres Belle ~ our luxurious spa and wellness centre");
System.out.println(" 3 – Airport-valet pick-up facility");
int ser = sc.nextInt();
switch(ser)//facilities
{
case 1:
{
coste = 1400;
System.out.println("The cost of Laundry + Ironing service :"+coste);
}
case 2:
{
coste = 3400;
System.out.println("The cost of an appointment at the Tres Belle :"+coste);
}
case 3:
{
coste = 2000;
System.out.println("The cost of the airport-valet facility : "+coste);
}
}
//end of services
System.out.println();
double baseamt = (totalcost+tot+coste);
double gstcost = 12%100*baseamt/100;
double totalbill = (gstcost+baseamt);
System.out.println();//start of the bill layout
System.out.println(" ~Hotel Del Luna~ ");
System.out.println(" Invoice Number :- 73402"); System.out.println(" Invoice date : " +no2);
System.out.println(" Check-in date :" +no1);
System.out.println(" Check-out date :" +no2);
System.out.println(" Duration of the stay :"+resSub+" days");
System.out.println(" The total room cost :" +totalcost);
System.out.println(" The meal package cost :" +tot);
System.out.println(" The additional facility cost :" +coste);
System.out.println("/n");
System.out.println(" Base amount i.e. amount without tax applied = " +baseamt);
System.out.println(" The total GST on the base amount :" +gstcost);
System.out.println(" The total amount to be paid is Rupees =" +totalbill);
System.out.println();
System.out.println("How would you like to go about with the transaction ? ^ E-payment, Cash or brownie points");
System.out.println();
System.out.println(" ~~Message from the owner,");
System.out.println(" We hope we provided you with the best hotel experience that we could offer, visit us again!");
System.out.println(" Regards,");
System.out.println("Jang Man-wol");
System.out.println("Owner, Hotel Del Luna");
}//end of main
}//end of class
The edited and final version of the program.
OUTPUT OF THE PROGRAM POSTED ABOVE :-
Welcome to Hotel Del Luna _ a seven star property in the heart of the bustling city of Seoul, South Korea
Please enter the details about your stay at Del Luna below –
Enter the check-in date
12
12 July , 2020
Enter the check-out date
14
14 July , 2020
* We are only accepting bookings scheduled in the month of July, due to the ongoing COVID-19 pandemic *
Please proceed !
The stay duration is for 2 day(s)
1 – Supreme ~ Rs. 17,500 + taxes ^per night
2 – Luxury ~ Rs. 22,000 + taxes ^per night
3 – Suite ~ Rs. 27,000 + taxes ^per night
Enter your choice of room :
2
Enter the number of rooms :
1
The total rent of the room =44000.0
Enter your meal package –
1 : Only breakfast
Buffet cost – 2400 rupees
2 : Breakfast + Dinner
Buffet cost – 4800 rupees
1
Enter the number of people who will avail this service
2
The total price for breakfast is :4800.0
Enter one (1) kind of additional service that you would like to be facilitated with :
1 – Laundry + Ironing
2 – Appointment at the Tres Belle ~ our luxurious spa and wellness centre
3 – Airport-valet pick-up facility
2
The cost of an appointment at the Tres Belle :3400.0
The cost of the airport-valet facility : 2000.0
~Hotel Del Luna~
Invoice Number :- 73402
Invoice date : 14July 2020
Check-in date :12 July 2020
Check-out date :14 July 2020
Duration of the stay :2 day(s)
The total room cost :44000.0
The meal package cost :4800.0
The additional facility cost :2000.0
/n
Base amount i.e. amount without tax applied = 50800.0
The total GST on the base amount :6096.0
The total amount to be paid is Rupees =56896.0
How would you like to go about with the transaction ? ^ E-payment, Cash or brownie points
~~Message from the owner,
We hope we provide you with the best hotel experience that we could offer, visit us again!
Regards,
Jang Man-wol
Owner, Hotel Del Luna
Name:Pratham Chheda
Grade:10
Div.:B
Project title: Insurance company
Description:Various types of insurance
like Life insurance, health
insurance,vehicle
insurance.It will take
input from user and
create their policy and
helpp them make
changes. Details will be
provided by the program.
NOT Clear with the idea
Class 1:Life_Insurance
package Insurance_Package;
import java.util.Scanner;
public class Life_Insurance
{
static Scanner sc=new Scanner(System.in);
static long dob1 ;static String add1;static long date1;static long premium1;
static String name1; static String Policyno1; static long amt1; static long contno1;
static long expdate1;
static long matamt;
static String rname1;
static void LifeInsuranceForm(){
System.out.println( “Please Enter name of Policy Holder”);
name1=sc.next();
System.out.println(“Please enter rider name”);
rname1=sc.next();
System.out.println (“Please enter Policy Number”);
Policyno1=sc.next();
System.out.println(“Please enter Amount of policy”);
amt1=sc.nextLong(); System.out.println( “Please enter Contact Number”); contno1=sc.nextLong(); System.out.println (“Please enter Date of birth Please do not put slashes, “);
dob1=sc.nextLong ();
System.out.println(“Please enter Address”);
add1=sc.next();
System.out.println(“Expiry is 20 Year”);
date1=sc.nextLong();}
//to enter premium
static void Premium()
{
System.out.println(“Please Enter Premium Amount “);
premium1=sc.nextLong();
}
//this meyhod will calculate maturity amount which is paid at the end of claim
static void MaturityAmountCalcBenifit()
{
System.out.println(“Please Enter the number of years in claiming the policy”);
int year=sc.nextInt();
long bonus=premium1*10;
matamt=amt1+(7/100)*amt1+bonus;
}
//to calc. exp date
static void Date()
{
System.out.println(“Please enter the start date of policy(DDMMYYYY)”);
date1=sc.nextLong();
expdate1=date1+20;
}
static void Insurance_Policy()
{
System.out.println(“welcome to the insurance Company”);
System.out.println(“Policy Holder Name “+name1);
System.out.println(“Policy number “+Policyno1);
System.out.println(“Policy Date “+date1);
System.out.println(“‘Policy Holder Address “+add1);
System.out.println(“Policy Holder DOB :”+dob1);
System.out.println(“Premium Account for Policy”+premium1);
System.out.println(“Rider Name :”+rname1);
System.out.println(“Expiry Date :”+expdate1);
}
static void finalrct()
{
System.out.println(“welcome to the insurance Company”);
System.out.println(“Policy Holder Name “+name1);
System.out.println(“Policy number “+Policyno1);
System.out.println(“Policy Date “+date1);
System.out.println(“‘Policy Holder Address “+add1);
System.out.println(“Policy Holder DOB :”+dob1);
System.out.println(“Premium Account for Policy”+premium1);
System.out.println(“Rider Name :”+rname1);
System.out.println(“Final amount received :”+matamt);
System.out.println(“Thank you for choosing Insurance Company!:))”);
}
static void Termsncondition()
{
System.out.println(“Terms and Conditions”);
System.out.println(“Exclusion in accidental deathAn accidental death is included in term plan, but that does not mean the claim made under such a scenario will always be accepted. In case of accidental deaths, the insurance companies always investigate the circumstances of the incident. The procedure of such an investigation might vary from insurer to insurer, but the findings have to be satisfactory for the claim to be accepted.”);
System.out.println(“Conditions regarding lifestyleDeath caused by lifestyle choices can be excluded from the policy. For example, the insurance companies always confirm if the insured is a smoker. The habit of smoking is a lifestyle choice that can shorten the insured’s life. Hence, smokers are considered to be high-risk policyholders. Therefore, if an insured does not declare the smoking habit while buying the policy, the insurer might reject the claim in cases where the death is related tosmoking.”);
System.out.println(“The term insurance terms and conditions always exclude any death related to self-harm or suicide. However, some insurance providers offer to return the premium if the policyholder commits suicide within a year from buying the policy. Certain fees are deducted by the insurer in that case. Moreover, death by participating in dangerous activities is excluded from the policy.”);
System.out.println(“The term insurance exclusions of almost every insurance company mention any death due to intoxication. If the policyholder consumes drugs or an excessive amount of alcohol, and if this habit results in death, the insurance company is not liable to pay the cover.Now that you are aware of the term life insurance exclusions, be sure to maintain a lifestyle that does not expose you to the loss of life, which might result in the insurer denying your nominees’ insurance claim.”);
}
}
Class 2:Health_Insurance
package Insurance_Package;
import java .util.Scanner;
public class Health_Insurance{
static Scanner sc=new Scanner(System.in); static String name; static String Policyno; static long amt; static long contno;
static long dob ;static String add; static long date; static long premium;
static String hospname;
static String disease; static int paymode; static int Typopolicy;
static String patu;
static long am2;
static String pat;
//method to fill form
static void HealthInsuranceForm(){
System.out.println( “Please Enter name of Policy Holder”);
name=sc.next();
System.out.println (“Please enter Policy Number”);
Policyno=sc.next();
System.out.println(“Please enter Amount of policy”);
amt=sc.nextLong(); System.out.println( “Please enter Contact Number”); contno=sc.nextLong(); System.out.println (“Please enter Date of birth Please do not put slashes, “);
dob=sc.nextLong ();
System.out.println(“Please enter Address”);
add=sc.next();
System.out.println(“Enter Policy renewal Date:(DDMMYYYY)”);
date=sc.nextLong();}
//method to select type of policy
static void TypeofPolicy(){
System.out.println(“Please select 1 for personal policy”); System.out.println(“2 for floater policy includes family members also “);
Typopolicy=sc.nextInt ();
if (Typopolicy==1){pat=”Personal”;}
else if(Typopolicy==2){pat=”Floater”;}}
//to enter premium amount
static void Premium(){
System.out.println(“please enter Premium Amount:”); premium=sc.nextLong();}
//to enter Payment mode
static void paymentMode(){
System.out.println(“Please Select type of account”);
System.out.println(“1 for Cashless\n2 for reimbusment”);
System.out.println(“A cashless policy, which is the norm now in health insurance, is a policy where the insurer settles the claim directly by making the payment on behalf of the insured.\n A reimbursement policy, on the other hand, requires you to pay for all the expenses yourself first and later reimburses the expenses.”);
paymode=sc.nextInt();
if (paymode==1){patu=”Cashless”;}
else if(paymode==2){patu=”Reimbursement”;}
}
//method to claim
static void claim()
{
System.out.println(“Enter Hospital Name:”); hospname=sc.next (); System.out.println(“Disease Caused by policy holder or family(if applicable)”);
disease=sc.next();
System.out.println(“Please enter amount of the bill”);
long amt1=sc.nextLong();
am2=amt-amt1;
System.out.println(“The amount of policy left is”+am2 );
}
//method to print insurance
static void Insurance_Policy()
{
System.out.println(“welcome to the insurance Company”);
System.out.println(“Policy Holder Name “+name);
System.out.println(“Policy number “+Policyno);
System.out.println(“Policy Date “+date);
System.out.println(“‘Policy Holder Address “+add);
System.out.println(“Policy Holder DOB :”+dob);
System.out.println(“Premium Account for Policy”+premium);
System.out.println(“‘Policy method of Cash :”+patu);
System.out.println(“Policy Type “+pat);
System.out.println(“Expiry Date :”+(date+1));
}
//method for terms and condition
static void Termsncondition()
{
System.out.println(“Terms and condition”);
System.out.println(“Pre & Post Hospitalisation- Medical expenses had due to Illness up to 30 days period immediately beforoe and 60 days immmediately after an Insured person’s admission to a hospital”);
System.out.println(“Care Procedure – Medical expenses for day care procedures where such procedures are undertaken by an Insured person as an In-patient in a hospital for continuous period of less than 24(twenty four) hours”);
System.out.println(“Domiciliary hospitalization- Medical expenses for treatment taken when confined within one’s home for a minimum of 3(three) consecutive days”);
System.out.println(“Donor expense- Medical expenses incurred in respect of the donor for any of the organ transplant surgery, provided the organ donated is for Insured persons, subject to a maximum of 2(two) adults covered in the policy”);
System.out.println(“Alternative methods of treatment- Covered up to Sum insured provided inpatient treatment under this cover is in a government hospital located in India or in any Institute recognized by the Government of India and/or accredited by Quality Council of India/National Accreditation Board of Health. The treatment rendered should be from a registered medical practitioner who holds a valid practicing license.”);
System.out.println(“Air ambulance Services- Ambulance expenses incurred to transfer the insured person following an emergency to the nearest hospital by air ambulance is covered up to 10% of annual sum insured”);
System.out.println(“Cashless hospitalization at 4500+ network hospitals- As on 1st January 2018.”);
System.out.println(“Enjoy tax benefits- Avail tax deduction on premium paid under health insurance policy as per applicable provisions of Income Tax and amendments made there to.”);
}
static void finalrct()
{
System.out.println(“welcome to the insurance Company”);
System.out.println(“Policy Holder Name “+name);
System.out.println(“Policy number “+Policyno);
System.out.println(“Policy Date “+date);
System.out.println(“‘Policy Holder Address “+add);
System.out.println(“Policy Holder DOB :”+dob);
System.out.println(“Premium Account for Policy”+premium);
System.out.println(“‘Policy method of Cash :”+patu);
System.out.println(“Policy Type “+pat);
System.out.println(“Hospital Admitted :”+hospname);
System.out.println(“Disease Infected is :”+disease);
System.out.println(“Expiry Date :”+(date+1));
System.out.println(“The remaining Amount is ::::::::::”+am2+”\nThank you for choosing Insurance_Company we hope to see you again”);
}
}
Class 3:Insurance_Main
package Insurance_Package;
import java.util.Scanner;
/**
* Write a description of class Insurance_Main here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Insurance_Main
{
public static void main()
{
System.out.println(“\f”);
System.out.println(“WELCOME TO INSURANCE COMPANY”);
Scanner sc=new Scanner(System.in);
int cjw;
do{
System.out.println(“Main Menu”);
System.out.println(“1.Create Policy”);
System.out.println(“2.Print Policy by policy number”);
System.out.println(“3.Claim”);
System.out.println(“4.Terms and conditions”);
System.out.println(“5.Exit”);
System.out.println(“Your Choice”);
cjw=sc.nextInt();
switch (cjw)
{
case 1:{
System.out.println(“Please Choose\n1 for Health Insurance New Policy\n2 for Life Insurance New Policy”);
int ch=sc.nextInt();
switch(ch)
{case 1:{
System.out.print(“How Many policies do you want to make? : “);
int n=sc.nextInt();
Health_Insurance C[]=new Health_Insurance[n];
for(int i=0;i<C.length;i++)
{
C[i]=new Health_Insurance();
C[i].HealthInsuranceForm();
C[i].TypeofPolicy();
C[i].Premium();
C[i].paymentMode();
}
}break;
case 2:{
System.out.print("How Many Accounts do you want to make? : ");
int n=sc.nextInt();
Life_Insurance C[]=new Life_Insurance[n];
for(int i=0;i<C.length;i++)
{
C[i]=new Life_Insurance();
C[i].LifeInsuranceForm();
C[i].Premium();
}
}break;
}
}
break;
case 2:{
System.out.println("Please enter Account number");
String s1=sc.next();
System.out.println("Please enter 1 for Health Insurance");
System.out.println("Please enter 2 for Life Insurance");
int ch12=sc.nextInt();
switch (ch12){case 1:{
if(Health_Insurance.Policyno.equals(s1)==true)
{
Health_Insurance.Insurance_Policy();
}
} break;
case 2:{
Life_Insurance.Insurance_Policy();
}
}
}break;
case 3:{
System.out.println("Please enter Account number");
String s2=sc.next();
System.out.println("Please enter 1 for Health Insurance");
System.out.println("Please enter 2 for Life Insurance");
int ch19=sc.nextInt();
switch (ch19){case 1:{
if(Health_Insurance.Policyno.equals(s2)==true)
{
Health_Insurance.claim();Health_Insurance.finalrct();
}
} break;
case 2:if(Life_Insurance.Policyno1.equals(s2)==true)
{
Life_Insurance.MaturityAmountCalcBenifit();Health_Insurance.finalrct();
}break;
}
}break;
case 4:{
System.out.println("Health Insurance T.C.");
Health_Insurance.Termsncondition();
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println("Life insurance T.C.");
Life_Insurance.Termsncondition();
}break;
case 5:System.out.println("Good bye……");
}
}while( cjw!=5);
}
}
——————————————————————————
name: Tejas Baid
Grade : 9
Division: B
Description: Study planner
In this programme a child can assess his productivity of studying for a certain number of days which would be entered by him. He will be based on factors like following timetable , the number of hours for which he studies , the number of hours for which he sleeps, etc
Approved
import java.util.Scanner;
public class study_planner
{//start of class
public static void main()
{//start of main
System.out.println(“\f”);
Scanner sc = new Scanner(System.in);
System.out.println(“RULES:”);
System.out.println(“If you sleep for more than 8 hours or less than 6.5 hours 2 points will be deducted”);
System.out.println(“If you follow the time timetable continuously then the score will be added in arithmetic progression”);
System.out.println(“For every hour of study, 2 points will be added”);
System.out.println(“Please enter 2 to continue”);
int cont1 = sc.nextInt();
if(cont1==2)
{
System.out.println(“Please enter your first name”);
String name = sc.next();
System.out.println(“Please enter your last name”);
String last_name = sc.next();
System.out.println(“Please enter 1 if you are a boy,enter 2 if you are a girl”);
int gender = sc.nextInt();
System.out.println(“Please enter the number of days or which your score is to be checked”);
int num=sc.nextInt();
double sum_pfhos = 0;//For the analysis of the score at the end
double sum_sleep = 0;//For the analysis of the score at the end
double pfhos;//For the analysis of the score at the end
double sum=0;
int pot=0;//points for timetable
double poos;//points for sleep
int n=1;//For writing the day number at the start of each day
double nod_sleep;//For figuring out the number of days for which he sleeps
int pfhosmb;//points for hours of study for obtaining mahendra bahubali
int pfhosab;//points for hours of study for obtaining amrendra bahubali
int pfhoskat;//pounts for hours of study for obtaining katappa
int timetable_max=0;//total maximum points for timetable required
int sum_mb=0;//total sum which is required for mahendra bahubali
int sum_ab=0;//total sum which is required for amrendra bahubali
int sum_kat=0;//total sum which is required for katappa
for(int i=1;i8||nohslept24)
{
i–;n–;//since the score for that day should not be counted
poos=0;
pfhos=0;
timetable=0;//since no points should be given for a day which is not counted
System.out.println(“Please do not joke around”) ;
System.out.println(“You need to be honest while using this study planner”);
System.out.println(“We are taking your statistics for this day again , but please be honest this time”);
continue;//to skip all the statements below it
}
sum=sum+poos+pot+pfhos;
pfhosmb=2*6;//since for mahendra bahubali he should do atleast 6 hours of study everyday at an average
pfhosab = 2*5;//since amrendra bahubali should be atlesast 5 hours
pfhoskat = 2*4;//since katappa should be atleast 4 hours
++timetable_max;//because it always has to increase for obtaining maximum number possible for timetable
sum_mb=sum_mb+pfhosmb+timetable_max-2;
sum_ab=sum_ab+pfhosab+timetable_max-4;
sum_kat=sum_kat+pfhoskat+timetable_max-6;
sum_pfhos = sum_pfhos + pfhos; //for analysing and showing the total number of hours studied for the final report card
sum_sleep = sum_sleep+poos;//for finding the total number of days when sleep is not adequate(will be completed later in the programme)
}
System.out.println(“Your score is “+sum);
String f_character;
int rank;
String rank_character;
if(sum>=sum_mb)
{
f_character=”Mahendra bhaubali”;
rank=1;
rank_character = “Rank “+rank;
}
else if(sum>=sum_ab)
{
f_character=”Amrendra Bahubali”;
rank=2;
rank_character = “Rank “+rank;
}
else if(sum>=sum_kat)
{
f_character=”Katappa”;
rank=3;
rank_character = “Rank “+rank;
}
else
{
f_character=”soldier”;
rank=4;
rank_character = “Rank “+rank;
}
System.out.println(“There are 4 levels of characters which you will be rewarded “);
System.out.println(“To look at your progress and analyse the thngs you need to improve at,enter 1. “);
System.out.println(“If you da not want to analyse ,enter 2”);
int analyse = sc.nextInt();
if(analyse==1)
{
System.out.println(“SCORE ANALYSIS:-“);
System.out.println(“Total study points in “+num+”days is -:”+sum_pfhos+”hours”);
nod_sleep = sum_sleep/-2;//dividing by 2 will give us the number of days the sleeping hours are not proper
System.out.println(“You have slept outside the recommended time for “+nod_sleep+” days”);
System.out.println(“To look at your final report card, enter 1”);
int f_report = sc.nextInt();//int final report
if(f_report==1)
{
System.out.println(“Name:”+name+” “+last_name);
System.out.println(“Remarks:”);
System.out.println();
System.out.println(“STUDY TIME”);
if(sum_pfhos=0.5)//if he sleeps for the wrong duration for more than or equal to half the days
{
System.out.println(“You must mantain a proper sleep schedule”);
System.out.println(“It would definetely help you in increasing your productivity a lot”);
}
else{System.out.println(“Good job. you are mantaining a great sleep schedule”);}
System.out.println();//to leave 1 line for a neater programme
System.out.println();//to leave 1 line for a neater programme
System.out.println(“FOLLOWING TIMETABLE”);
if(pot<timetable_max)//since he should be mantaining a timetable everyday
{
System.out.println("Even thogh you tried hard,if you follow your timetable in a better manner,your productivity would definetely increase");
}//End of check for timetable
else
{
System.out.println("Good job. You are following your timetale correctly.Keep it up");
}//follow timetable correctly (else)
System.out.println("There are 4 final character:-");
System.out.println("Sum required for obtaining Mahendra Bhaubali is "+sum_mb);
System.out.println("Sum required for obtaining Amrendra Bhaubali is "+sum_ab);
System.out.println("Sum required for obtaining Katappa is "+sum_kat);
System.out.println("The lowest character is soldier");
System.out.println();//to leave 1 line for a neater programme
System.out.println();//to leave 1 line for a neater programme
System.out.println("Your final character is "+f_character+"-"+rank_character);
/*end of seeing report card*/}
else
{
System.out.println("Sum required for obtaining Mahendra Bhaubali is "+sum_mb);
System.out.println("Sum required for obtaining Amrendra Bhaubali is "+sum_ab);
System.out.println("Sum required for obtaining Katappa is "+sum_kat);
System.out.println("The lowest character is soldier");
System.out.println();//to leave 1 line for a neater programme
System.out.println();//to leave 1 line for a neater programme
System.out.println("Your final character is "+f_character+"-"+rank_character);
}//else for not seeing his final report card
}//end of analysis
else
{
System.out.println("Sum required for obtaining Mahendra Bhaubali is "+sum_mb);
System.out.println("Sum required for obtaining Amrendra Bhaubali is "+sum_ab);
System.out.println("Sum required for obtaining Katappa is "+sum_kat);
System.out.println("The lowest character is soldier");
System.out.println();//to leave 1 line for a neater programme
System.out.println();//to leave 1 line for a neater programme
System.out.println("Your final character is "+f_character+"-"+rank_character);
}//else for analysing score
System.out.println("Press 1 to continue");
int continued=sc.nextInt();
if(continued==1)
{double increase;//to check how much increase does a person need to do to get the next level
if(rank==1)
{
System.out.println("You are already doing very well. You just need to compete with yourself");
System.out.println("All the other things you require are already told to you.");
System.out.println("Just keep working hard . Thank you for usng study planner");
}
else if(rank==2)
{
System.out.println("You now need to work for rank 1");
double increase1 = sum_mb-sum;
System.out.println("You need to score "+increase1 + " more marks for obtaining rank 1" );
System.out.println();
System.out.println("Thank you for using study planner");
System.out.println("Hope that you can reach your target of rank 1 soon");
System.out.println("All the best. Phod ke aana");
}
else if(rank==3)
{
System.out.println("You now need to work for rank 2");
double increase2 = sum_ab-sum;
System.out.println("You need to score "+increase2 + " more marks for obtaining rank 2" );
System.out.println();
System.out.println("Thank you for using study planner");
System.out.println("Hope that you can reach your target of rank 2 soon");
System.out.println("All the best. PHOD KE AANA");
}
else
{
System.out.println("You now need to work for rank 3");
double increase3 = sum_kat-sum;
System.out.println("You need to score "+increase3 + " more marks for obtaining rank 3" );
System.out.println();
System.out.println("Thank you for using study planner");
System.out.println("Hope that you can reach your target of rank 2 soon");
System.out.println("All the best. PHOD KE AANA");
}//else for rank 1
}//CONTINUE
else
{
System.out.println("I hope this study planner was helpful for you . Hope you can increase your score the next time");
}//else for cotinue
}//end of CONT1
}//end of main
}//end of class
output:
RULES:
If you sleep for more than 8 hours or less than 6.5 hours 2 points will be deducted
If you follow the time timetable continuously then the score will be added in arithmetic progression
For every hour of study, 2 points will be added
Please enter 2 to continue
2
Please enter your first name
Tejas
Please enter your last name
Baid
Please enter 1 if you are a boy,enter 2 if you are a girl
1
Please enter the number of days or which your score is to be checked
3
DAY1
Enter number of hours studied
8
If the timetable was followed enter 1,else enter 2
1
Please enter the number of hours slept
8
DAY2
Enter number of hours studied
1
If the timetable was followed enter 1,else enter 2
2
Please enter the number of hours slept
0
DAY3
Enter number of hours studied
13
If the timetable was followed enter 1,else enter 2
1
Please enter the number of hours slept
8
Your score is 44.0
There are 4 levels of characters which you will be rewarded
To look at your progress and analyse the thngs you need to improve at,enter 1.
If you da not want to analyse ,enter 2
1
SCORE ANALYSIS:-
Total study points in 3days is -:44.0hours
You have slept outside the recommended time for 1.0 days
To look at your final report card, enter 1
1
Name:Tejas Baid
Remarks:
STUDY TIME
Good job. You are studying for good periods of time during this outbreak.Hope you continue it
SLEEP SCHEDULE
Good job. you are mantaining a great sleep schedule
FOLLOWING TIMETABLE
Even thogh you tried hard,if you follow your timetable in a better manner,your productivity would definetely increase
There are 4 final character:-
Sum required for obtaining Mahendra Bhaubali is 36
Sum required for obtaining Amrendra Bhaubali is 24
Sum required for obtaining Katappa is 12
The lowest character is soldier
Your final character is Mahendra bhaubali-Rank 1
Press 1 to continue
1
You are already doing very well. You just need to compete with yourself
All the other things you require are already told to you.
Just keep working hard . Thank you for using study planner
MODIFIED PROJECT
import java.util.Scanner;
public class project_study_planner
{//start of class
static int sum_mb=0;//total sum which is required for mahendra bahubali
static int sum_ab=0;//total sum which is required for amrendra bahubali
static int sum_kat=0;//total sum which is required for katappa
static double sum;
static int rank;
public static void main()
{//start of main
System.out.println(“\f”);
Scanner sc = new Scanner(System.in);
project_study_planner obj = new project_study_planner();
System.out.println(“RULES:”);
System.out.println(“If you sleep for more than 8 hours or less than 6.5 hours 2 points will be deducted”);
System.out.println(“If you follow the time timetable continuously then the score will be added in arithmetic progression(means 1 point for day 1 ,2 poits for day 2)”);
System.out.println(“It will become 0 if you do not follow your timetable on any day”);
System.out.println(“For every hour of study, 2 points will be added”);
System.out.println(“Please enter 2 to continue”);
int cont1 = sc.nextInt();
if(cont1==2)
{
System.out.println(“Please enter your first name”);
String name = sc.next();
System.out.println(“Please enter your last name”);
String last_name = sc.next();
System.out.println(“Please enter the number of days or which your score is to be checked”);
int num=sc.nextInt();
double sum_pfhos = 0;//For the analysis of the score at the end
double sum_sleep = 0;//For the analysis of the score at the end
double pfhos;//For the analysis of the score at the end
sum=0;
int pot=0;//points for timetable
double poos;//points for sleep
int n=1;//For writing the day number at the start of each day
double nod_sleep;//For figuring out the number of days for which he sleeps
int pfhosmb;//points for hours of study for obtaining mahendra bahubali
int pfhosab;//points for hours of study for obtaining amrendra bahubali
int pfhoskat;//pounts for hours of study for obtaining katappa
int timetable_max=0;//total maximum points for timetable required
sum_mb=0;//total sum which is required for mahendra bahubali
sum_ab=0;//total sum which is required for amrendra bahubali
sum_kat=0;//total sum which is required for katappa
for(int i=1;i8||nohslept24)
{
i–;n–;//since the score for that day should not be counted
poos=0;
pfhos=0;
timetable=0;//since no points should be given for a day which is not counted
System.out.println(“Please do not joke around”) ;
System.out.println(“You need to be honest while using this study planner”);
System.out.println(“We are taking your statistics for this day again , but please be honest this time”);
continue;//to skip all the statements below it
}
sum=sum+poos+pot+pfhos;
pfhosmb=2*6;//since for mahendra bahubali he should do atleast 6 hours of study everyday at an average
pfhosab = 2*5;//since amrendra bahubali should be atlesast 5 hours
pfhoskat = 2*4;//since katappa should be atleast 4 hours
++timetable_max;//because it always has to increase for obtaining maximum number possible for timetable
sum_mb=sum_mb+pfhosmb+timetable_max-2;
sum_ab=sum_ab+pfhosab+timetable_max-4;
sum_kat=sum_kat+pfhoskat+timetable_max-6;
sum_pfhos = sum_pfhos + pfhos; //for analysing and showing the total number of hours studied for the final report card
sum_sleep = sum_sleep+poos;//for finding the total number of days when sleep is not adequate(will be completed later in the programme)
}
System.out.println(“Your score is “+sum);
System.out.println(“There are 4 levels of characters which you will be rewarded “);
System.out.println(“To look at your progress and analyse the things you need to improve at,enter 1. “);
System.out.println(“If you do not want to analyse ,enter 2”);
int analyse = sc.nextInt();
if(analyse==1)
{
System.out.println(“SCORE ANALYSIS:-“);
System.out.println(“Total study points in “+num+”days is -:”+sum_pfhos+”hours”);
nod_sleep = sum_sleep/-2;//dividing by 2 will give us the number of days the sleeping hours are not proper
System.out.println(“You have slept outside the recommended time for “+nod_sleep+” days”);
System.out.println(“To look at your final report card, enter 1”);
int f_report = sc.nextInt();//int final report
if(f_report==1)
{
System.out.println(“Name:”+name+” “+last_name);
System.out.println(“Remarks:”);
System.out.println();
System.out.println(“STUDY TIME”);
if(sum_pfhos=0.5)//if he sleeps for the wrong duration for more than or equal to half the days
{
System.out.println(“You must mantain a proper sleep schedule”);
System.out.println(“It would definetely help you in increasing your productivity a lot”);
}
else{System.out.println(“Good job. you are mantaining a great sleep schedule”);}
System.out.println();//to leave 1 line for a neater programme
System.out.println();//to leave 1 line for a neater programme
System.out.println(“FOLLOWING TIMETABLE”);
if(pot=sum_mb)
{
obj.Mahendra_Bahubali();
}
else if(sum>=sum_ab)
{
obj.Amrendra_Bahubali();
}
else if(sum>=sum_kat)
{obj.Katappa();
}
else
{
obj.Soldier();
}
}//end of main
void Mahendra_Bahubali()
{ System.out.println();//leave a line to make the programme look neater
String f_character=”Mahendra bhaubali”;
rank=1;
System.out.println(“Your character is Mahendra Bahubali which is rank “+rank);
Scanner scanne = new Scanner (System.in);
System.out.println(“To continue , enter 1”);
int cont_2 = scanne.nextInt();
if(cont_2==1){
String rank_character = “Rank “+rank;
System.out.println(“You are already doing very well. You just need to compete with yourself”);
System.out.println(“All the other things you require are already told to you.”);
System.out.println(“Just keep working hard . Thank you for usng study planner”);}else{;}
}
void Amrendra_Bahubali()
{System.out.println();//leave a line to make the programme look neater
rank = 2;
System.out.println(“Your character is Amrendra Bahubali which is rank “+rank);
System.out.println(“You need to work hard for rank 1”);
double increase1 = sum_mb-sum;
Scanner sca = new Scanner (System.in);
System.out.println(“To continue , enter 1”);
int cont_2 = sca.nextInt();
if(cont_2==1)
{System.out.println();//leave a line to make the programme look neater
System.out.println(“You need to score “+increase1 + ” more marks for obtaining rank 1″ );
System.out.println();
System.out.println(“Thank you for using study planner”);
System.out.println(“Hope that you can reach your target of rank 1 soon”);
System.out.println(“All the best. Phod ke aana”);
}
else{;}//else for continue
}
void Katappa()
{
rank = 3;
System.out.println(“Your character is Katappa which is rank “+rank);
Scanner scan = new Scanner (System.in);
System.out.println(“To continue , enter 1”);
int cont_2 = scan.nextInt();
if(cont_2==1)
{
System.out.println(“You now need to work for rank 2”);
double increase2 = sum_ab-sum;
System.out.println(“You need to score “+increase2 + ” more marks for obtaining rank 2″ );
System.out.println();
System.out.println(“Thank you for using study planner”);
System.out.println(“Hope that you can reach your target of rank 2 soon”);
System.out.println(“All the best. PHOD KE AANA”);
}
else{;}
}
void Soldier()
{rank = 4;
System.out.println(“Your character is Soldier which is rank “+rank);
Scanner scann = new Scanner (System.in);
System.out.println(“To continue , enter 1”);
int cont_2 = scann.nextInt();
if(cont_2==1)
{
System.out.println(“You now need to work for rank 3”);
double increase3 = sum_kat-sum;
System.out.println(“You need to score “+increase3 + ” more marks for obtaining rank 3″ );
System.out.println();
System.out.println(“Thank you for using study planner”);
System.out.println(“Hope that you can reach your target of rank 2 soon”);
System.out.println(“All the best. PHOD KE AANA”);}
else{;}
}
}//end of class
School report card by the name of the students subject marks grade and the percentage
Approved
Name : Divyanshi Mehar
Grade:10
Div:C
Project title : Online movie booking
Project description: In this program the , the user will be able to book a movie from the different movies ,it will show the theatres in which the movie is available , the user can select number of tickets and it will the cost of all the tickets including GST .
Approved
NAME: Carol Thakkar
GRADE : X DIV: A
PROJECT TITLE: Savings Bank Account
DESCRIPTION: This program will allow you to create a new account ,deposit or withdraw money and to check the current balance in your account.
Approved
Rejected
Name : Arwa Rajkotwala
Grade : 10
Div : C
Project Title : One Teaspoon Happiness
Description : The project is about home delivery of food during this critical stage where no one can get out of their houses. the food will be provided with reduced prices . The project will take inputs from the user about which meal they want , how many mels they want and their area they live in.
Name : – Ananya Sridhar
Grade : – 10
Div :- C
Project Title : – HANGMAN
Project Description :- This is a model of the classic hangman game which would be available to play in 3 difficulty levels following all the rules and regulations of the actual hangman game.
REVISED PROJECT INFO
Name : Ananya Sridhar
Class : X-C
Roll No : 4
Project Title : Covid_Simulation
Description : Today,we are all living in a world plagued by covid 19.In such a situation, it is important for us to track the number of cases and plan for the future.This is a basic simulation in which the scenarios during complete lockdown , no lockdown and partial lockdown could be observed with suitable input from user i.e initial number of cases ,status (lockdown ,no lockdown……)and no. of days after spread.
import java.util.Scanner;
public class Covid_Simulation
{
static double patients, day, option, death, rec, red=0, infected=0;
static long total_cases, deaths, recs ;
static Covid_Simulation cov = new Covid_Simulation();
static Scanner sc = new Scanner System.in();
void track()
{
if(option==1)
{
infected = 1.5;
red = 4/5.0;
System.out.println(“Status : Without lockdown\n”);
}//end of if block
else if(option==2)
{
infected = 1;
red = 3/4.0;
System.out.println(“Status : With partial lockdown\n”);
}//end of else if block 1
else if(option==3)
{
infected = 0.5;
red = 2/5.0;
System.out.println(“Status : With lockdown\n”);
}//end of else if block 2
for(long i = 2; i0 && option<=3)
{
cov.track();
}//end of if block
else
{
System.out.println("WRONG INPUT!!");
System.out.println("\f");
System.out.println("Do you want to retry?\nYES:1\nNO:Any other key");
int ch = sc.nextInt();
if(ch==1)
{
cov.main();
}//end of if block
else
{
System.out.println("~*~*~*~*~*~*~*~*~*~STAY HOME<STAY SAFE!~*~*~*~*~*~*~*~*~");
System.exit(0);
}//end of else block
}//end of else block
}//end of void choice
}//end of class
Name :-Sai Chaudhari
Grade :-10
Division :-C
PROJECT TITLE :-Calculator
DESCRIPTION:-My project is for calculating a sum exactly like a calculator.It includes all the basic arithmetic operations and it runs continuously.
Approved
NAME:- Rujula Chohan
STD:- X DIV:-A
PROJECT TITLE:- Cake Shop
DESCRIPTION:-This program will allow the user to select a cake according to their choice.
There will be many choices such as size(1Kg , 1/2Kg etc) , flavor(vanilla , chocolate ,strawberry etc) , shape(circle , square etc) , icing on the top (Birthday or anniversary) , home delivery , candles and many more options.
The program will also allow the user to give their feedback.
Then it will calculate and print the bill.
Approved
PROGRAM CODE:
import java.util.Scanner;
public class CAKE_SHOP
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.print(“~~~~~~WELCOME TO WONDERFUL CAKE SHOP~~~~~~”);
System.out.print(“\nEnter your name:”);//name of the customer
String name=sc.nextLine();
System.out.print(“\nEnter the occasion:”);//occasion-eg.birthday,anniversay,wedding etc.
String occa=sc.nextLine();
System.out.print(“\nWrite the message which is to be written on the top:”);//eg.Happy Birthday to ___
String message=sc.nextLine();
System.out.println();//to leave a line
System.out.println(“*FLAVOUR*”);
System.out.println(“1-Red Velvet Cake”);
System.out.println(“2-Devil’s Delite Cake(Chocolate)”);
System.out.println(“3-Fresh Fruit Cake”);
System.out.println(“4-Black Forest Cake”);
System.out.println(“5-Cheese Cake”);
System.out.println(“6-Mango Mousse Cake”);
System.out.println(“7-Chiffon Cake(Vanilla)”);
System.out.println(“8-Butter Scotch Cake”);
System.out.println(“9-Rainbow Cake”);
System.out.println(“10-Rasmalai Cake”);
System.out.print(“Enter the flavour number:”);
int flav=sc.nextInt();
System.out.println();//to leave a line
String cake_name=””;//name of the cake which the customer selects
if(flav10)//input cannot be less than 0 or more than 10
{
System.out.println(“Wrong input!!!!!!”);
System.out.println(“It seems you have choosen the wrong option.”);
System.out.println(“The program will end in few seconds.”);
System.out.println(“Kindly come again and choose the correct option number.”);
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
}
double cake_price=0;//price of the cake according to their weight(kg)
int size;
String size_name="";//prints the size of the cake which the customer selects(1/2kg,1Kg…etc)
switch(flav)
{
case 1://red velvet
{
cake_name="Red Velvet Cake";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.350");
System.out.println("2= 1Kg———Rs.700");
System.out.println("3= 1.5Kg——-Rs.1050");
System.out.println("4= 2Kg———Rs.1400");
System.out.println("5= 3Kg———Rs.1750");
System.out.println("6= 5Kg———Rs.3150");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Red velvet
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=350;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=700;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=1050;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1400;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1750;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=3150;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 2://devil's delite
{
cake_name="Devil's Delite Cake(Chocolate)";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.250");
System.out.println("2= 1Kg———Rs.500");
System.out.println("3= 1.5Kg——-Rs.750");
System.out.println("4= 2Kg———Rs.1000");
System.out.println("5= 3Kg———Rs.1500");
System.out.println("6= 5Kg———Rs.2500");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Devil's Delite
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=250;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=500;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=750;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1000;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1500;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=2500;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 3://fresh fruit
{
cake_name="Fresh Fruit";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.300");
System.out.println("2= 1Kg———Rs.600");
System.out.println("3= 1.5Kg——-Rs.900");
System.out.println("4= 2Kg———Rs.1200");
System.out.println("5= 3Kg———Rs.1800");
System.out.println("6= 5Kg———Rs.3000");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Fresh fruit
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=300;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=600;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=900;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1200;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1800;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=3000;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 4://black forest
{
cake_name="Black Forest Cake";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.200");
System.out.println("2= 1Kg———Rs.400");
System.out.println("3= 1.5Kg——-Rs.600");
System.out.println("4= 2Kg———Rs.800");
System.out.println("5= 3Kg———Rs.1200");
System.out.println("6= 5Kg———Rs.2800");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Black Forest Cake
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=200;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=400;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=600;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=800;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1200;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=2800;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 5://cheese cake
{
cake_name="Cheese Cake";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.300");
System.out.println("2= 1Kg———Rs.600");
System.out.println("3= 1.5Kg——-Rs.900");
System.out.println("4= 2Kg———Rs.1200");
System.out.println("5= 3Kg———Rs.1800");
System.out.println("6= 5Kg———Rs.3000");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//cheese cake
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=300;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=600;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=900;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1200;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1800;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=3000;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.k
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 6://mango mousse
{
cake_name="Mango Mousse Cake";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.200");
System.out.println("2= 1Kg———Rs.400");
System.out.println("3= 1.5Kg——-Rs.600");
System.out.println("4= 2Kg———Rs.800");
System.out.println("5= 3Kg———Rs.1200");
System.out.println("6= 5Kg———Rs.2800");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Mango Mousse Cake
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=200;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=400;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=600;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=800;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1200;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=2800;
break;
}
default:
{
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 7://chiffon
{
cake_name="Chiffon";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.400");
System.out.println("2= 1Kg———Rs.800");
System.out.println("3= 1.5Kg——-Rs.1200");
System.out.println("4= 2Kg———Rs.1600");
System.out.println("5= 3Kg———Rs.2400");
System.out.println("6= 5Kg———Rs.4000");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Chiffon
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=400;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=800;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=1200;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1600;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=2400;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=4000;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 8://butter scotch
{
cake_name="Butter Scotch";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.250");
System.out.println("2= 1Kg———Rs.500");
System.out.println("3= 1.5Kg——-Rs.750");
System.out.println("4= 2Kg———Rs.1000");
System.out.println("5= 3Kg———Rs.1500");
System.out.println("6= 5Kg———Rs.2500");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Butter scotch
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=250;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=500;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=750;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1000;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1500;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=2500;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 9://rainbow
{
cake_name="Rainbow Cake";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.400");
System.out.println("2= 1Kg———Rs.800");
System.out.println("3= 1.5Kg——-Rs.1200");
System.out.println("4= 2Kg———Rs.1600");
System.out.println("5= 3Kg———Rs.2400");
System.out.println("6= 5Kg———Rs.4000");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Rainbow Cake
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=400;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=800;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=1200;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1600;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=2400;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=4000;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
case 10://rasmalai
{
cake_name="Rasmalai Cake";
System.out.println("*SIZE & PRICES*");
System.out.println("1= 1/2Kg——-Rs.350");
System.out.println("2= 1Kg———Rs.700");
System.out.println("3= 1.5Kg——-Rs.1050");
System.out.println("4= 2Kg———Rs.1400");
System.out.println("5= 3Kg———Rs.1750");
System.out.println("6= 5Kg———Rs.3150");
System.out.print("Enter the size number=");
size=sc.nextInt();
switch(size)//Rasmalai cake
{
case 1:// 1/2kg
{
size_name="1/2 Kg";
cake_price=350;
break;
}
case 2:// 1kg
{
size_name="1 Kg";
cake_price=700;
break;
}
case 3:// 1.5kg
{
size_name="1.5 Kg";
cake_price=1050;
break;
}
case 4:// 2kg
{
size_name="2 Kg";
cake_price=1400;
break;
}
case 5:// 3kg
{
size_name="3 Kg";
cake_price=1750;
break;
}
case 6:// 5kg
{
size_name="5 Kg";
cake_price=3150;
break;
}
default:
{
System.out.println("Wrong input!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
break;
}
default:
{
System.out.println("Wrong input!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
System.out.println();//to leave a line
System.out.println("*SHAPE*");
System.out.println("1-Circle");
System.out.println("2-Rectangle");
System.out.println("3-Square");
System.out.println("4-Heart");
System.out.println("5-Cartoon Character—(extra charge=Rs.500)");
System.out.println("6-Other—————(extra charge=Rs.500)");
System.out.print("Enter the shape number:");
int shape=sc.nextInt();
double extra_shape_cost=0;
String shape_name="";//prints the shape of the cake which the customer selects
switch(shape)
{
case 1://circle
{
shape_name="Circle";
extra_shape_cost=0;
break;
}
case 2://rectangle
{
shape_name="Rectangle";
extra_shape_cost=0;
break;
}
case 3://square
{
shape_name="Square";
extra_shape_cost=0;
break;
}
case 4://heart
{
shape_name="Heart";
extra_shape_cost=0;
break;
}
case 5://cartoon character
{
System.out.print("Name the cartoon character(Note:In one word ONLY):");
extra_shape_cost=500;
String cartoon=sc.next();//stores the name of the required cartoon character
shape_name=cartoon;//assigns the cartoon name to the common variable(shape_name)
break;
}
case 6://other shape
{
System.out.print("Name the desired shape:(In one word ONLY)");
extra_shape_cost=500;
String other_shape=sc.next();//stores the name of the required object(eg-any instrument)
shape_name=other_shape;//assigns the object name to the common variable(shape_name)
break;
}
default :
{
System.out.println("Wrong input!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
System.out.println();//to leave a line
System.out.println("*TIER*");
System.out.println("1-No tier");
System.out.println("2-Two tier—–(extra charge-Rs.500)");
System.out.println("3-Three tier—(extra charge-Rs.1000)");
System.out.print("Enter the number of tier:");
int tier=sc.nextInt();
double cost_tier=0;
String tier_name="";//prints the number tiers the customer wants
switch(tier)
{
case 1://no tier
{
cost_tier=0;
tier_name="No tier";
break;
}
case 2://two tier
{
cost_tier=500;
tier_name="Two tier";
break;
}
case 3://three tier
{
cost_tier=1000;
tier_name="Three tier";
break;
}
default :
{
System.out.println("Wrong input!!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
System.out.println();//to leave a line
System.out.println("*CAKE SPRINKLES*");
System.out.println("1-None");
System.out.println("2-Choco Chips——————–(extra charge)Rs.20");
System.out.println("3-Dry Fruits(Almonds & Walnuts)–(extra charge)Rs.30");
System.out.println("4-Quins————————–(extra charge)Rs.20");
System.out.println("5-Powdered Sugar—————–(extra charge)Rs.10");
System.out.println("6-Pop Crackers——————-(extra charge)Rs.20");
System.out.print("Enter the type of cake sprinkle required:");
int sprinkle=sc.nextInt();
double cost_sprinkle=0;//stores the cost of the sprinkler
String sprinkle_name="";//prints the name of the cake sprinkle which the customer selects
switch(sprinkle)
{
case 1://none
{
cost_sprinkle=0;
sprinkle_name="None";
break;
}
case 2://choco chips
{
cost_sprinkle=20;
sprinkle_name="chocochips";
break;
}
case 3://dry fruits
{
cost_sprinkle=30;
sprinkle_name="Dry fruits";
break;
}
case 4://quins
{
cost_sprinkle=20;
sprinkle_name="Quins";
break;
}
case 5://powdered sugar
{
cost_sprinkle=10;
sprinkle_name="Powdered sugar";
break;
}
case 6://pop crackers
{
cost_sprinkle=20;
sprinkle_name="Pop Crackers";
break;
}
default :
{
System.out.println("Wrong input!!!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
System.out.println();//to leave a line
System.out.println("*ICING ON TOP*");
System.out.println("1-None");
System.out.println("2-Chocolate");
System.out.println("3-Vanilla");
System.out.print("Enter the icing type:");
int icing=sc.nextInt();
String icing_name="";//prints the flavour of the icing
switch(icing)
{
case 1://none
{
icing_name="None";
break;
}
case 2://chocolate
{
icing_name="Chocolate";
break;
}
case 3://vanilla
{
icing_name="Vanilla";
break;
}
default :
{
System.out.println("Wrong input!!!!!!!!!");
System.out.println("It seems you have choosen the wrong option.");
System.out.println("The program will end in few seconds.");
System.out.println("Kindly come again and choose the correct option number.");
for(double i=1;i<=2000000000;i++)//to give the customer sufficient amount of time to read the above message.
{
if(i==2000000000)//the program will terminate when the condition is satisfied.
{
System.exit(0);
}
}
break;
}
}
System.out.print("Enter the number of candles required(Rs.5 for 1 candle):");
int candle=sc.nextInt();
double cost_candle=candle*5;//will calculate the total cost of the candles
System.out.println();//to leave a line
//FEEDBACK
System.out.println("\f");
System.out.println("*****FEEDBACK****");
System.out.println("Enter your feedback.\nIt will help us to improve our service:)");
String feed=sc.next();
// BILL CALCULATION
double total_cost=cake_price+cost_tier+cost_sprinkle+cost_candle+extra_shape_cost;//addition of all the materials chosen by the customer
double GST=(total_cost*(6.0/100.0));//GST%=6%
double final_cost=total_cost+GST;//adds the GST value to the total cost
// PRINTING BILL
System.out.println("\f**************WONDERFUL CAKE SHOP**************");
System.out.println("~~~~~~~~~~~~~~~~~~~~~~BILL~~~~~~~~~~~~~~~~~~~~~~");
System.out.println("Name of the customer:"+name);
System.out.println("Occasion:"+occa);
System.out.println("Message on top:"+message);
System.out.println("Cake Type:"+cake_name);
System.out.println("");//to leave a line;
System.out.println("Cake Shape:"+shape_name);
System.out.println("Extra cost of the shape:Rs."+extra_shape_cost);
System.out.println("Cake Price:Rs."+cake_price);
System.out.println("Weight of the cake:"+size_name);
System.out.println("");//to leave a line;
System.out.println("Number of tiers:"+tier_name);
System.out.println("Cost of the tier:Rs."+cost_tier);
System.out.println("");//to leave a line;
System.out.println("Sprinkler:"+sprinkle_name+"=Rs."+cost_sprinkle);
System.out.println("Icing Flavour:"+icing_name);
System.out.println("Number of candles:"+candle+"\tRs."+cost_candle);
System.out.println("");//to leave a line;
System.out.println("GST% = 6%");
System.out.println("GST:Rs."+GST);
System.out.println("TOTAL AMOUNT:Rs."+final_cost);
System.out.println("~~~~~~~~~~~~~~~~~~VISIT AGAIN~~~~~~~~~~~~~~~~~~");
}
}
PROGRAM OUPUT:
~~~~~~WELCOME TO WONDERFUL CAKE SHOP~~~~~~
Enter your name:Rujula Chohan
Enter the occasion:Birthday
Write the message which is to be written on the top:Happy Birthday to me!
*FLAVOUR*
1-Red Velvet Cake
2-Devil’s Delite Cake(Chocolate)
3-Fresh Fruit Cake
4-Black Forest Cake
5-Cheese Cake
6-Mango Mousse Cake
7-Chiffon Cake(Vanilla)
8-Butter Scotch Cake
9-Rainbow Cake
10-Rasmalai Cake
Enter the flavour number:10
*SIZE & PRICES*
1= 1/2Kg——-Rs.350
2= 1Kg———Rs.700
3= 1.5Kg——-Rs.1050
4= 2Kg———Rs.1400
5= 3Kg———Rs.1750
6= 5Kg———Rs.3150
Enter the size number=2
*SHAPE*
1-Circle
2-Rectangle
3-Square
4-Heart
5-Cartoon Character—(extra charge=Rs.500)
6-Other—————(extra charge=Rs.500)
Enter the shape number:5
Name the cartoon character(Note:In one word ONLY):Doraemon
*TIER*
1-No tier
2-Two tier—–(extra charge-Rs.500)
3-Three tier—(extra charge-Rs.1000)
Enter the number of tier:2
*CAKE SPRINKLES*
1-None
2-Choco Chips——————–(extra charge)Rs.20
3-Dry Fruits(Almonds & Walnuts)–(extra charge)Rs.30
4-Quins————————–(extra charge)Rs.20
5-Powdered Sugar—————–(extra charge)Rs.10
6-Pop Crackers——————-(extra charge)Rs.20
Enter the type of cake sprinkle required:1
*ICING ON TOP*
1-None
2-Chocolate
3-Vanilla
Enter the icing type:3
Enter the number of candles required(Rs.5 for 1 candle):16
*****FEEDBACK****
Enter your feedback.
It will help us to improve our service:)
Great service and delicious cake varieties.Would like to request for homedelivery if possible.Thank you.
**************WONDERFUL CAKE SHOP**************
~~~~~~~~~~~~~~~~~~~~~~BILL~~~~~~~~~~~~~~~~~~~~~~
Name of the customer:Rujula Chohan
Occasion:Birthday
Message on top:Happy Birthday to me!
Cake Type:Rasmalai Cake
Cake Shape:Doraemon
Extra cost of the shape:Rs.500.0
Cake Price:Rs.700.0
Weight of the cake:1 Kg
Number of tiers:Two tier
Cost of the tier:Rs.500.0
Sprinkler:None=Rs.0.0
Icing Flavour:Vanilla
Number of candles:16 Rs.80.0
GST% = 6%
GST:Rs.106.8
TOTAL AMOUNT:Rs.1886.8
~~~~~~~~~~~~~~~~~~VISIT AGAIN~~~~~~~~~~~~~~~~~~
Name: Grishma Gudhka
Grade: 10 Div: A
Project Tittle : Shape_Area_Tutorial
Project Description : This project shows the various geometry such as triangle , square, rhombus and calculate its area. This project will draw the shape and calculate its area.
project code:-
import java.util.Scanner;
public class Shape_Area_Tutorial
{
public void rom(int h)//method for printing RHOMBUS pattern
{
for(int i =1;i<=h/2;i++)//start of outer for loop part-1
{
for(int j=1;j<=h/2-i;j++)//start of inner for loop part-1
{
System.out.print(" ");
}//end of inner for loop part-1
for(int k =1;k=1;l–)//start of inner for loop part-3
{
System.out.print(l);
}//end of inner for loop part-3
System.out.println();
}//end of outer for loop part-1
for(int i =1;i<=h/2;i++)//start of inner for loop part-2
{
for(int j=1;j<=i;j++)//start of inner for loop part-1
{
System.out.print(" ");
}//end of inner for loop part-1
for(int k=1;k0;l–)//start of inner for loop part-3
{
System.out.print(l);
}//end of inner for loop part-3
System.out.println();
}
double d1=2*h;double d2=2*h-1;//to find area
double area= 0.5*d1*d2;//to find area
System.out.println(“\nThe AREA of the RHOMBUS is 1/2*product of diagonals” );//to tell the use about area
System.out.println(“\nIn the above RHOMBUS Diagonal 1 is “+d1+” units and Diagonal 2 is “+d2+” units”);//formula
System.out.println(” For the above figure AREA is “+area);//to print area
}// end method for printing RHOMBUS pattern
public void triangle(int h)//method for printing triangle pattern
{
for(int i=1;i<=h;i++)//start of outer for loop
{
for( int j=1;j<=i;j++)//start of inner for loop
{
System.out.print(j+" ");
}//end of inner for loop
System.out.println();
}//end of outer for loop
double area = 0.5*h*h;//to find area
System.out.println("\nThe AREA of the TRIANGLES is 1/2*b*h" );//to tell the use about area
System.out.println("\nIn the above Triangle base and height are "+h+" units");//formula
System.out.println(" For the above figure AREA is "+area);//to print area
}// end method for printing triangle pattern
public void quad(int l,int b)//method for printing square pattern
{
for(int i=1;i<=l;i++)//start of outer for loop
{
for( int j=1;j<=b;j++)
{//start of inner for loop
System.out.print(i+" ");
}//end of inner for loop
System.out.println();
}//end of outer for loop
double area = l*b;//to find area
System.out.println("\nThe AREA of the QUADRILATERAL is l*b ");//to tell the use about area
System.out.println("\n In the above QUADRILATERAL length is "+l+" units and breadth is "+b+" units");//formula
System.out.println(" For the above figure AREA is "+area);//to print area
}// end method for printing square pattern
public static void main()
{
System.out.println("\f");//to clear screen
Scanner sc= new Scanner (System.in);//object of scanner
System.out.println("@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @");
System.out.println("\t\tWELCOME TO THE PROGRAMME");
System.out.println("\t\tYOU have to choices for PATTENS");
System.out.println("\t\tThey are :-");
System.out.println("\t\t1- TRIANGLES");
System.out.println("\t\t2- QUADRILATERAL");
System.out.println("\t\t3- RHOMBUS ");
System.out.println("@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @");
System.out.println("Enter your choice");
int ch = sc.nextInt();
Shape_Area_Tutorial obj = new Shape_Area_Tutorial();//object of Shape_Area_Tutorial
switch(ch)
{
case 1 :
{
System.out.println("Enter the HEIGHT");
int h = sc.nextInt();
obj.triangle(h);//method call for triangle pattern
break;
}
case 2 :
{
System.out.println("Enter the lENGTH");
int l = sc.nextInt();
System.out.println("Enter the BREADTH");
int b = sc.nextInt();
obj.quad(l,b);//object call for QUADRILATERAL pattern
break;
}
case 3 :
{
System.out.println("Enter the HEIGHT");
int h = sc.nextInt();
obj.rom(h);//object call for rhombus pattern
break;
}
default :
{
System.out.println("WRONG INPUT !!!!!");
}
}//end o switch
}//end of main
}//end of class
Project code:
import java.util.Scanner;
public class Shape_Area_Tutorial
{
public void rom(int h)//method for printing RHOMBUS pattern
{
for(int i =1;i<=h/2;i++)//start of outer for loop part-1
{
for(int j=1;j<=h/2-i;j++)//start of inner for loop part-1
{
System.out.print(" ");
}//end of inner for loop part-1
for(int k =1;k=1;l–)//start of inner for loop part-3
{
System.out.print(l);
}//end of inner for loop part-3
System.out.println();
}//end of outer for loop part-1
for(int i =1;i<=h/2;i++)//start of inner for loop part-2
{
for(int j=1;j<=i;j++)//start of inner for loop part-1
{
System.out.print(" ");
}//end of inner for loop part-1
for(int k=1;k0;l–)//start of inner for loop part-3
{
System.out.print(l);
}//end of inner for loop part-3
System.out.println();
}
double d1=2*h;double d2=2*h-1;//to find area
double area= 0.5*d1*d2;//to find area
System.out.println(“\nThe AREA of the RHOMBUS is 1/2*product of diagonals” );//to tell the use about area
System.out.println(“\nIn the above RHOMBUS Diagonal 1 is “+d1+” units and Diagonal 2 is “+d2+” units”);//formula
System.out.println(” For the above figure AREA is “+area);//to print area
}// end method for printing RHOMBUS pattern
public void triangle(int h)//method for printing triangle pattern
{
for(int i=1;i<=h;i++)//start of outer for loop
{
for( int j=1;j<=i;j++)//start of inner for loop
{
System.out.print(j+" ");
}//end of inner for loop
System.out.println();
}//end of outer for loop
double area = 0.5*h*h;//to find area
System.out.println("\nThe AREA of the TRIANGLES is 1/2*b*h" );//to tell the use about area
System.out.println("\nIn the above Triangle base and height are "+h+" units");//formula
System.out.println(" For the above figure AREA is "+area);//to print area
}// end method for printing triangle pattern
public void quad(int l,int b)//method for printing square pattern
{
for(int i=1;i<=l;i++)//start of outer for loop
{
for( int j=1;j<=b;j++)
{//start of inner for loop
System.out.print(i+" ");
}//end of inner for loop
System.out.println();
}//end of outer for loop
double area = l*b;//to find area
System.out.println("\nThe AREA of the QUADRILATERAL is l*b ");//to tell the use about area
System.out.println("\n In the above QUADRILATERAL length is "+l+" units and breadth is "+b+" units");//formula
System.out.println(" For the above figure AREA is "+area);//to print area
}// end method for printing square pattern
public static void main()
{
System.out.println("\f");//to clear screen
Scanner sc= new Scanner (System.in);//object of scanner
System.out.println("@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @");
System.out.println("\t\tWELCOME TO THE PROGRAMME");
System.out.println("\t\tYOU have to choices for PATTENS");
System.out.println("\t\tThey are :-");
System.out.println("\t\t1- TRIANGLES");
System.out.println("\t\t2- QUADRILATERAL");
System.out.println("\t\t3- RHOMBUS ");
System.out.println("@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @");
System.out.println("Enter your choice");
int ch = sc.nextInt();
Shape_Area_Tutorial obj = new Shape_Area_Tutorial();//object of Shape_Area_Tutorial
switch(ch)
{
case 1 :
{
System.out.println("Enter the HEIGHT");
int h = sc.nextInt();
obj.triangle(h);//method call for triangle pattern
break;
}
case 2 :
{
System.out.println("Enter the lENGTH");
int l = sc.nextInt();
System.out.println("Enter the BREADTH");
int b = sc.nextInt();
obj.quad(l,b);//object call for QUADRILATERAL pattern
break;
}
case 3 :
{
System.out.println("Enter the HEIGHT");
int h = sc.nextInt();
obj.rom(h);//object call for rhombus pattern
break;
}
default :
{
System.out.println("WRONG INPUT !!!!!");
}
}//end o switch
}//end of main
}//end of class
Std 10 , Div : B
Project title : Beauty Salon
Project description : This program will allow the user to choose whether to have a hair cut, hair spa, head massage or a combination of the three services. It will be followed by efficient billing services also.
– Vaishnavi
– Vaishnavi
Approved
Vaishnavi Singh
Project code :-
import java.util.Scanner;
public class Project
{
public static Scanner sc = new Scanner(System.in);
static double price, gst, totamt;
static String packname = ” “;
public static void main()
{
System.out.println(“\f”);
System.out.println(“~~~~List of packages~~~~”);
System.out.println(“\n”);
System.out.println(“1 – Hair cut”);
System.out.println(“2 – Hair spa”);
System.out.println(“3 – Head massage”);
System.out.println(“4 – Combo”);
System.out.println(“5 – Hair care”);
System.out.println(“\n”);
System.out.println(“Please enter your choice”);
int ch = sc.nextInt();
switch(ch)
{
case 1:
{ packname = (“Hair cut”);
price = 500;
printbill();
break;
}//end of case 1 hair cut
case 2:
{ packname = (“Hair spa”);
price = 1200;
printbill();
break;
}//end of case 2 hair spa
case 3:
{ packname = (“Head massage”);
price = 800;
printbill();
break;
}//end of case 3 head massage
case 4:
{ packname = (“Combo”);
price = 2300;
printbill();
break;
}//end of case 4 Combo
case 5:
{ packname = (“Hair care”);
price = 1600;
printbill();
break;
}//end of case 5 Hair care
default:
{ System.out.println(“Wrong choice”);
}//end of default
}//end of switch
}//end of main
public static void printbill()
{
gst = price*0.18; //18%gst
totamt = price + gst;
System.out.println(“\n”);
System.out.println(“**Welcome to NEW LOOKS hair salon**”);
System.out.println(“\n”);
System.out.println(“~~~~Your bill~~~~”);
System.out.println(“Package name: “+packname);
System.out.println(“Package price: “+price);
System.out.println(“GST@18% : “+gst);
System.out.println(“Total amount: “+totamt);
System.out.println(“\n”);
System.out.println(“~~~~Thank you and visit again~~~~”);
}//end of printbill
}
Output (example) :-
~~~~List of packages~~~~
1 – Hair cut
2 – Hair spa
3 – Head massage
4 – Combo
5 – Hair care
Please enter your choice
4
**Welcome to NEW LOOKS hair salon**
~~~~Your bill~~~~
Package name: Combo
Package price: 2300.0
GST@18% : 414.0
Total amount: 2714.0
~~~~Thank you and visit again~~~~
Vaishnavi Singh
Project code :-
import java.util.Scanner;
public class Project
{
public static Scanner sc = new Scanner(System.in);
static double price, gst, totamt;
static String packname = ” “;
public static void main()
{
System.out.println(“\f”);
System.out.println(“~~~~List of packages~~~~”);
System.out.println(“\n”);
System.out.println(“1 – Hair cut”);
System.out.println(“2 – Hair spa”);
System.out.println(“3 – Head massage”);
System.out.println(“4 – Combo”);
System.out.println(“5 – Hair care”);
System.out.println(“\n”);
System.out.println(“Please enter your choice”);
int ch = sc.nextInt();
switch(ch)
{
case 1:
{ packname = (“Hair cut”);
price = 500;
printbill();
break;
}//end of case 1 hair cut
case 2:
{ packname = (“Hair spa”);
price = 1200;
printbill();
break;
}//end of case 2 hair spa
case 3:
{ packname = (“Head massage”);
price = 800;
printbill();
break;
}//end of case 3 head massage
case 4:
{ packname = (“Combo”);
price = 2300;
printbill();
break;
}//end of case 4 Combo
case 5:
{ packname = (“Hair care”);
price = 1600;
printbill();
break;
}//end of case 5 Hair care
default:
{ System.out.println(“Wrong choice”);
}//end of default
}//end of switch
}//end of main
public static void printbill()
{
gst = price*0.18; //18%gst
totamt = price + gst;
System.out.println(“\n”);
System.out.println(“**Welcome to NEW LOOKS hair salon**”);
System.out.println(“\n”);
System.out.println(“~~~~Your bill~~~~”);
System.out.println(“Package name: “+packname);
System.out.println(“Package price: “+price);
System.out.println(“GST@18% : “+gst);
System.out.println(“Total amount: “+totamt);
System.out.println(“\n”);
System.out.println(“~~~~Thank you and visit again~~~~”);
}//end of printbill
}
Output (example) :-
~~~~List of packages~~~~
1 – Hair cut
2 – Hair spa
3 – Head massage
4 – Combo
5 – Hair care
Please enter your choice
4
**Welcome to NEW LOOKS hair salon**
~~~~Your bill~~~~
Package name: Combo
Package price: 2300.0
GST@18% : 414.0
Total amount: 2714.0
~~~~Thank you and visit again~~~~
I have added more cases…..
NAME: AARUSH DESAI
STD: X DIV: A
PROJECT TITLE : RELAINCE JIO STORES
DESCRIPTION : This program gives choices to the users like to buy jio phone, jio sim card, jio-fi, and many other internet plans. It will take user input like name, address,etc. and their choice of what to buy. It will calculate the sum of final purchase with discounts and taxes and then display the final bill.
NAME – SHLOK .N. MISHRA
STD-10; DIV-B
PROJECT TITLE – Online_ Dr_Medical
DESCRIPTION – This program will give various options of headache,stomach ache,etc. It will give name of tablet according to the dosage low,medium or high.User will input information and the program will return with a bill .
Approved
/**
*THIS PROGRAM IS TO GIVE A BILL OF THE RECOMMENDED MEDICINE
*
* @author SHLOK MISHRA
* @date 22-4-20
*/
import java.util.Scanner;
public class Online_Dr_Medical
{
static String medname,redos;//global variable
public static void main()
{
System.out.println(“\f”);
Scanner sm=new Scanner(System.in);
System.out.println(“1- HEAD ACHE”);
System.out.println(“2- FEVER”);
System.out.println(“3- COLD”);
System.out.println(“4- LOOSE MOTIONS”);
System.out.println(“ENTER YOUR PROBLEM”);
int ch =sm.nextInt();
System.out.println(“ENTER DOSAGE”);
System.out.println(“1-LOW”);
System.out.println(“2-MEDIUM”);
System.out.println(“3-HIGH”);
int dos =sm.nextInt();
double prtab=0;
switch(ch){
case 1:
{
System.out.println(“PROBLEM- HEAD ACHE”);
switch(dos)
{
case 1:
{
System.out.println(“DOSAGE -LOW”);
prtab= 20;
medname=”CROCIN”;
System.out.println(“MEDICINE – CROCIN”);
System.out.println(“PRICE PER TABLET=20.0”);
break;
}
case 2:
{
System.out.println(“DOSAGE- MEDIUM”);
prtab=50;
medname=”PARACETAMOL”;
System.out.println(“MEDICINE – PARACETAMOL”);
System.out.println(“PRICE PER TABLET=50.0”);
break;
}
case 3:
{
System.out.println(“DOSAGE – HIGH”);
prtab=100;
medname=”ALEVE”;
System.out.println(“MEDICINE – ALEVE”);
System.out.println(“PRICE PER TABLET=100.0”);
break;
}
}//END OF NESTED SWITCH 1
break;
}//end of case 1
case 2 :
{
System.out.println(“PROBLEM – FEVER”);
switch(dos)
{
case 1:
{
System.out.println(“DOSAGE -LOW”);
prtab=20;
medname=”MORTIN IB”;
System.out.println(“MEDICINE – MORTIN IB “);
System.out.println(“PRICE PER TABLET=20.0”);
break;
}
case 2:
{
System.out.println(“DOSAGE- MEDIUM”);
prtab=50;
medname=”ADVIL”;
System.out.println(“MEDICINE – ADVIL”);
System.out.println(“PRICE PER TABLET=50.0”);
break;
}
case 3:
{
System.out.println(“DOSAGE – HIGH”);
prtab=100;
medname=”BUFFERIN”;
System.out.println(“MEDICINE – “);
System.out.println(“PRICE PER TABLET=100.0”);
break;
}
}//END OF NESTED SWITCH 2
break;
}//end of case 2
case 3:
{
System.out.println(“PROBLEM-COLD”);
switch(dos)
{
case 1:
{
System.out.println(“DOSAGE= LOW”);
prtab=20;
medname=”VICKS”;
System.out.println(“MEDICINE – VICKS”);
System.out.println(“PRICE PER TABLET=20.0”);
break;
}
case 2:
{
System.out.println(“DOSAGE- MEDIUM”);
prtab=50;
medname=”TYLENOL”;
System.out.println(“MEDICINE – TYLENOL”);
System.out.println(“PRICE PER TABLET=50.0”);
break;
}
case 3:
{
System.out.println(“DOSAGE – HIGH”);
prtab=100;
medname=”GENEXA”;
System.out.println(“MEDICINE – GENEXA”);
System.out.println(“PRICE PER TABLET=100.0”);
break;
}
}//END OF NESTED SWITCH 3
break;
}//end of case 3
case 4:
{
System.out.println(“PROBLEM – LOOSE MOTIONS”);
switch(dos)
{
case 1:
{
System.out.println(“DOSAGE -LOW”);
prtab=20;
medname=”LOMOTIL”;
System.out.println(“MEDICINE – LOMOTIL”);
System.out.println(“PRICE PER TABLET=20.0”);
break;
}
case 2:
{
System.out.println(“DOSAGE- MEDIUM”);
prtab=50;
medname=”NORFLOX”;
System.out.println(“MEDICINE – NORFLOX”);
System.out.println(“PRICE PER TABLET=50.0”);
break;
}
case 3:
{
System.out.println(“DOSAGE – HIGH”);
prtab=100;
medname=”ELDOPER”;
System.out.println(“MEDICINE – ELDOPER”);
System.out.println(“PRICE PER TABLET=100.0”);
break;
}
} //END OF NESTED SWITCH 4
break;
}//end of case 4
default:
{
System.out.println(“WRONG INPUT!!!”);
}
}//end of switch
System.out.println(“ENTER NUMBER OF TABLETS TO BUY-“);
int notab =sm.nextInt() ;
double tp= prtab*notab;
System.out.println(“PLEASE RE-ENTER DOSAGE”);
System.out.println(“1-LOW”);
System.out.println(“2-MEDIUM”);
System.out.println(“3-HIGH”);
int dosage=sm.nextInt();
if(dosage==1)
{
redos=”LOW”;
}
else if(dosage==2)
{
redos=”MEDIUM”;
}
else if(dosage==3)
{
redos=”HIGH”;
}
System.out.println(“~~~~~~BILL~~~~~~”);
System.out.println(“DOSAGE- “+redos);
System.out.println(“MEDICINE-“+medname);
System.out.println(“PRICE OF PER TABLET=”+prtab);
System.out.println(“TABLETS NEEDED=”+notab);
System.out.println(“TOTAL PRICE=”+tp);
System.out.println(“~~~THANK YOU~~~”);
}
}
Name : Megh Mehta
Std : X Div :C
Project title : BMI Calculator
Description : The program would input the weight and the height from the user and calculate the
Body Mass Index(BMI) and would leave a comment whether the person is
underweight , normal,overweight or obese on the basis of the height and weight.
PROGRAM CODE :
import java.util.*;
public class body_calculator
{
public static void main()
{
System.out.println(“\f”);//to clear the screen
System.out.println(“~~~~Welcome to body calculator~~~~”);
System.out.println();
System.out.println(“In this program you can check your body fitness\nEnter the following details and select from the menu what you want to calculate”);
System.out.println();
//initializing variables
String name;
double height;
double weight;
int age;
double BMI;
double target_heartRate_1, target_heartRate_2, max_BPM;//variables for heart rate
double fat_percent_male,fat_percent_female,fat_body_female,fat_body_male;//variables for fat body and percent fat body
double LBM_male,LBM_female,percent_LBM_male,percent_LBM_female;//variables for LBM
double BMR_male,BMR_female;//variables for BMR
int choice;
int number_of_digits=0;
Scanner sc=new Scanner(System.in );
System.out.println(“Enter your name : “);
name=sc.next();
System.out.println();
Scanner scan=new Scanner(System.in);
System.out.println(“Press 1 if you are a male and press 2 if you are a female”);
int choice_gender=scan.nextInt();
if(choice_gender==1 || choice_gender==2){System.out.println();}
else{System.out.println(“\f”);main();}
Scanner sc1=new Scanner(System.in);
System.out.println(“Enter your weight(in kg)…not in decimals:”);
weight=sc1.nextDouble();
if(weight>=10 && weight0 && height0 && age<=140){System.out.println();}
else{System.out.println("\f");main();}
Scanner sc4=new Scanner(System.in);
System.out.println("If you want to re-enter your details press 1\nIf you want the menu to display press 2");
int choice_input=sc4.nextInt();
if(choice_input==1){
System.out.println("\f");//to clear the above screen and and re-entre the details
main();
}
else if(choice_input==2){
System.out.println();
}
do
{
System.out.println("What would you like to check ?");
System.out.println();
//displaying a menu to the user
System.out.println("1. BMI (body mass index)");
System.out.println("—————————-");
System.out.println("2. LBM (lean body mass)");
System.out.println("—————————-");
System.out.println("3. BMR(basal metabolic rate)");
System.out.println("—————————-");
System.out.println("4. BPM(beats per minute)");
System.out.println("—————————-");
System.out.println("5.Exit");
System.out.println();
Scanner sca= new Scanner (System.in);
System.out.println("Enter your choice :");
choice=sca.nextInt();
switch(choice)
{
case 1:
{
System.out.println("BMI(Body mass index)");
System.out.println("");
System.out.println("You can check whether you are underweight, normal or overweight");
BMI= weight/(height * height);
System.out.println("Your BMI is "+ BMI + " kg/m2");
System.out.println();
if(BMI=18.5 && BMI=25 && BMI=30 && BMI<300){
System.out.println(name +" you are obese");
}
else{
System.out.println("BMI "+BMI+" is not possible ");
}
System.out.println("x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
break;//to terminate the switch case
}//end of case 1
case 2:
LBM_male = 0.407*weight+ 0.267*height*100- 19.2;//formula for calculating LBM for male
LBM_female = 0.252*weight + 0.473*height*100 – 48.3;//formula for calculating LBM for female
//formulae to calculate amount and percent of lean and fat weight
percent_LBM_male=LBM_male*100/weight;
percent_LBM_female=LBM_female*100/weight;
fat_body_female=weight-LBM_female;
fat_body_male=weight-LBM_male;
fat_percent_male=100-percent_LBM_male;
fat_percent_female=100-percent_LBM_female;
System.out.println("LBM(lean body mass)");
System.out.println();
System.out.println("You can check the amount and percentage of lean mass in your body");
System.out.println();
if(choice_gender==1){
System.out.println("Your LBM is "+LBM_male+" kg i.e."+percent_LBM_male+"% ");
System.out.println();
System.out.println("The amont of fat in your body is "+fat_body_male+" i.e. "+fat_percent_male+"%");
}
else if(choice_gender==2){
System.out.println("Your LBM is "+LBM_female+" kg i.e."+percent_LBM_female+"% ");
System.out.println();
System.out.println("The amont of fat in your body is "+fat_body_female+" i.e. "+fat_percent_female+"%");
}
System.out.println("x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
break;//to terminate the switch case
}//end of case 2
case 3:
{
System.out.println("BMR(basal metabolic rate)");
System.out.println();
System.out.println("BMR is the number of calories spent by your body while at the state of rest");
BMR_male=(10*weight)+(6.25*height*100)-(5*age)+5;
BMR_female=(10*weight)+(6.25*height*100)-(5*age)-161;
System.out.println();
if(choice_gender==1){
System.out.println(name+" Your BMR is "+BMR_male+" Kcal/day");
}
else if(choice_gender==2){
System.out.println(name+" Your BMR is "+BMR_female+" Kcal/day");
}
System.out.println("x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
break;//to terminate the switch case
}//end of case 3
case 4:
{
System.out.println("BPM(beats per minute)");
System.out.println("");
System.out.println("You can calculate the maximum BPM for you and the BPM at which you are efficiently working");
max_BPM=220-age;//formula for calculating the maximum heart rate
target_heartRate_1= 0.7*max_BPM;//formula for calculating target heart rate
System.out.println(name+" your maximum heart rate is "+max_BPM);
System.out.println();
target_heartRate_2=Math.round(target_heartRate_1);
System.out.println("Your target heart rate is "+target_heartRate_2);
System.out.println("x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
break;//to terminate the switch case
}//end of case 4
case 5:
{
System.out.println("~~~~~~Thank you for using body calculator~~~~~~");
break;
}
default:{
System.out.println("Wrong input");
break;
}
}//end of switch case
}
while( choice!=5);//end of do-while loop
}//end of main()
}//end of class
PROGRAM OUTPUT :
~~~~Welcome to body calculator~~~~
In this program you can check your body fitness
Enter the following details and select from the menu what you want to calculate
Enter your name :
Megh
Press 1 if you are a male and press 2 if you are a female
1
Enter your weight(in kg)…not in decimals:
50
Enter your height (in meters):
1.6
Enter your age :
14
If you want to re-enter your details press 1
If you want the menu to display press 2
2
What would you like to check ?
1. BMI (body mass index)
—————————-
2. LBM (lean body mass)
—————————-
3. BMR(basal metabolic rate)
—————————-
4. BPM(beats per minute)
—————————-
5.Exit
Enter your choice :
1
BMI(Body mass index)
You can check whether you are underweight, normal or overweight
Your BMI is 19.531249999999996 kg/m2
Megh you are normal
x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
What would you like to check ?
1. BMI (body mass index)
—————————-
2. LBM (lean body mass)
—————————-
3. BMR(basal metabolic rate)
—————————-
4. BPM(beats per minute)
—————————-
5.Exit
Enter your choice :
5
~~~~~~Thank you for using body calculator~~~~~~
Name:- Navya Vyas
Grade:- X
Div:- B
Project Title:- Clothes and accessories buying system
Project description:-In this Program, the user will be given various options about the types of clothes and accessories available in the store. The user may select the desired products it wants. It will finally calculate the entire bill and delivery charges which will depend according the location of the user.
Approved
import java.util.Scanner;
public class Clothes_accessories_Shopping
{
public static void main()
{ Scanner sc = new Scanner(System.in);
int p=0;
int num=0;
String c=””;
int netamt=0;
int cost_p=0;
int tot_num=0;
int delc =0;
System.out.println(“~~~~~~~Welcome to Fashionista~~~~~~~”);
System.out.println(“Please enter your Name : “);
String name = sc.nextLine();//to enter your registered name
System.out.println(“Please enter your phone number:”);
String no = sc.nextLine();//to enter the registered phone number of the customer
System.out.println(“Please Choose your city:”);//Delivery location
System.out.println(“Choose 1 : Mumbai”);
System.out.println(“Delivery charges: $ 100”);
System.out.println(“Choose 2 : Agra”);
System.out.println(“Delivery charges: $ 50”);
System.out.println(“Choose 3 : Chennai”);
System.out.println(“Delivery charges: $ 45”);
System.out.println(“Choose 4 : Bangalore”);
System.out.println(“Delivery charges: $ 60”);
System.out.println(“Choose 5 : Kolkata”);
System.out.println(“Delivery charges: $ 40”);
System.out.println(“Choose 6 : Ahemdabad”);
System.out.println(“Delivery charges: $ 55”);
System.out.println(“Choose 7 : kochi “);
System.out.println(“Delivery charges: $ 50”);
int del = sc.nextInt();
switch (del)
{
case 1 ://place-mumbai
{
delc=100;
break;
}
case 2://place-Agra
{
delc=50;
break;
}
case 3://place-chennai
{
delc = 45;
break;
}
case 4://place-Bangalore
{
delc = 60;
break;
}
case 5 ://place-Kolkata
{
delc =40;
break;
}
case 6 ://place-Ahemdabad
{
delc=55;
break;
}
case 7://place-kochi
{
delc=50;
break;
}
default:
}
do{
System.out.println(“please choose your desired category”);
System.out.println(“Choose number 1 – Men’s Clothing”);
System.out.println(“Choose number 2 – Women’s Clothing”);
System.out.println(“Choose number 3 – Men’s Accessories”);
System.out.println(“Choose number 4 – Women’s Accessories “);
int ch = sc.nextInt();
switch (ch) //outermost case
{ case 1://For men’s clothing
{
System.out.println(“Choose number 1 – T-shirts”);
System.out.println(“The cost per piece = $ 20”);
System.out.println(“Choose number 2 – Jeans “);
System.out.println(“The cost per piece = $ 30”);
System.out.println(“Choose number 3 – Shirts”);
System.out.println(“The cost per piece = $ 35”);
System.out.println(“Choose number 4 – Trousers”);
System.out.println(“The cost per piece = $ 40”);
System.out.println(“Choose number 5 – Ethnic wear”);
int choice = sc.nextInt();
switch (choice)
{ case 1://Tshirt size
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 20;
break;
}
case 2 ://jeans size
{
System.out.println(“Choose 1 – Size 28”);
System.out.println(“Choose 2 – Size 30”);
System.out.println(“Choose 3 – Size 32”);
System.out.println(“Choose 4 – Size 34”);
System.out.println(“Choose 5 – Size 36”);
int size = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 30;
break;
}
case 3 ://shirt size
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 35;
break;
}
case 4://trouser size
{
System.out.println(“Choose 1 – Size 28”);
System.out.println(“Choose 2 – Size 30”);
System.out.println(“Choose 3 – Size 32”);
System.out.println(“Choose 4 – Size 34”);
System.out.println(“Choose 5 – Size 36”);
int size = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 40;
break;
}
case 5 ://ethnic wear
{
System.out.println(“Choose 1 – Kurta set”);
System.out.println(“The cost per piece = $ 70”);
System.out.println(“Choose 2 – Vests”);
System.out.println(“The cost per piece = $ 55”);
System.out.println(“Choose 3 – stoles”);
System.out.println(“The cost per piece = $ 45”);
int select = sc.nextInt();
switch (select)
{ case 1 ://kurta set
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 70;
break;
}
case 2://vests
{ System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=55;
break;
}
case 3://stoles
{
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=45;
break;
}
}
}
}
break;
}
case 2: //women’s clothing
{
System.out.println(“Choose number 1 – Dresses “);
System.out.println(“The cost per piece = $ 60”);
System.out.println(“Choose number 2 – Tops “);
System.out.println(“The cost per piece = $ 25”);
System.out.println(“Choose number 3 – Jeans “);
System.out.println(“The cost per piece = $ 30”);
System.out.println(“Choose number 4 – Skirts “);
System.out.println(“The cost per piece = $ 35”);
System.out.println(“Choose number 5 – Shorts”);
System.out.println(“The cost per piece = $ 30”);
System.out.println(“Choose number 6 – Ethnic wear”);
int choose = sc.nextInt();
switch(choose)
{ case 1://dresses
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=60;
break;
}
case 2://tops
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=25;
break;
}
case 3://jeans
{ System.out.println(“Choose 1 – Size 28”);
System.out.println(“Choose 2 – Size 30”);
System.out.println(“Choose 3 – Size 32”);
System.out.println(“Choose 4 – Size 34”);
System.out.println(“Choose 5 – Size 36”);
int size = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 30;
break;
}
case 4://skirts
{ System.out.println(“Choose 1 – Size 28”);
System.out.println(“Choose 2 – Size 30”);
System.out.println(“Choose 3 – Size 32”);
System.out.println(“Choose 4 – Size 34”);
System.out.println(“Choose 5 – Size 36”);
int size = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 30;
break;
}
case 5://shorts
{ System.out.println(“Choose 1 – Size 28”);
System.out.println(“Choose 2 – Size 30”);
System.out.println(“Choose 3 – Size 32”);
System.out.println(“Choose 4 – Size 34”);
System.out.println(“Choose 5 – Size 36”);
int size = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p = 30;
break;
}
case 6 ://ethnic wear
{ System.out.println(” choose 1- kurtis”);
System.out.println(” Cost per piece = $ 45″);
System.out.println(” choose 2- kurta set”);
System.out.println(” Cost per piece = $ 60″);
System.out.println(” choose 3- Salwar suits”);
System.out.println(” Cost per piece = $ 75″);
int eth = sc.nextInt();
switch (eth)
{ case 1://kurtis
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=45;
break;
}
case 2://kurta set
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=60;
break;
}
case 3://salwaar suit
{
System.out.println(“Choose 1 – Size ‘XS'”);
System.out.println(“Choose 2 – Size ‘S'”);
System.out.println(“Choose 3 – Size ‘M'”);
System.out.println(“Choose 4 – Size ‘L'”);
System.out.println(“Choose 5 – Size ‘XL'”);
int s = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=75;
break;
}
}
}
}break;
}
case 3://Men’s accessories
{
System.out.println(“Choose number 1 – Watches”);
System.out.println(“Choose number 2 – Wallets”);
System.out.println(“Choose number 3 – Shoes”);
int ac = sc.nextInt();
switch (ac)
{ case 1://watches
{
System.out.println(“Choose 1- Analog Watches”);
System.out.println(“Cost per piece = $80”);
System.out.println(“Choose 2- Digital watches”);
System.out.println(“Cost per piece = $150”);
int s = sc.nextInt();
switch(s)
{ case 1://analog
{
System.out.println(“Number of items needed:”);
num = sc.nextInt();
p = 80;
break;
}
case 2 ://digital
{
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=120;
break;
}
}break;
}
case 2 ://wallets
{
System.out.println(“Choose 1- Faux Leather wallets”);
System.out.println(“Cost per piece = $30”);
System.out.println(“Choose 2- Leather wallets”);
System.out.println(“Cost per piece = $50”);
int s = sc.nextInt();
switch(s)
{ case 1://faux leather wallets
{
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=30;
break;
}
case 2://leather wallets
{
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=50;
break;
}
}break;
}
case 3://shoes
{
System.out.println(“Choose 1- Sneakers”);
System.out.println(“Cost per piece = $45”);
System.out.println(“Choose 2- Leather shoes”);
System.out.println(“Cost per piece = $70”);
int s = sc.nextInt();
switch(s)
{ case 1://Sneakers
{
System.out.println(“Choose 1 – UK Size ‘5’”);
System.out.println(“Choose 2 – UK Size ‘6’”);
System.out.println(“Choose 3 – UK Size ‘7’”);
System.out.println(“Choose 4 – UK Size ‘7.5’”);
System.out.println(“Choose 5 – UK Size ‘8’”);
int size = sc.nextInt();System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=45;
break;
}
case 2://leather shoes
{
System.out.println(“Choose 1 – UK Size ‘5’”);
System.out.println(“Choose 2 – UK Size ‘6’”);
System.out.println(“Choose 3 – UK Size ‘7’”);
System.out.println(“Choose 4 – UK Size ‘7.5’”);
System.out.println(“Choose 5 – UK Size ‘8’”);
int size = sc.nextInt();System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=70;
break;
}
}
}
}break;
}
case 4://women’s accessories
{
System.out.println(“Choose number 1 – Watches “);
System.out.println(“Choose number 2 – Jewellery “);
System.out.println(“Choose number 3 – Shoes”);
int wac = sc.nextInt();
switch(wac)
{ case 1://watches
{
System.out.println(“Choose 1- Analog Watches”);
System.out.println(“Cost per piece = $80”);
System.out.println(“Choose 2- Digital watches”);
System.out.println(“Cost per piece = $150”);
int s = sc.nextInt();
switch(s)
{ case 1://analog watches
{
System.out.println(“Number of items needed:”);
num = sc.nextInt();
p = 80;
break;
}
case 2 ://digital
{
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=120;
break;
}
}
}break;
case 2 ://jewellery
{
System.out.println(“Choose 1- Earring”);
System.out.println(“Cost per piece = $30”);
System.out.println(“Choose 2- Pendants”);
System.out.println(“Cost per piece = $50”);
int s = sc.nextInt();
switch(s)
{ case 1://earring
{
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=30;
break;
}
case 2://pendants
{
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=50;
break;
}
}
}break;
case 3://shoes
{
System.out.println(“Choose 1- Ballerinas”);
System.out.println(“Cost per piece = $45”);
System.out.println(“Choose 2- Heels”);
System.out.println(“Cost per piece = $70”);
int s = sc.nextInt();
switch(s)
{ case 1://ballerinas
{
System.out.println(“Choose 1 – UK Size ‘4’”);
System.out.println(“Choose 2 – UK Size ‘4.5’”);
System.out.println(“Choose 3 – UK Size ‘5’”);
System.out.println(“Choose 4 – UK Size ‘5.5’”);
System.out.println(“Choose 5 – UK Size ‘6’”);
int size = sc.nextInt();
System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=45;
break;
}
case 2://heels
{
System.out.println(“Choose 1 – UK Size ‘4’”);
System.out.println(“Choose 2 – UK Size ‘4.5’”);
System.out.println(“Choose 3 – UK Size ‘5’”);
System.out.println(“Choose 4 – UK Size ‘5.5’”);
System.out.println(“Choose 5 – UK Size ‘6’”);
int size = sc.nextInt();System.out.println(“Number of items needed :”);
num = sc.nextInt();
p=70;
break;
}
}
}
}
}break;
}
netamt+= (p * num);
cost_p+=p;
tot_num+=num;
System.out.print(‘\u000C’);
System.out.println(“Do you want to buy more items? (yes/no)”);
c = sc.next();
}while(c.equalsIgnoreCase(“y”));
double Gst= 0.05;//5% gst
double finalamt= netamt +Gst+delc;
System.out.print(‘\u000C’);
System.out.println(“~~~~Shopping Bill~~~~”);
//System.out.println(“price of the product :$”+cost_p);
System.out.println(“Number of products bought :”+tot_num);
System.out.println(“Net Amount :$”+netamt);
System.out.println(“GST Amount :$”+Gst);
System.out.println(“Delivery charges: $”+delc);
System.out.println(“Final Amount :$”+finalamt);
System.out.println(“~~~~~~Thank you for shopping~~~~~~”);
}//end of void
}//end of class
Correction:-
System.out.println(“Do you want more items?(y/n)”);
Name: Nilay Kamat
Title:Genral stores (billing&gst calculation)
Desc:Once the product name is inputted,the price of the product,gst and the final amount(price + gst) will be generated
import java.util.Scanner;
public class General_Stores
{static Scanner sc = new Scanner (System.in);
public static void main(String[]args)
{
double it,cp=0,GST=0,eo=0;
String pro=””,gst=””;
System.out.println(“Welcome to my small general store”);
System.out.println(“Whatever we have is in proper amount “);
while(true)
{
System.out.println(“The items avalible are:”);
System.out.println(“1-Coffee 50g”);
System.out.println(“2-Tea 50g”);
System.out.println(“3-Cashew 50g”);
System.out.println(“4-Aggarbatti 10 unit”);
System.out.println(“5-Ghee 250g”);
System.out.println(“6-Butter 100g”);
System.out.println(“7-Cheese 100g”);
System.out.println(“8-Playing Cards 1 unit”);
System.out.println(“9-Mineral Water 500ml”);
System.out.println(“10-Tissues 10 units”);
System.out.println(“11-Jam 250g”);
System.out.println(“12-Biscuits 100g”);
System.out.println(“13-Washing Machine 1 unit”);
System.out.println(“14-Sunscreen 500 g”);
System.out.println(“15-Chocolate 100g”);
System.out.println(“16-Chewing Gum 5 g”);
System.out.println(“What item would you like to choose?\nChosen items cannot be removed”);
System.out.println(“Restart the program if you want to make a correct decision “);
System.out.println(“You can only choose one item.Enter now:”);
it=sc.nextDouble();
if(it==1 )
{
pro=”Coffee 50 g”;
cp=35;
GST=8.0/100;
gst=”8%”;
}
else if(it==2)
{
pro=”Tea 50g”;
cp=25;
GST=8.0/100;
gst=”8%”;
}
else if(it==3)
{
pro=”Cashew 50g”;
cp=50;
GST =8.0/100;
gst=”8%”;
}
else if(it==4)
{
pro=”Agarbatti 10 units”;
cp=100;
GST=8.0/100;
gst=”8%”;
}
else if(it==5)
{
pro=”Ghee 250g”;
cp=125;
GST=12.0/100;
gst=”12%”;
}
else if(it==6)
{
pro=”Butter 100g”;
cp=75;
GST=12.0/100;
gst=”12%”;
}
else if(it==7)
{
pro=”Cheese 100g”;
cp=95;
GST=12.0/100;
gst=”12%”;
}
else if(it==8)
{
pro=”Playing Cards 1 unit”;
cp=100;
GST=12.0/100;
gst=”12%”;
}
else if(it==9)
{
pro=”Mineral Water 500ml”;
cp=10;
GST=18.0/100;
gst=”18%”;
}
else if(it==10)
{
pro=”Tissues 10 units “;
cp=10;
GST=18.0/100;
gst=”18%”;
}
else if(it==11)
{
pro=”Jam 250g”;
cp=85;
GST=18.0/100;
gst=”18%”;
}
else if(it==12)
{
pro=”Biscuits 100g “;
cp=50;
GST=18.0/100;
gst=”18%”;
}
else if(it==13)
{
pro=”Washing Machine 1 unit”;
cp=50000;
GST=28.0/100;
gst=”28%”;
}
else if(it==14)
{
pro=”Sunscreen 500g”;
cp=263;
GST=28.0/100;
gst=”28%”;
}
else if(it==15)
{
pro=”Chocolate 50g”;
cp=50;
GST=28.0/100;
gst=”28%”;
}
else if(it==16)
{
pro=”Chewing Gum”;
cp= 1;
GST=28.0/100;
gst=”28%”;
}
else
{
System.out.println(“Wrong Input!!!”);
} break;
}
double GIR=GST*cp;
double Amt=GIR+cp;
System.out.println(“Bill”);
System.out.println(“Product=”+pro);
System.out.println(“Cost:”+cp);
System.out.println(“Gst:”+gst);
System.out.println(“Gst in rupees:”+GIR);
System.out.println(“Amount:”+Amt);
System.out.println(“Thank you! visit again”);
}
}
NAME: Carol Thakkar
GRADE: X DIV: A
PROJECT TITLE: Online courier service
DESCRIPTION: This program will allow you to place the order, track your order and know the pickup and delivery schedule
import java.util.*;
public class school_project
{
public static void main()
{
String name,rname,ddate=””,rdname=””;
long mobno=0,awb=0,rmobno;
String add,radd;
boolean delivered=false;
int dest=0;
int ch;
Scanner sc=new Scanner (System.in);
boolean quit=false;
int tmp;
do
{// start of dowhile
System.out.println(“\f ~~~~welcome to carol courier service~~~~”);
System.out.println(” 1-send courier \n 2-track courier \n 3-receive courier \n or any other no to quit”);
ch=sc.nextInt();
switch(ch){// start of switch
case 1:{// start of case 1
System.out.println(“enter the name of the sender “);
name=sc.next();
System.out.println(“enter the sender’s address “);
add=sc.next();
System.out.println(“enter the senders mobile no “);
mobno=sc.nextLong();
System.out.println(“enter the name of the receiver “);
rname=sc.next();
System.out.println(“enter the receiver’s address “);
radd=sc.next();
System.out.println(“enter the receiver’s mobile no “);
rmobno=sc.nextLong();
while(dest==0)
{// start of while
System.out.println(” choose your destination-“);
System.out.println(” 1-mumbai \n 2-delhi \n 3-banglore \n 4-hydrabad \n 5-calcutta \n 6-chennai “);
dest=sc.nextInt();
if(dest6)
{
System.out.println(“we only serve the above destinations \n pls choose correct destination”);
dest=0;
}
}
System.out.println(“what do you want to deliver”);
System.out.println(” 1=document \n 2=parcel”);
int prd=sc.nextInt();
double w;
double charge;
if(prd==1)
{
System.out.println(“enter the weight of the document(in grams)”);
w=sc.nextDouble();
if(w<=50)
{
charge=30+0.18*30;
}
else
{
charge=50+0.18*50;
}
awb++;
System.out.println("~~~~~~~~~~~BILL~~~~~~~~~~~");
System.out.println("airway bill no- "+awb);
System.out.println("name of he sender – "+name);
System.out.println("mob no of the sender "+mobno);
System.out.println("address of the sender "+add);
System.out.println("name of the receiver "+rname);
System.out.println("mob no of the receiver "+rmobno);
System.out.println("address of the receiver "+radd);
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
else if(prd==2)
{
System.out.println("enter the weight of the parcel(in kg)");
w=sc.nextDouble();
if(w<=1)
{
charge=100+0.18*100;
}
else if(w<=2)
{
charge=200+0.18*200;
}
else if(w<=3)
{
charge=250+0.18*250;
}
else if(w<=4)
{
charge=300+0.18*300;
}
else if(w<=5)
{
charge=350+0.18*350;
}
else
{
charge=400+0.18*400;
}
awb++;
System.out.println("~~~~~~~~~~~BILL~~~~~~~~~~~");
System.out.println("airway bill no- "+awb);
System.out.println("name of he sender – "+name);
System.out.println("mob no of the sender "+mobno);
System.out.println("address of the sender "+add);
System.out.println("name of the receiver "+rname);
System.out.println("mob no of the receiver "+rmobno);
System.out.println("address of the receiver "+radd);
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
else
{
System.out.println("WRONG INPUT!!!!!!!!!!!!!!");
}
System.out.println("press any no. to continue");
tmp=sc.nextInt();
break;
}// end of case 1
case 2:{// start of case 2
if(awb==0)
{
System.out.println("there is no courier to be delivered");
}
else if(delivered)
{
System.out.println("your courier was delivered on "+ddate);
System.out.println("received by "+rdname);
}
else
{
System.out.println("courier not yet delivered");
}
System.out.println("press any key to continue");
tmp=sc.nextInt();
break;
}// end of case 2
case 3:{// start of case 3
if(awb!=0)
{
System.out.println("enter awb no");
int awb1=sc.nextInt();
if(awb==awb1)
{
System.out.println("enter date of delivery");
ddate=sc.next();
System.out.println("received by");
rdname=sc.next();
delivered=true;
}
else
{
System.out.println("wrong airway bill no");
}
}
else
{
System.out.println("no courier to be delivered");
}
System.out.println("press any no. to continue");
tmp=sc.nextInt();
break;
}// end of case 3
default :
quit=true;
}// end of switch
}while(!quit); // end of dowhile loop
}
}
output( output may vary according to your choice):
~~~~welcome to carol courier service~~~~
1-send courier
2-track courier
3-receive courier
or any other no to quit
1
enter the name of the sender
abc
enter the sender’s address
yyy
enter the senders mobile no
000000000
enter the name of the receiver
xyz
enter the receiver’s address
zzz
enter the receiver’s mobile no
999999999
choose your destination-
1-mumbai
2-delhi
3-banglore
4-hydrabad
5-calcutta
6-chennai
7
we only serve the above destinations
pls choose correct destination
choose your destination-
1-mumbai
2-delhi
3-banglore
4-hydrabad
5-calcutta
6-chennai
6
what do you want to deliver
1=document
2=parcel
1
enter the weight of the document(in grams)
30
~~~~~~~~~~~BILL~~~~~~~~~~~
airway bill no- 1
name of he sender – abc
mob no of the sender 0
address of the sender yyy
name of the receiver xyz
mob no of the receiver 999999999
address of the receiver zzz
~~~~~~~~~~~~~~~~~~~~~~~~~~
press any no. to continue
NAME:Jhanvi lachhwani
GRADE:X DIV:A
PROJECT TITTLE: Chocolate Factory
DESCRIPTION: This program will allow you to make a chocolate according to your wish by choosing the quantity and size of your choice according to which your bill will be generated including the GST.
NAME:Jhanvi Lachhwani
GRADE:X DIV:A
PROJECT TITTLE: Chocolate Factory
DESCRIPTION: You will be able to make a chocolate of your choice by the given ingredients according to the size and quantity you wish.
Approved
import java.util.*;
public class chocolate_factory
{
public static void main()
{
Scanner sc = new Scanner(System.in);
double cocoa =1000.0,sugar=1000.0,milk=30,peanuts=100,caramel=250;
double cocoa_q,sugar_q,milk_q,peanuts_q,caramel_q;
int quantity,size,choice;
double gst,costprice,sellingprice,finalprice;
System.out.println(“/f”);
System.out.println(“WELCOME TO CHOCOLATE FACTORY”);
System.out.println(“ENTER 1 FOR 5 STAR”);
System.out.println(“ENTER 2 FOR DAIRY MILK”);
System.out.println(“ENTER YOUR CHOICE”);
choice = sc.nextInt();
switch(choice)
{
case 1:
{
System.out.println(“YOU HAVE SELECTED 5 STAR”);
System.out.println(“WE HAVE FOLLOWING SIZE-“);
System.out.println(“1 – SMALL”);
System.out.println(“2 – BIG”);
System.out.println(“WHAT SIZE YOU WANT?”);
size = sc.nextInt();
System.out.println(“ENTER QUANTITY-“);
quantity = sc.nextInt();
if(size==1|| size==2)
{
if(size==1)
{
cocoa_q = 0.1;
sugar_q = 0.02;
milk_q = 0.02;
caramel_q = 0.03;
}
else
{
cocoa_q = 0.2;
sugar_q = 0.02;
milk_q = 0.03;
caramel_q = 0.05;
}
costprice = cocoa+cocoa_q+sugar+sugar_q+milk+milk_q+caramel+caramel_q;
sellingprice = costprice+costprice*0.25;
gst = sellingprice*0.18;
finalprice =(sellingprice +gst)+quantity;
System.out.println(“YOU HAVE PURCHASED”+quantity+”5 STAR CHOCOLATE”);
System.out.println(“YOU HAVE TO PAY RS = “+finalprice);
}
else
{
System.out.println(“YOU HAVE SELECTED WRONG SIZE”);
}
break;
}
case 2:
{
System.out.println(“YOU HAVE SELECTED DAIRY MILK”);
System.out.println(“WE HAVE FOLLOWING SIZE-“);
System.out.println(“1 – SMALL”);
System.out.println(“2 – BIG”);
System.out.println(“WHAT SIZE YOU WANT?”);
size = sc.nextInt();
System.out.println(“ENTER QUANTITY”);
quantity = sc.nextInt();
if(size==1|| size==2)
{
if(size==1)
{
cocoa_q = 0.3;
sugar_q = 0.05;
milk_q = 0.06;
caramel_q = 0.06;
peanuts_q =0.04;
}
else
{
cocoa_q = 0.5;
sugar_q = 0.06;
milk_q = 0.07;
caramel_q = 0.05;
peanuts_q =0.05;
}
costprice = cocoa+cocoa_q+sugar+sugar_q+milk+milk_q+caramel+caramel_q+peanuts+peanuts_q;
sellingprice = costprice+costprice*0.25;
gst = sellingprice*0.18;
finalprice =(sellingprice +gst)+quantity;
System.out.println(“YOU HAVE PURCHASED”+quantity+”DAIRY MILK CHOCOLATE”);
System.out.println(“YOU HAVE TO PAY RS =”+finalprice);
System.out.println(“THANK YOU FOR CHOOSING CHOCOLATE FACTORY.VISIT AGAIN:)”);
}
else
{
System.out.println(“YOU HAVE SELECTED WRONG SIZE”);
}
break;
}
default:
{
System.out.println(“WRONG CHOICE !”);
}
}
}
}
Name: Mehak unnithan
Std:10 DIV:B
PROJECT TITLE: INCOME TAX CALCULATOR
PROJECT DESCRIPTION:This program will calculate the amount of income tax you a person has to pay according to his income and if he is 60 years or above then he will be exempted from paying the tax
Project title : quiz on sports
Description : program that displays questions and four choices of answer . The user enter the answer and accordingly his score is calculated.
Maths quiz
Program that displays the questions and 4 choices of answer the user enter the of answer.
Name : Arwa Rajkotwala
Std: 10
Div : C
Project Title : Home Delivery Services
Project Description : This program will let you purchase the meal of your choice and deliver it to your doorstep.
Approved
import java.util.*;
// Compiler version JDK 11.0.2
class mathQuiz
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
System.out.println(“Hello this is you math Quiz”);
int mark = 0;
System.out.println(“Qa”);
System.out.println(“what 2 × 3”);
System.out.println(“1.33”);
System.out.println(“2.6”);
System.out.println(“2.22”);
int u = scan.nextInt();
if (u==2)
{
mark = mark + 10;
System.out.println(“right”);
} else {
System.out.println(“wrong”);
}
System.out.println(“Qb”);
System.out.println(“what 13 × 9”);
System.out.println(“1.455”);
System.out.println(“2.753”);
System.out.println(“3.117”);
int v = scan.nextInt();
if (v==3)
{
mark = mark + 10;
System.out.println(“right”);
} else
{
System.out.println(“wrong”);
}
System.out.println(“Qc”);
System.out.println(“what 93 × 12”);
System.out.println(“1.1116”);
System.out.println(“2.2833”);
System.out.println(“3.9299”);
int w = scan.nextInt();
if (w==1)
{
mark = mark + 10;
System.out.println(“right”);
} else
{
System.out.println(“wrong”);
}
System.out.println(“Qd”);
System.out.println(“what 63 × 32”);
System.out.println(“1.2016”);
System.out.println(“2.2833”);
System.out.println(“3.9855”);
int y = scan.nextInt();
if (y==1)
{
mark = mark + 20;
System.out.println(“right”);
}
else {
System.out.println(“wrong”);
}
System.out.println(“Qe”);
System.out.println(“what 93 ÷ 12”);
System.out.println(“1.5”);
System.out.println(“2.9”);
System.out.println(“3.7”);
int z = scan.nextInt();
if (z==1)
{
mark = mark + 10;
System.out.println(“right”);
} else
{
System.out.println(“wrong”);
}
if (mark==50)
{
System.out.println(“Your mark is :”+mark);
System.out.println(“thats an A”);
}
if (mark==40)
{
System.out.println(“Your mark is :”+mark);
System.out.println(“thats a B”);
}
if (mark==30)
{
System.out.println(“Your mark is :”+mark);
System.out.println(“thats a C”);
}
if (mark==20)
{
System.out.println(“Your mark is :”+mark);
System.out.println(“thats a D”);
}
if (mark==10)
{
System.out.println(“Your mark is :”+mark);
System.out.println(“thats an E”);
}
if (mark==0)
{
System.out.println(“Your mark is :”+mark);
System.out.println(“thats an F”);
}
}
}
IX C
Roll no=14
project=ALL ABOUT PHONES
description= user will input which company phone they want to purchase and then will choose the model and can also purchase accessories for their device
programe code
import java.util.Scanner;
public class phone
{ public static void main(){
System.out.println(“\f”); Scanner w=new Scanner(System.in);
System.out.println(“Which phone do you want to purchase”);
System.out.println(“\n1=Samsung\nmostly flagships”);
System.out.println(“\n2=Realme\nmid ranged”);
int q=w.nextInt();//this (q) will take input for phone company
if(q==1){System.out.println(“\n1=Samsung Zflip\nA phone with a foldable 6.8 inch screen available in 8GB ram and has a storage of 256GB with a 48mp primary camera “);
System.out.println(“\n2=Samsung S20 ultra\nA large 6.9 inch display in 10GB ram and has a storage of 256GB with a 108m camera with 100 time optical zoom”);
System.out.println(“\n3=Samsung A70\nA mid ranged high performance processor,6.4inch screen with 6GB ram and has a storage of 128GB with a 24mp primary camera”);
System.out.println(“\n4=Samsung M30s\nA mid ranged high performance phone with a 6000mAh battery,128GB with 6GB ram,24mp camera”);int e=w.nextInt();//(e) will take input to take phone name
if(e==1){System.out.println(“Select colour\n1=Prism Black\n2=Prism White\n3=Prism Green”);int l=w.nextInt();
if(l>=1&&l=1&&c<=100){ System.out.println("\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces =" +c);double r=110000*0.18;double t=(110000+r)*c;System.out.println("Taxes ="+r+"\nFinal amount ="+t);
System.out.println("\nWhich accessories do you want to buy\n1=mobile case\n2=mobile stand\n3=wireless charger\n4=wireless earphones\n5=nothing\n6=Mobile case,Mobile stand\n7=Mobile case,wireless charger\n8=Mobile case,wireless earphone\n9=Mobile stand,wireless charger\n10=Mobile stand,wireless charger\n11=wireless earphones,wireless charger\n12=Mobile case,Mobile stand,wireless charger\n13=Mobile case,Mobile stand,wireless earphone\n14=Mobile case,wireless charger,wireless earphones\n15=Mobile stand,wireless charger,wireless earphone");int i=w.nextInt();//(e) will take input to give samsung phone info
if(i==1){double o=200+t;System.out.println("MRP=Rs.200\nTotal Amount="+o);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nAccessory-Mobile case\nMRP=Rs.200\nFinal Amount ="+o+"\n~~~~~~Thank You~~~~~~");}
if(i==2){double a=800+t;System.out.println("MRP=Rs.800\nTotal Amount="+a);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nAccessory-mobile stand\nMRP=Rs.800\nFinal Amount ="+a+"\n~~~~~~Thank You~~~~~~");}
if(i==3){double s=6000+t;System.out.println("MRP=Rs.6000\nTotal Amount="+s);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-wireless charger\nMRP=Rs.6000\nFinal Amount ="+s+"\n~~~~~~Thank You~~~~~~");}
if(i==4){double d=5000+t;System.out.println("MRP=Rs.5000\nTotal Amount="+d);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-wireless earphone\nMRP=Rs.5000\nFinal Amount ="+d+"\n~~~~~~Thank You~~~~~~");}
if(i==5){System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nAccessory-none\nMRP=Rs.0\nFinal Amount ="+t+"\n~~~~~~Thank You~~~~~~");}
if(i==6){double z=1000+t;System.out.println("MRP=Rs.1000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand\nMRP=Rs.1000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==7){double z=6200+t;System.out.println("MRP=Rs.6200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,wireless charger\nMRP=Rs.6200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==8){double z=5200+t;System.out.println("MRP=Rs.5200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,wireless earphone\nMRP=Rs.5200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==12){double z=7000+t;System.out.println("MRP=Rs.7000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand,wireless charger\nMRP=Rs.7000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==13){double z=6000+t;System.out.println("MRP=Rs.6000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand,wireless earphone\nMRP=Rs.6000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==14){double z=11200+t;System.out.println("MRP=Rs.11200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,wireless charger,wireless earphones\nMRP=Rs.11200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==15){double z=11800+t;System.out.println("MRP=Rs.11800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless charger,wireless earphone\nMRP=Rs.11800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==9){double z=6800+t;System.out.println("MRP=Rs.6800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless charger\nMRP=Rs.6800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==10){double z=5800+t;System.out.println("MRP=Rs.5800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless earphones\nMRP=Rs.5800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(i==11){double z=11000+t;System.out.println("MRP=Rs.11000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung Zflip\nMRP=Rs.1,10,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-wireless earphones,wireless charger\nMRP=Rs.11000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
}if(c100){System.out.println(“\nWrong input”);}}}
if(e==2){System.out.println(“Select Colour\n1=Prism Black\n2=Prism White\n3=Prism Green”);int l=w.nextInt();
if(l>=1&&l=1&&c<=100){ System.out.println("\nWhich accessories do you want to buy\n1=mobile case\n2=mobile stand\n3=wireless charger\n4=wireless earphones\n5=nothing\n6=Mobile case,Mobile stand\n7=Mobile case,wireless charger\n8=Mobile case,wireless earphone\n9=Mobile stand,wireless charger\n10=Mobile stand,wireless charger\n11=wireless earphones,wireless charger\n12=Mobile case,Mobile stand,wireless charger\n13=Mobile case,Mobile stand,wireless earphone\n14=Mobile case,wireless charger,wireless earphones\n15=Mobile stand,wireless charger,wireless earphone");int p=w.nextInt();
if(p==1){double o=200+u;System.out.println("MRP=Rs.200\nTotal Amount="+o);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-Mobile case\nMRP=Rs.200\nFinal Amount ="+o+"\n~~~~~~Thank You~~~~~~");}
if(p==2){double a=800+u;System.out.println("MRP=Rs.800\nTotal Amount="+a);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-mobile stand\nMRP=Rs.800\nFinal Amount ="+a+"\n~~~~~~Thank You~~~~~~");}
if(p==3){double s=6000+u;System.out.println("MRP=Rs.6000\nTotal Amount="+s);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-wireless charger\nMRP=Rs.6000\nFinal Amount ="+s+"\n~~~~~~Thank You~~~~~~");}
if(p==4){double d=5000+u;System.out.println("MRP=Rs.5000\nTotal Amount="+d);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-wireless earphone\nMRP=Rs.5000\nFinal Amount ="+d+"\n~~~~~~Thank You~~~~~~");}
if(p==5){System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-none\nMRP=Rs.0\nFinal Amount ="+u+"\n~~~~~~Thank You~~~~~~");}
if(p==6){double z=1000+u;System.out.println("MRP=Rs.1000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-Mobile case,Mobile stand\nMRP=Rs.1000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==7){double z=6200+u;System.out.println("MRP=Rs.6200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-Mobile case,wireless charger\nMRP=Rs.6200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==8){double z=5200+u;System.out.println("MRP=Rs.5200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of piecies"+c+"\nAccessory-Mobile case,wireless earphone\nMRP=Rs.5200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==12){double z=7000+u;System.out.println("MRP=Rs.7000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand,wireless charger\nMRP=Rs.7000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==13){double z=6000+u;System.out.println("MRP=Rs.6000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand,wireless earphone\nMRP=Rs.6000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==14){double z=11200+u;System.out.println("MRP=Rs.11200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,wireless charger,wireless earphones\nMRP=Rs.11200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==15){double z=11800+u;System.out.println("MRP=Rs.11800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless charger,wireless earphone\nMRP=Rs.11800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==9){double z=6800+u;System.out.println("MRP=Rs.6800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless charger\nMRP=Rs.6800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==10){double z=5800+u;System.out.println("MRP=Rs.5800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless earphones\nMRP=Rs.5800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==11){double z=11000+u;System.out.println("MRP=Rs.11000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung S20 ultra\nMRP=Rs.1,20,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-wireless earphones,wireless charger\nMRP=Rs.11000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}}
}if(c100){System.out.println(“Wrong input”);}}}
if(e==3){System.out.println(“Select colour\n1=prism white\n2=prism black\n3=sky blue”);int l=w.nextInt();
if(l>=1&&l=1&&c100&&c=1&&l<=3){System.out.println("How many pieces ");int c=w.nextInt();
if(c=1){ System.out.println(“\nMRP=Rs.14,000\nCGST=8% ,SGST=8%”);double y=14000*0.18;double u=(14000+y)*c;System.out.println(“Taxes =”+y+”\nFinal amount =”+u);
System.out.println(“\nWhich accessories do you want to buy\n1=mobile case\n2=mobile stand\n3=wireless charger\n4=wireless earphones\n5=nothing\n6=Mobile case,Mobile stand\n7=Mobile case,wireless charger\n8=Mobile case,wireless earphone\n9=Mobile stand,wireless charger\n10=Mobile stand,wireless charger\n11=wireless earphones,wireless charger\n12=Mobile case,Mobile stand,wireless charger\n13=Mobile case,Mobile stand,wireless earphone\n14=Mobile case,wireless charger,wireless earphones\n15=Mobile stand,wireless charger,wireless earphone”);int p=w.nextInt();
if(p==1){double o=200+u;System.out.println(“MRP=Rs.200\nTotal Amount=”+o);
System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile case\nMRP=Rs.200\nFinal Amount =”+o+”\n~~~~~~Thank You~~~~~~”);}
if(p==2){double a=800+u;System.out.println(“MRP=Rs.800\nTotal Amount=”+a);
System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-mobile stand\nMRP=Rs.800\nFinal Amount =”+a+”\n~~~~~~Thank You~~~~~~”);}
if(p==3){double s=6000+u;System.out.println(“MRP=Rs.6000\nTotal Amount=”+s);
System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-wireless charger\nMRP=Rs.6000\nFinal Amount =”+s+”\n~~~~~~Thank You~~~~~~”);}
if(p==4){double d=5000+u;System.out.println(“MRP=Rs.5000\nTotal Amount=”+d);
System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-wireless earphone\nMRP=Rs.5000\nFinal Amount =”+d+”\n~~~~~~Thank You~~~~~~”);}
if(p==5){System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-none\nMRP=Rs.0\nFinal Amount =”+u+”\n~~~~~~Thank You~~~~~~”);}
if(p==6){double z=1000+u;System.out.println(“MRP=Rs.1000\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile case,Mobile stand\nMRP=Rs.1000\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==7){double z=6200+u;System.out.println(“MRP=Rs.6200\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile case,wireless charger\nMRP=Rs.6200\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==8){double z=5200+u;System.out.println(“MRP=Rs.5200\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile case,wireless earphone\nMRP=Rs.5200\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==12){double z=7000+u;System.out.println(“MRP=Rs.7000\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile case,Mobile stand,wireless charger\nMRP=Rs.7000\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==13){double z=6000+u;System.out.println(“MRP=Rs.6000\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile case,Mobile stand,wireless earphone\nMRP=Rs.6000\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==14){double z=11200+u;System.out.println(“MRP=Rs.11200\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile case,wireless charger,wireless earphones\nMRP=Rs.11200\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==15){double z=11800+u;System.out.println(“MRP=Rs.11800\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile stand,wireless charger,wireless earphone\nMRP=Rs.11800\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==9){double z=6800+u;System.out.println(“MRP=Rs.6800\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile stand,wireless charger\nMRP=Rs.6800\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==10){double z=5800+u;System.out.println(“MRP=Rs.5800\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-Mobile stand,wireless earphones\nMRP=Rs.5800\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}
if(p==11){double z=11000+u;System.out.println(“MRP=Rs.11000\nTotal Amount=”+z);System.out.println(“\f\n~~~~~~Bill~~~~~~~~\nPhone-Samsung M30s\nMRP=Rs.14,000\nCGST=8% ,SGST=8%\nNo. of piecies”+c+”\nAccessory-wireless earphones,wireless charger\nMRP=Rs.11000\nFinal Amount =”+z+”\n~~~~~~Thank You~~~~~~”);}}
}}
}//end of samsung
//start of realme
if(q==2){System.out.println(“\n1=Realme 6pro\nA phone with a 6.8 inch screen available in 8GB ram and has a storage of 256GB with a 64mp quad camera setup “);
System.out.println(“\n2=Realme X2 pro\nA 6.8 inch display in 8GB ram and a storage of 256GB with a 64mp camera and snapdragon 855+”);
System.out.println(“\n3=Realme Xt\nA mid ranged high performance processor,6.7inch screen with 6GB ram and has a storage of 128GB with a 48mp primary camera”);
System.out.println(“\n4=Realme x\nA mid ranged high performance phone with a 6.8 inch bezzel less screen and a pop up 32mp camera,128GB with 6GB ram,48mp camera”);int e=w.nextInt();//(e) will take input to take phone name
//start of realme6pro
if(e==1){System.out.println(“Select colour\n1=prism white\n2=prism black\n3=sky blue”);int l=w.nextInt();
//start of first colour
if(l>=1&&l=1&&c=1&&l=1&&c=1&&l=1&&c=1&&l=1&&c<=100){ System.out.println("\nWhich accessories do you want to buy\n1=mobile case\n2=mobile stand\n3=wireless charger\n4=wireless earphones\n5=nothing\n6=Mobile case,Mobile stand\n7=Mobile case,wireless charger\n8=Mobile case,wireless earphone\n9=Mobile stand,wireless charger\n10=Mobile stand,wireless charger\n11=wireless earphones,wireless charger\n12=Mobile case,Mobile stand,wireless charger\n13=Mobile case,Mobile stand,wireless earphone\n14=Mobile case,wireless charger,wireless earphones\n15=Mobile stand,wireless charger,wireless earphone");int p=w.nextInt();
if(p==1){double o=200+u;System.out.println("MRP=Rs.200\nTotal Amount="+o);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case\nMRP=Rs.200\nFinal Amount ="+o+"\n~~~~~~Thank You~~~~~~");}
if(p==2){double a=800+u;System.out.println("MRP=Rs.800\nTotal Amount="+a);
System.out.println("\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-mobile stand\nMRP=Rs.800\nFinal Amount ="+a+"\n~~~~~~Thank You~~~~~~");}
if(p==3){double s=6000+u;System.out.println("MRP=Rs.6000\nTotal Amount="+s);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-wireless charger\nMRP=Rs.6000\nFinal Amount ="+s+"\n~~~~~~Thank You~~~~~~");}
if(p==4){double d=5000+u;System.out.println("MRP=Rs.5000\nTotal Amount="+d);
System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-wireless earphone\nMRP=Rs.5000\nFinal Amount ="+d+"\n~~~~~~Thank You~~~~~~");}
if(p==5){System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-none\nMRP=Rs.0\nFinal Amount ="+u+"\n~~~~~~Thank You~~~~~~");}
if(p==6){double z=1000+u;System.out.println("MRP=Rs.1000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand\nMRP=Rs.1000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==7){double z=6200+u;System.out.println("MRP=Rs.6200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X \nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,wireless charger\nMRP=Rs.6200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==8){double z=5200+u;System.out.println("MRP=Rs.5200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,wireless earphone\nMRP=Rs.5200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==12){double z=7000+u;System.out.println("MRP=Rs.7000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand,wireless charger\nMRP=Rs.7000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==13){double z=6000+u;System.out.println("MRP=Rs.6000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,Mobile stand,wireless earphone\nMRP=Rs.6000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==14){double z=11200+u;System.out.println("MRP=Rs.11200\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile case,wireless charger,wireless earphones\nMRP=Rs.11200\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==15){double z=11800+u;System.out.println("MRP=Rs.11800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless charger,wireless earphone\nMRP=Rs.11800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==9){double z=6800+u;System.out.println("MRP=Rs.6800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless charger\nMRP=Rs.6800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==10){double z=5800+u;System.out.println("MRP=Rs.5800\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-Mobile stand,wireless earphones\nMRP=Rs.5800\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
if(p==11){double z=11000+u;System.out.println("MRP=Rs.11000\nTotal Amount="+z);System.out.println("\f\n~~~~~~Bill~~~~~~~~\nPhone-Realme X\nMRP=Rs.16,000\nCGST=8% ,SGST=8%\nNo. of pieces"+c+"\nAccessory-wireless earphones,wireless charger\nMRP=Rs.11000\nFinal Amount ="+z+"\n~~~~~~Thank You~~~~~~");}
}else{System.out.println("Wrong input");}}//end of first colour
}//end of realme X
}//end of realme phones
}//end of void main
}//end of class
Name:- Yash Vichare
Grade:-X-B
Roll No:- 30
project title :- top 4 airplanes
description:- I would be showing information of top 4 airplanes,their speed,size,etc
Rejected
Name- Prajwal ramani
standard- 10th, div- b
roll no. 18
project title- can drinks/soft drinks dispenser
DESCRIPTION- a program written for a drinks dispensing machine. the user will first input the money required for the give drinks like we do in a vending machine and accordingly the drinks will be given to the user. The machine also performs certain functions such as returning excess money, invalid input error message etc. hash map , recursion and if else is used in my program . Thank you
Name : Ananya Sridhar
Class : X-C
Roll No : 4
Project Title : Covid_Simulation
Description : Today,we are all living in a world plagued by covid 19.In such a situation, it is important for us to track the number of cases and plan for the future.This is a basic simulation in which the scenarios during complete lockdown , no lockdown and partial lockdown could be observed with suitable input from user i.e initial number of cases ,status (lockdown ,no lockdown……)and no. of days after spread.
import java.util.Scanner;
public class Digonose_Your_Disease
{
public static void main()
{
int x=0,y=0,z=0,a=0,b=0;
Digonose_Your_Disease d = new Digonose_Your_Disease();
Scanner sc = new Scanner(System.in);
System.out.println(“Welcome To Disease Test Centre”);
System.out.println(“1-Bubonic Plague”);
System.out.println(“2-SARS A.K.A. COVID-19”);
System.out.println(“3-Measles”);
System.out.println(“4-Yellow Fever”);
System.out.println(“5-Ebola”);
System.out.println(“Select the disease on which you want to be tested:”);
int ch=sc.nextInt();
switch(ch)
{
case 1:
{
w1:
while(x==0)
{
System.out.println(“1-Pain in abdomen or muscles”);
System.out.println(“2-Blood in cough”);
System.out.println(“3-Fever, chills or fatigue”);
System.out.println(“4-Diarrhoea, nausea, or vomiting”);
System.out.println(“5-None of the above”);
System.out.println(“Select a symptom from the above that you have:”);
int ch2=sc.nextInt();
if(1<=ch2&&ch2<=4)
{
System.out.println("You may have Bubonic Plague, please consult a doctor");
x = 1;
}//end of if 1
else if(ch2==5)
{
System.out.println("You don't have Bubonic Plague");
x = 1;
} //end of else if 1
else
{
System.out.println("Please chose from the given options");
continue w1;
}//end of else 1
}//end of while 1
break;
}//end of case 1
case 2:
{
w2:
while(y==0)
{
System.out.println("1-Pain in muscles");
System.out.println("2-Respiratory distress or shortness of breath");
System.out.println("3-Fever or chills ");
System.out.println("4-Coughing, infection, or headache");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch3=sc.nextInt();
if(1<=ch3&&ch3<=4)
{
System.out.println("You may have SARS A.K.A. COVID-19, please consult a doctor");
y=1;
}//end of if 2
else if(ch3==5)
{
System.out.println("You don't have SARS A.K.A. COVID-19");
y=1;
}//end of else if 2
else
{
System.out.println("Please chose from the given options");
continue w2;
}//end of else 2
}//end of while 2
break;
}//end of case 2
case 3:
{
w3:
while(z==0)
{
System.out.println("1-Pain in muscles");
System.out.println("2-Fever, malaise, fatigue, or loss of appetite");
System.out.println("3-Runny nose or sneezing");
System.out.println("4-skin rash, dry cough, diarrhoea, headache, sore throat, or swollen lymph nodes");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch4=sc.nextInt();
if(1<=ch4&&ch4<=4)
{
System.out.println("You may have Measles, please consult a doctor");
z=1;
}//end of if 3
else if(ch4==5)
{
System.out.println("You don't have Measles");
z=1;
}//end of else if 3
else
{
System.out.println("Please chose from the given options");
continue w3;
}//end of else 3
}//end of while 3
break;
}//end of case 3
case 4:
{
w4:
while(a==0)
{
System.out.println("1-Pain in abdomen or muscles");
System.out.println("2-Chills, fatigue, fever, or loss of appetite");
System.out.println("3-Nausea or vomiting");
System.out.println("4-Bleeding, delirium, headache, or yellow skin and eyes");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch5=sc.nextInt();
if(1<=ch5&&ch5<=4)
{
System.out.println("You may have Yellow Fever, please consult a doctor");
a=1;
} //end of if 4
else if(ch5==5)
{
System.out.println("You don't have Yellow Fever");
a=1;
}//end of else if 4
else
{
System.out.println("Please choose from the given options");
continue w4;
} //end of else 4
}//end of while 4
break;
}//end of case 4
case 5:
{
w5:
while(b==0)
{
System.out.println("1-Pain in abdomen, chest, joints, or muscles");
System.out.println("2-Chills, dehydration, fatigue, fever, loss of appetite, or sweating");
System.out.println("3-Diarrhoea, nausea, vomiting, or vomiting blood");
System.out.println("4-Eye redness, headache, mental confusion, red spots on skin, or sore throat");
System.out.println("5-None of the above");
System.out.println("Select a symptom from the above that you have:");
int ch6=sc.nextInt();
if(1<=ch6&&ch6<=4)
{
System.out.println("You may have Ebola, please consult a doctor");
b=1;
}//end of if 5
else if(ch6==5)
{
System.out.println("You don't have Ebola");
b=1;
}//end of else if 5
else
{
System.out.println("Please chose from the given options");
continue w5;
}//end of else 5
break;
}//end of while 5
}//end of case 5
default:
{
System.out.println("There are only 5 options, please choose from one of them");
d.main();
}//end of default
}//end of switch
d.exit();
}//end of void main
void exit()
{
Digonose_Your_Disease d2 = new Digonose_Your_Disease();
Scanner sc2 = new Scanner(System.in);
System.out.println("If you want exit the program press 0 \nIf you want to test yourself on another disease press any number");
int ch7 = sc2.nextInt();
switch(ch7)
{
case 0:
{
System.out.println("Thank You \nStay Home Stay Safe");
System.exit(0);
}//end of case 0
default :
{
d2.main();
}//end of default
}//end of switch
}//end of void exit
}//end of class
OUTPUT DEMO:
Welcome To Disease Test Centre
1-Bubonic Plague
2-SARS A.K.A. COVID-19
3-Measles
4-Yellow Fever
5-Ebola
Select the disease on which you want to be tested:
1
1-Pain in abdomen or muscles
2-Blood in cough
3-Fever, chills or fatigue
4-Diarrhoea, nausea, or vomiting
5-None of the above
Select a symptom from the above that you have:
5
You don't have Bubonic Plague
If you want exit the program press 0
If you want to test yourself on another disease press any number
0
Thank You
Stay Home Stay Safe
Name : Parva Naren Mankad
Std : 10th A
Roll No. 20
This project includes a small prototype of working in terms of a Telephone Company wherein it takes input from the User for the Number of Units Consumed by him and the Customer Identification Number and after calculation, displays the Bill Amount payable as Output. This can be used by the Telephone company for fast and reliable Bill Processing and create a database.
import java.util.scanner;
public class telephone_bills
{
public static void main()
{
int Units;
Scanner sc = new Scanner(System.in);
System.out.println(“Enter no of Units”);
Units=sc.nextInt();
int costomeridentityno;
System.out.println(“Enter your Customer Identification Number”);
Costomeridentityno= sc . nextInt();
double bill=0;
if(Units 80&& Units140&&Units200)
{
bill=250+36+30+(Units-200)*0.40;
}
System.out.println(“___________________________”);
System.out.println(“___________________________”);
System.out.println(“CUSTOMER IDENTIFICATION NUMBER : “+customeridentityno);
System.out.println(“No. OF UNITS ENTERED : “+Units);
System.out.println(“BILL PAYABLE : Rs. “+bill);
System.out.println(“___________________________”);
System.out.println(“___________________________”);
}
}
Name : Kanai Patel
STD.:X DIV.:B
Roll No.- 8
Title: Register Coronavirus cases in your area.
Description: You can register a Covid-19 case in your area by giving us some details which will be mentioned in the program
not in your area but for the union territories
there is a slight change in the program