I now take a different stand on things because in the next few weeks before the world cup starts things are gonna get real hot. There is this project that i have been working on for the last one month and since my lecture apparently seems not to be in need for all the code i have decided to post it right here then make a reference to it just in case he might need to confirm that my working prototype has a code.

I have seen people simply go to any sites that offer code and just download then print it very neatly presenting it for marking, anyone feeling like doing so is most welcome if you wanna just remember that you may get the good grades right now but and i insist i would be there when you get that job with a six figure salary and you are required to write some sort of program and you don’t have any idea of how to go about doing it.

So good people i know that this is not supposed to be my excuse but what ever flaws you find in my code just comment on it because am still an undergraduate and tryna polish my skills which apparently seem to be coming all at once i mean programming,networking and databases.

finally just to explain the layout. There are a total of eight classes which all have been combined in my final class(not included) to produce a coherent HIGH SCHOOL MANAGEMENT SYSTEM.The programming language used is java and hence much acknowledgment to xenox software who have produced the priceless Jcreator which i used to edit the code.

CLASS ASSETS

import java.util.Scanner;

import javax.swing.JOptionPane;

public class assets

{

private int assetId;

private String aName;

private String dateAcq;

private long aWorth;

Scanner input=new Scanner(System.in);

public assets(int assetId,String aName,String dateAcq,long aWorth)

{

this.assetId=assetId;

this.aName=aName;

this.dateAcq=dateAcq;

this.aWorth=aWorth;

}

public void adddetails()

{

System.out.println(“please enter asset ID”);

this.assetId=input.nextInt();

System.out.println(“please enter asset name”);

this.aName=input.nextLine();

System.out.println(“please enter asset’s date Acquired”);

this.dateAcq=input.nextLine();

System.out.println(“please enter asset worth”);

this.aWorth=input.nextLong();

}

public void getdetails()

{

System.out.printf(“the asset id is%25d\n”,this.assetId);

System.out.printf(“the asset name is%25s\n”,this.aName);

System.out.printf(“Acquired on %25s\n”,this.dateAcq);

System.out.printf(“worth %25d Kshs.\n”,this.aWorth);

}

public void getupdatedassetworth()

{

Scanner in=new Scanner(System.in);

double inval=this.aWorth;

System.out.println(“Enter the number of years”);

double years=in.nextDouble();

System.out.println(“Enter the interest rate”);

double rate=in.nextDouble();

double temp=(1+(rate/100));

double temp1=inval*temp;

double newval=Math.pow(temp1,years);

System.out.println(“The original value is \t”+inval);

System.out.println(“The original value is \t”+newval);

}

public static void main (String[] args)

{

assets myasset=new assets(1234,”building”,”12/01/1996″,1500000);

int choice;

do{

String prompt=String.format(“1 to add\n2 to see details\n3 to get appreciated value\n4 quit”);

String choic=JOptionPane.showInputDialog(prompt);

choice=Integer.parseInt(choic);

if(choice==1){

JOptionPane.showMessageDialog(null,”Enter details shortly”,”your choice”,JOptionPane.INFORMATION_MESSAGE);

myasset.adddetails();}

else

if(choice==2){

JOptionPane.showMessageDialog(null,”check asset details shortly”,”your choice”,JOptionPane.INFORMATION_MESSAGE);

myasset.getdetails();}

else

if(choice==3){

myasset.getupdatedassetworth();}

else

JOptionPane.showMessageDialog(null,”good bye. another time”,”your choice”,JOptionPane.ERROR_MESSAGE);

}while(choice!=3);

}

}

CLASS STUDENT

import java.util.Scanner;

class j

{

private int[] admNo=new int[100];

private int[] marks=new int[100];

Scanner input=new Scanner(System.in);

public void markadmin()

{

for(int i=0;i {

this.admNo[0]=7903;

System.out.printf(“enter student %d admission number%2d”,i+1,this.admNo[i]);

this.admNo[i]=this.admNo[1]+1;

System.out.println(“enter KCPE marks”);

this.marks[i]=input.nextInt();

}

}

public void dispmarkadm()

{

System.out.println(“ADM NO\tMARKS”);

for(int i=0;i {

System.out.printf(“%d\t%d”,this.admNo[i],this.marks[i]);

System.out.println();

}

}

public static void main (String[] args) {

j hyb=new j();

Scanner in=new Scanner(System.in);

int choice;

do{

System.out.println(“1: to add\n2: to see to\n3: QUIT”);

choice=in.nextInt();

if(choice==1)

hyb.markadmin();

else

if(choice==2)

hyb.dispmarkadm();

else

System.out.println(“exiting”);

}while(choice}

}

CLASS EVENTS

import java.util.Scanner;

import javax.swing.JOptionPane;

public class events

{

public static final int arrL=3;

private String[] type=new String[arrL];

private String[] date=new String[arrL];

private String[] venue=new String[arrL];

private String[] award=new String[arrL];

Scanner input=new Scanner(System.in);

public void addevent()

{

for(int i=0;i {

System.out.println(“Enter the event type/name”);

type[i]=input.nextLine();

System.out.println(“Enter the event date”);

date[i]=input.nextLine();

System.out.println(“Enter the event venue”);

venue[i]=input.nextLine();

System.out.println(“Enter the event award”);

award[i]=input.nextLine();

}

}

public void getevent()

{

for(int i=0;i {

System.out.printf(“EVENT NAME/TYPE:\t%s”,type[i]);

System.out.printf(“\nEVENT DATE:\t%s”,type[i]);

System.out.printf(“\nEVENT VENUE:\t%s”,type[i]);

System.out.printf(“\nEVENT AWARD:\t%s”,type[i]);

System.out.println(“\n”);

}

}

public static void main (String[] args)

{

events funkie=new events();

String prompt;

prompt=JOptionPane.showInputDialog(“PLEASE MAKE A CHOICE\n1 TO ADD EVENT\n2 TO CHECK EVENTS\n3 TO QUIT”);

if(prompt==null){

JOptionPane.showMessageDialog(null,”null input”,”ERROR”,JOptionPane.ERROR_MESSAGE);}

else{

int x=Integer.parseInt(prompt);

if(x==1)

funkie.addevent();

else

if(x==2)

funkie.getevent();

else

JOptionPane.showMessageDialog(null,”GOOD BYE!”,”YOUR CHOICE”,JOptionPane.PLAIN_MESSAGE);}

}

}

CLASS SCHOOL

import java.util.Scanner;

public class school

{

//public static final string pass=”xxxx”;

private long regNo;

private String name;

private long code;

private String admin;

private String inDate;

Scanner input=new Scanner(System.in);

public school(long regNo,String name,long code,String admin,String inDate)

{

this.regNo=regNo;

this.name=name;

this.code=code;

this.admin=admin;

this.inDate=inDate;

}

public void setreg()

{

System.out.println(“enter registration number”);

this.regNo=input.nextLong();

}

public long getreg()

{

return this.regNo;

}

public void setname()

{

System.out.println(“enter name”);

this.name=input.nextLine();

}

public String getname()

{

return this.name;

}

public void setcode()

{

System.out.println(“enter school code”);

code=input.nextLong();

}

public long getcode()

{

return this.code;

}

public void setadmin()

{

System.out.println(“enter principal’s name”);

this.admin=input.nextLine();

}

public String getadmin()

{

return this.admin;

}

public void setindate()

{

System.out.println(“enter inception date”);

this.inDate=inDate;

}

public String getindate()

{

return this.inDate;

}

//school realsch=new school(2123,”KABAA HIGH SCHOOL”,301502,”MR. DOMINIC MATHEKA”,”12/01/1924″);

public static void main (String[] args)

{

Scanner in=new Scanner(System.in);

school chuo=new school(2123,”KABAA HIGH SCHOOL”,301502,”MR. DOMINIC MATHEKA”,”12/01/1924″);

//System.out.println(“please a enter your code”);

//String ps=in.nextLine();

//if(ps==pass)

int choice;

do{

System.out.println(“1: To update\n2: to check details”);

choice=in.nextInt();

if(choice==1)

{

chuo.setreg();

chuo.setadmin();

chuo.setname();

chuo.setcode();

chuo.setindate();

}

else

if(choice==2)

{

System.out.println(“your details below”);

System.out.println(chuo.getreg());

System.out.println(chuo.getname());

System.out.println(chuo.getcode());

System.out.println(chuo.getadmin());

System.out.println(chuo.getindate());

}

else

System.out.println(“invalid input”);

}while(choice!=3);

}

}

CLASS STAFF

import javax.swing.JOptionPane;

import java.util.Scanner;

public class staff//the base class:classes teaching an non-teaching will be derive fro here

{

protected String name[]=new String[3];

protected String gender[]=new String[3];

protected int yrJoin[]=new int[5];

//private int yrEnd[]=new int[5] ;

protected String dept[]=new String[3];

Scanner input=new Scanner(System.in);

/*public staff(String name,String gender,int yrJoin,int yrEnd,String dept)

{

this.name=name;

this.gender=gender;

this.yrJoin=yrJoin;

this.yrEnd=yrEnd;

this.dept=dept;

}*/

public void regstaff()

{

String prompt=String.format(“how many members do you want to add”);

String promp=JOptionPane.showInputDialog(prompt);

int x=Integer.parseInt(promp);

for(int i=0;i {

System.out.printf(” STAFF NO.%d\n\n”,i+1);

System.out.println(“enter staff name\n”);

this.name[i]=input.nextLine();

System.out.println(“enter staff gender\n”);

this.gender[i]=input.nextLine();

System.out.println(“enter joining year\n”);

this.yrJoin[i]=input.nextInt();

System.out.println(“enter staff department\n”);

this.dept[i]=input.nextLine();

}

}

public void checkdet()

{

for(int i=0;i {

System.out.printf(“\n\nSTAFF NO.%d”,i+1);

System.out.printf(“\n%5s%10s”,”NAME:”,this.name[i]);

System.out.printf(“\n%5s%10s”,”GENDER:”,this.gender[i]);

System.out.printf(“\n%5s%d”,”JOINING YEAR:”,this.yrJoin[i]);

System.out.printf(“\n%5s%10s”,”DEPARTMENT:”,this.dept[i]);

}

}

public static void main (String[] args)

{

Scanner in=new Scanner(System.in);

staff mfanyi=new staff();

int choice;

do{

System.out.println(“\n\n1: to add staff\n2: to check\n3: to exit”);

choice=in.nextInt();

if(choice==1)

{

mfanyi.regstaff();

}

else

if(choice==2)

{

mfanyi.checkdet();

}

else

if(choice==3)

{

System.out.println(System.currentTimeMillis());

}

else

System.out.println(“invalid input”);

}while(choice!=3);

}

}

CLASS SUB STAFF

import javax.swing.JOptionPane;//import class Joptionpane for the dialogs

import java.util.Scanner;//import class scanner for input

public class substaff extends staff//class sub staff inherits from class staff

{

public static final int arrL=10;//declaring constant arrL

private String staffId[]=new String[arrL];//declaring and initializing array staffid

private String salgrade[]=new String[arrL];//declaring and initializing array salgrade

Scanner input=new Scanner(System.in);//creating object input to allow keyboard input

public void regstaff()//this method overrides base class regstaff method

{

String prompt=JOptionPane.showInputDialog(“How Many workers”);

int x=Integer.parseInt(prompt);

for(int i=1;i {

System.out.println(“enter staff Id\n”);

staffId[i]=input.nextLine();

System.out.println(“enter th salary grade\n”);

salgrade[i]=input.nextLine();

System.out.println(“enter staff name\n”);

name[i]=input.nextLine();

System.out.println(“enter staff gender\n”);

gender[i]=input.nextLine();

System.out.println(“enter joining year\n”);

yrJoin[i]=input.nextInt();

System.out.println(“enter staff department\n”);

dept[i]=input.nextLine();

}

}

public void checkdet()//overrides base class’s checkdet method

{

for(int i=1;i {

System.out.printf(“Staff Id is %s”,staffId[i]);

System.out.printf(“the salary grade is %s”,salgrade[i]);

System.out.printf(“\n%5s%10s”,”NAME:”,name[i]);

System.out.printf(“\n%5s%10s”,”GENDER:”,gender[i]);

System.out.printf(“\n%5s%d”,”JOINING YEAR:”,yrJoin[i]);

System.out.printf(“\n%5s%10s”,”DEPARTMENT:”,dept[i]);

}

}

public static void main(String[] args)//method main

{

substaff mkazi=new substaff();//create object mkazi of class substaff

//displays an dialog box prompting user to their choice

String prompt=JOptionPane.showInputDialog(“1: TO ENTER DETAILS\n2 TO CHECK DETAILS\n3 TO QUIT”);

int choice=Integer.parseInt(prompt);//converting the string input to integer

if(choice==1)

mkazi.regstaff();

else

if(choice==2)

mkazi.checkdet();

else

JOptionPane.showMessageDialog(null,”GOOD BYE!”,”YOUR CHOICE”,JOptionPane.PLAIN_MESSAGE);

}//end method main

}//end class substaff

CLASS TEACH STAFF

import javax.swing.JOptionPane;

import java.util.Scanner;

public class teachstaff extends staff

{

public static final int array=3;

private String status[]=new String[array];

private long tscNo[]=new long[array];

Scanner input=new Scanner(System.in);

public void regstaff()//method overrides base class regstaff method

{

String prompt=JOptionPane.showInputDialog(“How Many Teachers”);

int x=Integer.parseInt(prompt);

for(int i=1;i {//Note that instance variables name,gender and yrJoin have been inherited from class staff

System.out.println(“enter GoK or B.O.G.”);

status[i]=input.nextLine();

System.out.println(“enter the TSC Nnumber”);

tscNo[i]=input.nextLong();

System.out.println(“enter staff name\n”);

name[i]=input.nextLine();

System.out.println(“enter staff gender\n”);

gender[i]=input.nextLine();

System.out.println(“enter joining year\n”);

yrJoin[i]=input.nextInt();

}

}

public void checkdet()//overrides base class’s checkdet method

{

for(int i=1;i {

System.out.printf(“Employed by: %10s”,status[i]);

System.out.printf(“TSC No: %10s”,tscNo[i]);

System.out.printf(“\n%5s%10s”,”NAME:”,name[i]);

System.out.printf(“\n%5s%10s”,”GENDER:”,gender[i]);

System.out.printf(“\n%5s%d”,”JOINING YEAR:”,yrJoin[i]);

}

}

public static void main (String[] args) {

teachstaff mwalimu=new teachstaff();

String prompt=JOptionPane.showInputDialog(“1 to register teacher\n2 to check teacher details”);

int prom=Integer.parseInt(prompt);

if(prom==1)

mwalimu.regstaff();

else

if(prom==2)

mwalimu.checkdet();

else

JOptionPane.showMessageDialog(null,”Good Bye”,”Your Choice”,JOptionPane.PLAIN_MESSAGE);

}

}

if you are familiar with object oriented development the you can consider this one of the phases of the numerous iteration that are involved as you can see all the components involved with the graphical user interface have not been involved.