Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

OOPS PROJECT-10 CODE

import java.io.*;
import java.util.*;
class StudInfo {
String name,course;
int oops,dms,ds,tot,oopsgpa,dmsgpa,dsgpa,backlogs,cgpa;
int dsi,oopsi,dmsi;
double avg;
double fee,dew;
long regnum;
long regno;
public void registration()
{
System.out.println("\n\n\t\t WELCOME TO KL UNIVERSITY");
System.out.println("\n\n\t\t WELCOME TO CSE REGISTRATION");
try
{
Scanner s=new Scanner(System.in);
int r;
System.out.print("\n\n\t\t enter your rank: ");
r=s.nextInt();
if(r<=1000)
{
String Name,Fathername;
long cnum;
System.out.print("\n\n\t\t enter your name:");
Name=s.next();
System.out.print("\n\n\t\t enter your fathers name:");
Fathername=s.next();
System.out.print("\n\n\t\t enter your contact number:");
cnum=s.nextLong();
System.out.print("\n\n\t\t"+Name+"\n\nyou have succesfully registered your seat in CSE
branch\n ");

}
else if((r>=1000)&&(r<=1500))
{
System.out.print("\n\n\t\t your registration into cse is not sure please wait..\n\n");
}
else
{
System.out.print("\n\n\t you are not eligible for CSE\n");
}
}
catch(Exception e){
System.out.println(e);
}
}
void getstudentdetails()
{
System.out.println("ENTER THE FEE YOU ARE WILLING PAY TO REGISTER IN
THE SEMISTER");
Scanner sc2=new Scanner(System.in);
fee=sc2.nextDouble();
if (fee<100000)
{
System.out.println("Total fee is not payed\n");
System.out.println("Please pay the dew amount to continue registration\n");
dew=100000-fee;
System.out.println("The dew amount is:"+dew);
System.out.println("Continue pay dew amount in Dew section");
}
System.out.println("\n\t\t\tenter no of backlogs");
int backlogs=sc2.nextInt();
if(backlogs>0)
{
System.out.println("\n\t\t\tYou are eligible for special registration\n");
if(backlogs>=1)
System.out.println("Your registration will be held at 8:00 am to 10:00 am tomorrow\n");
}
else
{
System.out.println("you can register to the courses");
System.out.println("enter your registration number in between [170030000–
170032000]");
regnum=sc2.nextLong();
if((regnum>=170030000)&&(regnum<=170030500))

{
System.out.println("your registation time slot is in between 9:00am to 12:00pm on
day1");
}
else if((regnum>=170030501)&&(regnum<=1700301000))

{
System.out.println("your registation time slot is in between 1pm to 4pm on day1");
}
else if((regnum>=170031001)&&(regnum<=170031500))

{
System.out.println("your registation time slot is in between 9:00am to 12:00pm on
day2");
}
else if((regnum>=1700301501)&&(regnum<=1700302000))

{
System.out.println("your registation time slot is in between 1:00pm to 4:00pm");
}}
Scanner sc1=new Scanner(System.in);
System.out.print("\n\n Enter ID No.\t:\t");
regno=sc1.nextLong();
System.out.print("\n Enter Name \t:\t");
name=sc1.next();
System.out.println();
System.out.println("Enter OOPS Internal marks out of 50 ID: "+regno);
oopsi=sc1.nextInt();
System.out.println("Enter DMS Internal marks out of 50 ID: "+regno);
dmsi=sc1.nextInt();
System.out.println("Enter DS Internal marks out of 50 ID: "+regno);
dsi=sc1.nextInt();
if(oopsi<21)
{
System.out.println("Student is detained in OOPS course\n");
}
if(dmsi<21)
{
System.out.println("Student is detained in DMS course\n");
}
if(dsi<21){
System.out.println("Student is detained in DS course\n");
}
System.out.print("Enter OOPS External marks out of 100: ");
oops=sc1.nextInt();
System.out.print(" Enter DMS External Marks out of 100: ");
dms=sc1.nextInt();
System.out.print(" Enter DS External Marks out of 100: ");
ds=sc1.nextInt();

if(oops>=85)
oopsgpa=10;
else if(oops>=80&&oops<85)
oopsgpa=9;
else if(oops>=65&&oops<80)
oopsgpa=8;
else if(oops>=60&&oops<65)
oopsgpa=7;
else if(oops>=50&&oops<60)
oopsgpa=6;
else if(oops>=40&&oops<50)
oopsgpa=5;
else
oopsgpa=0;
if(dms>=85)
dmsgpa=10;
else if(dms>=80&&dms<85)
dmsgpa=9;
else if(dms>=65&&dms<80)
dmsgpa=8;
else if(dms>=60&&dms<65)
dmsgpa=7;
else if(dms>=50&&dms<60)
dmsgpa=6;
else if(dms>=40&&dms<50)
dmsgpa=5;
else
dmsgpa=0;
if(ds>=85)
dsgpa=10;
else if(ds>=80&&ds<85)
dsgpa=9;
else if(ds>=65&&ds<80)
dsgpa=8;
else if(ds>=60&&ds<65)
dsgpa=7;
else if(ds>=50&&ds<60)
dsgpa=6;
else if(ds>=40&&ds<50)
dsgpa=5;
else
dsgpa=0;
tot=oops+dms+ds;
avg=tot/3;
cgpa=(oopsgpa+dmsgpa+dsgpa)/3;
System.out.println("cgpa of the student:"+cgpa);

if(cgpa>3.5)
{
System.out.println("regno is: "+regno);
System.out.println("name is: "+name);
}

System.out.println("\n"+"\n Roll No.\t:\t"+regno+


"\n Name \t:\t"+name+
"\n objectorientedprogramming \t:\t"+oops+
"\n discretemaths \t:\t"+dms+
"\n datastructures. \t:\t"+ds+
"\n Total \t:\t"+tot+
"\n Average. \t:\t"+avg);

System.out.print(" Grade \t:\t");


if((oops>=50)&&(dms>=50)&&(ds>=50))
{
if(avg>=91) System.out.print("O"+" "+"10"+" "+"gpa");
else if(avg>=81) System.out.print("A"+" "+"9"+" " +"gpa");
else if(avg>=71) System.out.print("B"+" "+"8"+" "+"gpa");
else if (avg>=61) System.out.print("C"+" "+"7"+" "+"gpa");
else if(avg>=51) System.out.print("D"+" "+"6"+" "+"gpa");
else
{
System.out.print("Fail");
}
}
else System.out.print("Fail");
System.out.println();

}
}

class Test
{
public static void main(String[] args)
{
StudInfo s=new StudInfo();
s.registration();
String ch1="yes";
while (ch1.equals("yes"))
{
s.getstudentdetails();

System.out.println("do want to enter another student details");


System.out.println("enter[yes or no]");
Scanner sc=new Scanner(System.in);
ch1=sc.next();
}

System.out.println("end of the program");


System.out.println("thanks for your visit..");

}
}

You might also like