Click here to Skip to main content
16,019,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Write a simple java program to implement school management system in eclipse with CRUD operations .It need to accept student data like id, name and gender and teacher data like name, subject and salary details

(donot use NetBeans, Mysql database)Only Eclipse and Java code.

What I have tried:

i wrote a program with if and else if. but i need to perform insert, update, delete and display operations on student record and teacher record using collections or constructors in Java eclipse.
Posted
Updated 11-Sep-22 23:11pm

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
package scl_management;
import java.util.*;

public class Main1 {

    public static void main(String[] args) {
       
        String t="Teacher";
        String s="student";
        Teacher1 science = new Teacher1("malathi",    "Science",    7000.00);
        Teacher1 social	 = new Teacher1("Ramani",     "social",   	6000.00);
        Teacher1 english = new Teacher1("Prabhakar",  "English",    9000.00);
        Teacher1 maths   = new Teacher1("Ramu",  	  "Maths",    	7900.00);

        
        List<Teacher1> teacherList = new ArrayList<>();
        teacherList.add(science);
        teacherList.add(social);
        teacherList.add(english);
        teacherList.add(maths);



        Student1 s1 = new Student1(401,		"Abhi",		"Male");
        Student1 s2 = new Student1(402,		"sonia",	"Female");
        Student1 s3 = new Student1(403,		"lucky",	"Female");
        
        List<Student1> studentList = new ArrayList<>();

        studentList.add(s1);
        studentList.add(s2);
        studentList.add(s3);

        System.out.println("========================================================================================");
        System.out.println("\t\t\t\t\tD.A.V Public School Database\t\t\t\t\t\t");
        System.out.println("===================================================================================================");

       

       System.out.println("1.TeacherRecord");      
       System.out.println();
       System.out.println("5.Student Record");
       System.out.println();
       Scanner scan=new Scanner(System.in);
       System.out.println("Choose the value");
       int ch=scan.nextInt();
       if(ch==1)
       
      {
    	System.out.println("2.Science Teacher");
        System.out.println("3.Social Teacher");
        System.out.println("4.English Teacher");
        System.out.println("5.Maths Teacher");
        System.out.println();
      	Scanner scan1=new Scanner(System.in);
    	System.out.println("Select the teachers data you want to display: ");
    	int c=scan1.nextInt();
    	
    	if(c==2)
    	{
    		System.out.println("2.Science Teacher");
            System.out.println("3.Social Teacher");
            System.out.println("4.English Teacher");
            System.out.println("5.Maths Teacher");
            System.out.println();
    		System.out.println("Here comes the data"+science.getName()+"!");
    		System.out.println("===============================================");
    		System.out.println("Designation  	   : "+t);
    		System.out.println("Name of the teacher: " + science.getName());
    		System.out.println("Subject            : " +science.getSubject());
    		System.out.println(" Salary income     : "+science.getSalary());
    		System.out.println("\n=============================================");
    	}
    	
    	else if(c==3)
    	{
    		System.out.println("2.Science Teacher");
            System.out.println("3.Social Teacher");
            System.out.println("4.English Teacher");
            System.out.println("5.Maths Teacher");
            System.out.println();
    		System.out.println("Here comes the data"+social.getName()+"!");
        	System.out.println("===============================================");
            System.out.println("Designation  	   : "+t);
            System.out.println("Name of the teacher: " + social.getName());
            System.out.println("Subject            : " +social.getSubject());
            System.out.println(" Salary income     : "+social.getSalary());
            System.out.println("\n=============================================");
        	}
    	
    	else if(c==4)
    	{
    		System.out.println("2.Science Teacher");
            System.out.println("3.Social Teacher");
            System.out.println("4.English Teacher");
            System.out.println("5.Maths Teacher");
            System.out.println();
    		System.out.println("Here comes the data"+english.getName()+"!");
        	System.out.println("===============================================");
            System.out.println("Designation  	   : "+t);
            System.out.println("Name of the teacher: " + english.getName());
            System.out.println("Subject            : " +english.getSubject());
            System.out.println(" Salary income     : "+english.getSalary());
            System.out.println("=============================================");
        }
    	else if(c==5)
    	{
    		System.out.println("2.Science Teacher");
            System.out.println("3.Social Teacher");
            System.out.println("4.English Teacher");
            System.out.println("5.Maths Teacher");
            System.out.println();
    		System.out.println("Here comes the data"+maths.getName()+"!");
    		System.out.println("===============================================");
    		System.out.println("Designation  	   : "+t);
    		System.out.println("Name of the teacher: " + maths.getName());
    		System.out.println("Subject            : " +maths.getSubject());
    		System.out.println("Salary income      : "+maths.getSalary());
    		System.out.println("===============================================");

    		}
      	}
         
       else if(ch==6)
    	{
    		System.out.println("6.Student Record");
    		System.out.println("7.Student Record");
    		System.out.println("8.Student Record");
    		Scanner scan2=new Scanner(System.in);
    		System.out.println("Select the Student data you want to display: ");
       	 	int c=scan2.nextInt();
      	
       	 	if(c==7)
       	 	{
       	 		System.out.println("6.Student Record");
       	 		System.out.println("7.Student Record");
       	 		System.out.println("8.Student Record");  
       	 		System.out.println("Here comes the data"+s1.getName()+"!");
       	 		System.out.println("===============================================");
       	 		System.out.println("Designation  	 : "+s);
       	 		System.out.println("Student Name	 : " +s1.getName());
       	 		System.out.println("Admission ID	 : "+s1.getId());
       	 		System.out.println("Gender 			 : "+ s1.getGender());
       	 		System.out.println("===============================================");
        
       	 	}
      	
       	 	else if(c==8)
       	 	{
       	 		System.out.println("6.Student Record");
       	 		System.out.println("7.Student Record");
       	 		System.out.println("8.Student Record");
       	 		System.out.println("Here comes the data"+s2.getName()+"!");
       	 		System.out.println("===============================================");
       	 		System.out.println("Student Name    : "+ s2.getName());
       	 		System.out.println("Admission ID	: "+s2.getId());
       	 		System.out.println("Gender			: "+ s2.getGender());
       	 		System.out.println("===============================================");
       	 	}
      	
       	 	else if(c==9)
       	 	{
       	 		System.out.println("6.Student Record");
       	 		System.out.println("7.Student Record");
       	 		System.out.println("8.Student Record");
       	 		System.out.println("Here comes the data"+s2.getName()+"!");
       	 		System.out.println("===============================================");   
       	 		System.out.println("Student Name 	: "+ s3.getName());
       	 		System.out.println("Admission ID 	: "+s3.getId());
       	 		System.out.println("Gender		    : "+ s3.getGender());
       	 		System.out.println("===============================================");

       	 	}
    	}
    }
}
 
Share this answer
 
v3
Comments
Patrice T 25-Dec-21 17:15pm    
Use Improve question to update your question.
So that everyone can pay attention to this information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900