JAVA PROGRAM TO CREATE A DATABASE (SAMPLE PICTURE IS GIVEN)

THIS IS THE PROGRAM OF TAKING USERS INPUT




import com.sun.source.doctree.SystemPropertyTree;
import jdk.swing.interop.SwingInterOpUtils;
import org.w3c.dom.ls.LSOutput;

import javax.swing.*;
import java.util.Scanner;
import java.util.function.BinaryOperator;

public class GlaStudentsDetailApplication {

public static void main(String[] args){
int n;
int sum;
int rollsum;
boolean HostelChoice =true ;
Scanner scan = new Scanner(System.in);
// WE ARE ADDING THIS TO GENERATE STUDENT ROLL NUMBER

System.out.println("ENTER THE NUMBER OF STUDENTS YOU HAVE ENTERED BEFORE THIS STUDENT:");
int serialnumber = scan.nextInt();
scan.nextLine();
System.out.println("ENTER THE NAME OF STUDENT:");
String snam = scan.nextLine();
System.out.println("ENTER THE FATHER'S NAME OF STUDENT:");
String fname = scan.nextLine();
System.out.println("ENTER THE MOTHER'S NAME OF STUDENT:");
String mname = scan.nextLine();
System.out.println("ENTER THE PERMANENT ADDRESS OF STUDENT:");
String saddress = scan.nextLine();
System.out.println("ENTER THE CONTACT NUMBER OF STUDENT:");
long scontactnumber = scan.nextLong();
System.out.println("ENTER THE STUDENT'S FATHER CONTACT NUMBER:");
long sfathercontactnumber =scan.nextLong();
System.out.println("ENTER STUDENT'S MOTHER CONTACT NUMBER:");
long smothercontactnumber = scan.nextLong();
System.out.println("ENTER THE PERCENTAGE OF STUDENT IN 12th STANDARD:");
double s12thmarks = scan.nextDouble();
System.out.println("ENTER THE STUDENT'S 10th MARKS:");
double s10marks = scan.nextDouble();
System.out.println("ENTER THE CHOICE OF STUDENT FOR HOSTEL:");
System.out.println("PAY ATTENTION!!!!!!!");
System.out.println("NOTE: IF STUDENT NEEDS HOSTEL THEN PRINT'true' otherwise write 'false'");
boolean shostelchoice = scan.nextBoolean();




//NOW WE WILL WORK FOR PRINTING THE STUDENT'S DETAILS

System.out.println("Student Name:" +" "+snam.toUpperCase());
System.out.println("Father's Name:" + " " +fname.toUpperCase());
System.out.println("Mother's Name:" + " "+mname.toUpperCase());
System.out.println("Permanent Address:" + " "+saddress.toUpperCase());
System.out.println("Student's Contact Number:"+ " " +scontactnumber);
System.out.println("Father's Contact Number:" + " " +sfathercontactnumber);
System.out.println("Mother's Contact Number:" + " " +smothercontactnumber);
System.out.println("Percentage in 12th:" + " " +s12thmarks);
System.out.println("Percentage in 10th:" + " " +s10marks);

if (shostelchoice== true) {
System.out.println("Hostel Choice:" + true);
} else {
System.out.println("Hostel Choice:" + false);
}



// we are now generating the class roll numbere and university roll number
sum = (28151000 + serialnumber +1);
rollsum = serialnumber + 1;
System.out.println("Year: 1");
System.out.println("Section: A");
if (serialnumber!=0) {
System.out.println("Class Roll Number:" +" " +rollsum );
System.out.println("University Roll Number:"+ " " +sum);
}else{
System.out.println("Class Roll Number: 1");
System.out.println("University Roll Number: 201510001");
}

//
System.out.println("Course: B.Tech CSE");





}
}

Comments

Popular posts from this blog

PROGRAM OF CALCULATING INTERSECTION OF TWO ARRAYS

Craze for Fashion