Tuesday, October 19, 2010

chess board designed by Ezra Machira

The diagram above shows the chess board without pieces





below is the source code for chess board 
import java.awt.*;
import javax.swing.*;

public class Chess_ezra extends JFrame {

    private JPanel myPanel;
    private DrawingPanel drawPanel;
     static Chess_ezra myChessBoard;
     private int x = 100, y = 60;

    public Chess_ezra() {
   
           super("Chess ");
   
        myPanel = new JPanel();
        myPanel.setLayout(null);
        myPanel.setBackground(Color.ORANGE);

        drawPanel= new DrawingPanel();
        drawPanel.setBounds(myPanel.getWidth() / 2, myPanel.getHeight() / 2, 1000, 1000);
        drawPanel.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 5));
        myPanel.add(drawPanel, BorderLayout.CENTER);
         setContentPane(myPanel);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(1000,700);
        setLocationRelativeTo(null);
        setVisible(true);

      

    }

    public static void main(String[] args) {
         myChessBoard = new  Chess_ezra();
           }


     class DrawingPanel extends JPanel {
        private int x = 100, y = 60;   

        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2d = (Graphics2D) g;
            drawingMethod(g2d);
        }

       private void drawingMethod(Graphics2D g2d) {
          
            for (int i = 0; i <= 8; ++i) {
                g2d.drawLine(x, (y * i) + 60, x + 800, (y * i) + 60);
                }
           
         for (int j = 0; j <= 8; ++j) {
                    g2d.drawLine((x * j) + 100, y, (x * j) + 100, y + 480);
               }
      
          g2d.setColor(Color.BLACK);
          g2d.fillRect(200, 60, 100, 60);
           g2d.setFont(new Font("algerian", Font.PLAIN, 20));

         
          g2d.drawString("CHESS BOARD ",380, 50);
           g2d.setFont(new Font("constantia", Font.PLAIN,30));
          g2d.drawString("designed by Ezra F. Machira!",580, 690);
          ImageIcon myImage3 = new ImageIcon("d:\\machira\\chess2.png");
          Image picImage3 = myImage3.getImage();
          g2d.drawImage(picImage3,130,65, this);
          ImageIcon myImage = new ImageIcon("d:\\machira\\chess1.png");
          Image picImage = myImage.getImage();
          g2d.drawImage(picImage, 230,65, this);
         


          ImageIcon myImage6 = new ImageIcon("d:\\machira\\chess3.png");
          Image picImage6 = myImage6.getImage();
          g2d.drawImage(picImage6, 330,65, this);
         
         g2d.fillRect(400, 60, 100, 60);
          ImageIcon myImage8 = new ImageIcon("d:\\machira\\chess5.png");
          Image picImage8 = myImage8.getImage();
          g2d.drawImage(picImage8, 430,61, this);         
                  
         
          ImageIcon myImage9 = new ImageIcon("d:\\machira\\chess2.png");
          Image picImage9 = myImage9.getImage();
         
          g2d.fillRect(100, 120, 100, 60);
          g2d.fillRect(300, 120, 100, 60);
          g2d.fillRect(500, 120, 100, 60);
         g2d.fillRect(700, 120, 100, 60);

          g2d.drawImage(picImage9, 130,125, this);         
          g2d.drawImage(picImage9, 230,125, this);         
          g2d.drawImage(picImage9, 330,125, this);         
          g2d.drawImage(picImage9, 430,125, this);         
          g2d.drawImage(picImage9, 530,125, this);       
          g2d.drawImage(picImage9, 630,125, this);         
          g2d.drawImage(picImage9, 730,125, this);
          g2d.drawImage(picImage9, 830,125, this);           

          g2d.fillRect(200, 180, 100, 60);
          g2d.fillRect(400, 180, 100, 60);
          g2d.fillRect(600, 180, 100, 60);
          g2d.fillRect(800, 180, 100, 60);           
       
          g2d.fillRect(100, 240, 100, 60);
          g2d.fillRect(300, 240, 100, 60);
          g2d.fillRect(500, 240, 100, 60);
          g2d.fillRect(700, 240, 100, 60);
           
          g2d.fillRect(200, 300, 100, 60);
          g2d.fillRect(400, 300, 100, 60);
          g2d.fillRect(600, 300, 100, 60);
          g2d.fillRect(800, 300, 100, 60);
           
          g2d.fillRect(100, 360, 100, 60);
          g2d.fillRect(300, 360, 100, 60);
          g2d.fillRect(500, 360, 100, 60);
          g2d.fillRect(700, 360, 100, 60);

         g2d.fillRect(800, 60, 100, 60);
           
          ImageIcon myImage4 = new ImageIcon("d:\\machira\\chess2.png");
          Image picImage4 = myImage4.getImage();
          g2d.drawImage(picImage4, 830,65, this);
         
          ImageIcon myImage2 = new ImageIcon("d:\\machira\\chess1.png");
          Image picImage2 = myImage2.getImage();
          g2d.drawImage(picImage2,730,65, this);
         
          g2d.fillRect(600, 60, 100, 60);
          ImageIcon myImage5 = new ImageIcon("d:\\machira\\chess3.png");
          Image picImage5 = myImage5.getImage();
          g2d.drawImage(picImage5, 630,65, this);
         
          ImageIcon myImage7 = new ImageIcon("d:\\machira\\chess4.png");
          Image picImage7 = myImage7.getImage();
          g2d.drawImage(picImage7, 530,61, this);


                   
          ImageIcon myImage17 = new ImageIcon("d:\\machira\\chess6.png");
          Image picImage17 = myImage17.getImage();
          g2d.drawImage(picImage17,130,428, this);
         
          g2d.fillRect(200, 420, 100, 60);
          g2d.fillRect(400, 420, 100, 60);
          g2d.fillRect(600, 420, 100, 60);
          g2d.fillRect(800, 420, 100, 60);
          g2d.fillRect(100, 480, 100, 60);
             
          g2d.drawImage(picImage17,230,428, this);
          g2d.drawImage(picImage17,330,428, this);
          g2d.drawImage(picImage17,430,428, this);       
          g2d.drawImage(picImage17,530,428, this);
          g2d.drawImage(picImage17,630,428, this);
          g2d.drawImage(picImage17,730,428, this);
          g2d.drawImage(picImage17,830,428, this);
          g2d.drawImage(picImage17,130,486, this);
         
       
          ImageIcon myImage28 = new ImageIcon("d:\\machira\\chess7.png");
          Image picImage28 = myImage28.getImage();
          g2d.drawImage(picImage28,230,486, this);
         
          g2d.fillRect(300, 480, 100, 60);
          ImageIcon myImage29 = new ImageIcon("d:\\machira\\chess8.png");
          Image picImage29 = myImage29.getImage();
          g2d.drawImage(picImage29,330,486, this);
         
          ImageIcon myImage25 = new ImageIcon("d:\\machira\\chess6.png");
          Image picImage25 = myImage25.getImage();
          g2d.drawImage(picImage25,830,486, this);
       
          g2d.fillRect(700, 480, 100, 60);
          ImageIcon myImage27 = new ImageIcon("d:\\machira\\chess7.png");
          Image picImage27 = myImage27.getImage();
          g2d.drawImage(picImage27,730,486, this);
         
          ImageIcon myImage30 = new ImageIcon("d:\\machira\\chess8.png");
          Image picImage30 = myImage30.getImage();
          g2d.drawImage(picImage30,630,486, this);
         
          g2d.fillRect(500, 480, 100, 60);
          ImageIcon myImage31 = new ImageIcon("d:\\machira\\chess9.png");
          Image picImage31 = myImage31.getImage();
          g2d.drawImage(picImage31,530,480, this);
         
          ImageIcon myImage32 = new ImageIcon("d:\\machira\\chess10.png");
          Image picImage32 = myImage32.getImage();
          g2d.drawImage(picImage32,430,480, this);
             
             }
         }
    }

Friday, October 8, 2010

program code

import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.awt.event.*;

public class HostelAllocation extends JFrame implements ActionListener{
static String[]gender= {"Male","Famale"};
static String[] yr={"Yearo","Cont","Associate","Finale","Guarantor"};
static String[] hostel={"Mpingwe","Hylid","Nyika","Kapeni","Ndirande"};
static String[] faculty={"Applied","Commerce","Engineering ","Edu & Media St","Built Envirnment"};

static String[]roomNumber= {"2","3","2","3"};

JComboBox myBox = new JComboBox(yr);
JComboBox myBox2 = new JComboBox(hostel);
JComboBox myBox3 = new JComboBox(faculty);
JComboBox myBox4 = new JComboBox(gender);
static JComboBox myBox6 = new JComboBox(gender);








JPanel panel1 = new JPanel();

JTextField textfield1=new JTextField(20);
JTextField textfield2=new JTextField(10);
JTextField textfield3=new JTextField(10);
JTextField textfield4=new JTextField(10);
JTextField textfield5=new JTextField(15);

JPanel mypanel= new JPanel();
JLabel mylabel=new JLabel("WELCOME TO MALAWI POLYTECHNIC HOSTEL BOOKING SYSTEM");

JLabel mylabel2=new JLabel("NAME:");
JLabel mylabel3=new JLabel("REG. #:");
JLabel mylabel4=new JLabel("FACULTY:");
JLabel mylabel5=new JLabel("YEAR:");
JLabel mylabel6=new JLabel("DATE:");
JLabel mylabel7=new JLabel("TIME:");
JLabel mylabel8=new JLabel("HOSTEL:");
JLabel mylabel9=new JLabel("GENDER:");
JLabel mylabel20=new JLabel("ROOM #:");

static JButton button1=new JButton("SAVE");
JButton button2=new JButton("CONFIRM");
JButton button3=new JButton("CLEAR");
static HostelAllocation machira;
public HostelAllocation (){
super("Hostel Allocation System");
setContentPane(mypanel);




ImageIcon forwardIcon= new ImageIcon("D:\\VIN\\POLY.jpg");
JButton button4 = new JButton(forwardIcon);
button4.setToolTipText("POLY");
mypanel.add(button4);

mypanel.add(mylabel);

JScrollPane ss= new JScrollPane(panel1, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
mypanel.setLayout(new GridBagLayout());
mylabel2.setFont(new Font("ALGERIAN",Font.BOLD,22));
mylabel3.setFont(new Font("ALGERIAN",Font.BOLD,22));
mylabel4.setFont(new Font("Algerian",Font.BOLD,22));
mylabel5.setFont(new Font("Algerian",Font.BOLD,22));
mylabel6.setFont(new Font("Algerian",Font.BOLD,22));
mylabel7.setFont(new Font("Algerian",Font.BOLD,22));
mylabel8.setFont(new Font("Algerian",Font.BOLD,22));
mylabel9.setFont(new Font("Algerian",Font.BOLD,22));
mylabel20.setFont(new Font("Algerian",Font.BOLD,22));
textfield1.setFont(new Font("Venderna",Font.BOLD,15));
textfield2.setFont(new Font("Venderna",Font.BOLD,15));
textfield3.setFont(new Font("Venderna",Font.BOLD,15));
textfield4.setFont(new Font("Venderna",Font.BOLD,15));
textfield5.setFont(new Font("Venderna",Font.BOLD,15));





mylabel.setFont(new Font("BROADWAY",Font.BOLD,24));

GridBagLayout mypanel1GridBagLayout=new GridBagLayout();
GridBagConstraints constraints =new GridBagConstraints();

mypanel.setLayout(mypanel1GridBagLayout);
mypanel.setBackground(Color.blue);

addItem(mypanel,button4,0,0,2,1,GridBagConstraints.CENTER);

addItem(mypanel,mylabel,0,1,2,1,GridBagConstraints.WEST);



mylabel.setBackground(Color.RED);

textfield1.setBackground(Color.white);



addItem(mypanel,mylabel2,0,2,1,1,GridBagConstraints.EAST);
addItem(mypanel,textfield1,1,2,1,1,GridBagConstraints.WEST);
textfield1 .setBackground(Color.ORANGE);

addItem(mypanel,textfield3,1,3,1,1,GridBagConstraints.WEST);
textfield3 .setBackground(Color.ORANGE);
addItem(mypanel,mylabel3,0,3,1,1,GridBagConstraints.EAST);
addItem(mypanel,mylabel4,0,4,1,1,GridBagConstraints.EAST);

addItem(mypanel,mylabel5,0,5,1,1,GridBagConstraints.EAST);
addItem(mypanel,mylabel6,0,6,1,1,GridBagConstraints.EAST);
addItem(mypanel,textfield4,1,5,3,3,GridBagConstraints.WEST);
textfield4 .setBackground(Color.ORANGE);

addItem(mypanel,button1,0,10,1,1,GridBagConstraints.EAST);
button1 .setBackground(Color.GREEN);
button1.addMouseListener(new Save());

addItem(mypanel,button3,1,10,1,1,GridBagConstraints.CENTER);
button3.addActionListener(this);


button3 .setBackground(Color.GREEN);
addItem(mypanel,button2,2,10,1,1,GridBagConstraints.WEST);
button2.addActionListener(new ConfirmListener());

button2 .setBackground(Color.GREEN);
addItem(mypanel,myBox,1,5,1,1,GridBagConstraints.WEST);
myBox .setBackground(Color.white);
addItem(mypanel,myBox2,1,7,1,1,GridBagConstraints.WEST);
myBox2 .setBackground(Color.white);

addItem(mypanel,myBox3,1,4,1,1,GridBagConstraints.WEST);
myBox3 .setBackground(Color.YELLOW);
myBox2.addActionListener(new Box2Listener());
addItem(mypanel,mylabel8,0,7,1,1,GridBagConstraints.EAST);
addItem(mypanel,myBox4,1,8,1,1,GridBagConstraints.WEST);
myBox4 .setBackground(Color.YELLOW);
mylabel.setForeground(Color.RED);
mylabel2.setForeground(Color.YELLOW);
mylabel3.setForeground(Color.YELLOW);
mylabel4.setForeground(Color.YELLOW);
mylabel5.setForeground(Color.YELLOW);
mylabel6.setForeground(Color.YELLOW);
mylabel7.setForeground(Color.YELLOW);
mylabel8.setForeground(Color.yellow);

mylabel9.setForeground(Color.YELLOW);
mylabel20.setForeground(Color.YELLOW);













addItem(mypanel,mylabel9,0,8,1,1,GridBagConstraints.EAST);
setSize(750,750);
setLocationRelativeTo(null);
setResizable(true);
setVisible(true);
setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE);

}




public void actionPerformed(ActionEvent evnt){
if(evnt.getSource()==button3){
clear (); }
}

public void clear() {
textfield1.setText("");
textfield3.setText("");
textfield4.setText("");

}



private void addItem(JPanel p, JComponent c, int x,
int y, int width, int height, int align)
{
GridBagConstraints gc = new GridBagConstraints();
gc.gridx = x;
gc.gridy = y;
gc.gridwidth = width;
gc.gridheight = height;
gc.weightx = 100.0;
gc.weighty = 100.0;
gc.insets = new Insets(5, 5, 5, 5);
gc.anchor = align;
gc.fill = GridBagConstraints.NONE;
p.add(c, gc);
}


public class ConfirmListener implements ActionListener{
public void actionPerformed(ActionEvent evt){

JFrame aFrame = new JFrame("Ezra Machira");
JPanel myPanel = new JPanel(new GridBagLayout());



addItem(myPanel, new JLabel("Nationality:"), 0, 6,2, 1,
GridBagConstraints.EAST);


addItem(myPanel, new JLabel("Nationality:"), 0, 7,2, 1,
GridBagConstraints.EAST);


// addItem(mypanel,button4,0,0,2,1,GridBagConstraints.CENTER);

addItem(mypanel,mylabel,0,1,2,1,GridBagConstraints.WEST);



mylabel.setBackground(Color.RED);

textfield1.setBackground(Color.white);



addItem(mypanel,mylabel2,0,2,1,1,GridBagConstraints.EAST);
addItem(mypanel,textfield1,1,2,1,1,GridBagConstraints.WEST);
textfield1 .setBackground(Color.ORANGE);

addItem(mypanel,textfield3,1,3,1,1,GridBagConstraints.WEST);
textfield3 .setBackground(Color.ORANGE);
addItem(mypanel,mylabel3,0,3,1,1,GridBagConstraints.EAST);
addItem(mypanel,mylabel4,0,4,1,1,GridBagConstraints.EAST);

addItem(mypanel,mylabel5,0,5,1,1,GridBagConstraints.EAST);
addItem(mypanel,mylabel6,0,6,1,1,GridBagConstraints.EAST);
addItem(mypanel,textfield4,1,5,3,3,GridBagConstraints.WEST);
textfield4 .setBackground(Color.ORANGE);

addItem(mypanel,button1,0,10,1,1,GridBagConstraints.EAST);
button1 .setBackground(Color.GREEN);
button1.addMouseListener(new Save());

addItem(mypanel,button3,1,10,1,1,GridBagConstraints.CENTER);
button3.addActionListener(this);


button3 .setBackground(Color.GREEN);
addItem(mypanel,button2,2,10,1,1,GridBagConstraints.WEST);
button2.addActionListener(new ConfirmListener());

button2 .setBackground(Color.GREEN);
addItem(mypanel,myBox,1,5,1,1,GridBagConstraints.WEST);
myBox .setBackground(Color.white);
addItem(mypanel,myBox2,1,7,1,1,GridBagConstraints.WEST);
myBox2 .setBackground(Color.white);

addItem(mypanel,myBox3,1,4,1,1,GridBagConstraints.WEST);
myBox3 .setBackground(Color.white);
myBox2.addActionListener(new Box2Listener());
addItem(mypanel,mylabel8,0,7,1,1,GridBagConstraints.EAST);
addItem(mypanel,myBox4,1,8,1,1,GridBagConstraints.WEST);
myBox4 .setBackground(Color.white);
mylabel.setForeground(Color.RED);
mylabel2.setForeground(Color.YELLOW);
mylabel3.setForeground(Color.YELLOW);
mylabel4.setForeground(Color.YELLOW);
mylabel5.setForeground(Color.YELLOW);
mylabel6.setForeground(Color.YELLOW);
mylabel7.setForeground(Color.YELLOW);
mylabel8.setForeground(Color.yellow);

mylabel9.setForeground(Color.YELLOW);
mylabel20.setForeground(Color.YELLOW);









aFrame.setSize(800,500);
aFrame.setContentPane(myPanel);
myPanel.setBackground(Color.orange);
setDefaultCloseOperation(aFrame.EXIT_ON_CLOSE);
aFrame.setVisible(true);

}}








public class Save extends MouseAdapter{
public void mouseClicked(MouseEvent e)

{
JFrame aFrame = new JFrame();
JFileChooser fChooser = new JFileChooser();
int result = fChooser.showSaveDialog(aFrame);
if(result==JFileChooser.APPROVE_OPTION){
File outFile = null;
outFile=fChooser.getSelectedFile();


if (outFile.exists())
JOptionPane.showMessageDialog(null, "File already exists");
else

try{
FileOutputStream fileStream = new FileOutputStream(outFile);
DataOutputStream dataStream = new DataOutputStream(fileStream);
dataStream.writeUTF(textfield1.getText());
dataStream.writeUTF(textfield2.getText());
dataStream.writeUTF(textfield3.getText());
dataStream.writeUTF(textfield4.getText());
dataStream.writeUTF(textfield5.getText());
dataStream.writeInt(myBox.getSelectedIndex());
dataStream.writeInt(myBox2.getSelectedIndex());
dataStream.writeInt(myBox3.getSelectedIndex());
dataStream.writeInt(myBox4.getSelectedIndex());




JLabel mylabel=new JLabel("WELCOME TO MALAWI POLYTECHNIC HOSTEL BOOKING SYSTEM");
JLabel mylabel2=new JLabel("NAME:");
JLabel mylabel3=new JLabel("REG. #:");
JLabel mylabel4=new JLabel("FACULTY:");
JLabel mylabel5=new JLabel("YEAR:");
JLabel mylabel6=new JLabel("DATE:");
JLabel mylabel7=new JLabel("TIME:");
JLabel mylabel8=new JLabel("HOSTEL:");
JLabel mylabel9=new JLabel("GENDER:");
JLabel mylabel20=new JLabel("ROOM #:");




}
catch(IOException event){
JOptionPane.showMessageDialog(null, "Save with file name");

}
}
}
}
public class Box2Listener implements ActionListener{
public void actionPerformed(ActionEvent event){
String hostel = (String)myBox2.getSelectedItem();

String[]kapeni= {"22","5","56"};
String[]mpingwe= {"22","75","78"};

if(hostel.equals("Nyika")){
Nyika();

}
else if(hostel.equals("Mpingwe")){
mypanel.remove(myBox6);
String[]nyika= {"22","75","78", "22","75","78", "22","75","78", "22","75","78", "22","75","78", };
myBox6 = new JComboBox(nyika);

addItem(mypanel,mylabel20,0,9,1,1,GridBagConstraints.EAST);
addItem(mypanel,myBox6,1,9,1,1,GridBagConstraints.WEST);
machira.pack();
}
else if(hostel.equals("Kapeni")){
Kapeni();
}
else if(hostel.equals("Ndirande")){
Ndirande();

}
else if(hostel.equals("Hylid")){
mypanel.remove(myBox6);
Hylid();
machira.pack();
}



}
}
public void Nyika(){
mypanel.remove(myBox6);
String[]nyika= {"242","45","56"};
myBox6 = new JComboBox(nyika);

addItem(mypanel,mylabel20,0,9,1,1,GridBagConstraints.EAST);
addItem(mypanel,myBox6,1,9,1,1,GridBagConstraints.WEST);
machira.pack();
}

public void Ndirande(){
mypanel.remove(myBox6);
String[]ndirande= {"22","75","78", "22","75","78", "22","75","78", "22","75","78", "22","75","78", };
myBox6 = new JComboBox(ndirande);

addItem(mypanel,mylabel20,0,9,1,1,GridBagConstraints.EAST);
addItem(mypanel,myBox6,1,9,1,1,GridBagConstraints.WEST);
machira.pack();
}


public void Kapeni() {
mypanel.remove(myBox6);
String[]kapen= {"22","75","78", "22","75","78", "22","75","78", "22","75","78", "22","75","78", };
myBox6 = new JComboBox(kapen);
//JScrollPane scroll = new JScrollPane(myBox);
addItem(mypanel,mylabel20,0,9,1,1,GridBagConstraints.EAST);
addItem(mypanel,myBox6,1,9,1,1,GridBagConstraints.WEST);
machira.pack();
}
public void Hylid(){
mypanel.remove(myBox6);
String[]nyika= {"G1","G2","78", "22","75","78", "22","75","78", "22","75","78", "22","75","78", };
myBox6 = new JComboBox(nyika);
//JScrollPane scroll = new JScrollPane(myBox);
addItem(mypanel,mylabel20,0,9,1,1,GridBagConstraints.EAST);
addItem(mypanel,myBox6,1,9,1,1,GridBagConstraints.WEST);
machira.pack();
}

public static void main (String [] args){
machira=new HostelAllocation();
machira.pack();
}
}

HOSTEL BOOKING SYSTEM
Introduction
In the past, people were using stones for their day to day activities and the period was called the Stone Age.  Later, the stones were replaced by iron and the period was called the Iron Age. Currently, we are in the computer age or the world of computers where computers are used for day to day activities. Computers are used by wide range of different organizations for instance, education institutions. In college, computers are used for various activities. Therefore, the aim of this mini- project is to develop an interface of a hostel booking system. The programmer has used the hostel booking system at the Malawi Polytechnic as a referencing point. Snapshots have been used to explain the project.
Problem statement
Higher learning institutions are expected to be more advanced in terms of technology more especially at the institution like The Malawi Polytechnic which trains engineers, computer programmers, network managers and database managers. Since 1965 up to now, The Malawi Polytechnic is still using manual system of allocating students in different hostels. Therefore, the project has designed an interface for hostel booking system.
Significance of the project
If this project can be implemented it will reduce time which students spend on a long queue waiting to book their desired rooms. In addition, the system will simplify the work of the hostel’s director since the students will book the rooms through on-line.  




HOSTEL BOOKING SYSTEM INTERFACE- EZRA MACHIRA

HOSTEL BOOKING SYSTEM
Introduction
In the past, people were using stones for their day to day activities and the period was called the Stone Age.  Later, the stones were replaced by iron and the period was called the Iron Age. Currently, we are in the computer age or the world of computers where computers are used for day to day activities. Computers are used by wide range of different organizations for instance, education institutions. In college, computers are used for various activities. Therefore, the aim of this mini- project is to develop an interface of a hostel booking system. The programmer has used the hostel booking system at the Malawi Polytechnic as a referencing point. Snapshots have been used to explain the project.
Problem statement
Higher learning institutions are expected to be more advanced in terms of technology more especially at the institution like The Malawi Polytechnic which trains engineers, computer programmers, network managers and database managers. Since 1965 up to now, The Malawi Polytechnic is still using manual system of allocating students in different hostels. Therefore, the project has designed an interface for hostel booking system.
Significance of the project
If this project can be implemented it will reduce time which students spend on a long queue waiting to book their desired rooms. In addition, the system will simplify the work of the hostel’s director since the students will book the rooms through on-line.  


SNAPSHOTS 


Figure 1
Figure 1 above shows how the inference of the project will look like. There are different components on this interface and each component is meaningful. The programmer has used blue color for the background because The Malawi Polytechnic uses blue color for its identification. The picture on the interface shows the uniqueness of the system that is to say the system is for The Malawi Polytechnic. Students will be required to enter their details like name, registration number, faculty, year, date, hostel and gender in the blank spaces. The details above are very important because it gives all the details of the student.

Figure 2
Figure 2 shows how the interface looks like after a student fills in his or her details. Instead of typing faculty, year, hostel and gender, the student will choose from the option given. The programmer has put the option deliberately because those components do not change unlike name, date and registration number. The snapshots below show how the students will choose on the faculty, year hostel and gender.



Figure 3
When the student clicks at faculty, the interface will give him or her options of all faculties to choose his or her faculty.  On the option, there are five faculties and these are applied sciences, commerce, engineering, education and media studies and built environment.
Figure 4 below shows the options that the student has when he or she clicks no the year. It gives the following options: finale (final year), yearo (year 1), cont (year 2), associate (year 3) and guarantor (year 5)
Figure 4

Figure 5 below shows what happens when the student chooses the hostel. The room number will appear giving chance to the student to book the room of his or her interest.
Figure 5

Similarly, when gender will be clicked it will give only two options male or female. At this point it means that the student has entered all the necessary details about himself or herself.  If it happens that the student made a mistake he or she has the opportunity to delete or clear the data entered in gaps (textfield) by using clear button. Figure 6 shows how the interface will look like when the student clicks clear button.
Figure 6
When the student is sure that he or she has entered the right details, he or she can now save data entered by placing save button. All students’ details will be saved in one folder to avoid data getting lost. Table 7 shows what the interface will look like when save button will be clicked. If the name used in saving matches with the name that is already in the computer then message will come out showing that the data already exit. In that case, the student is supposed to save with another name. Figure 8 shows the massage that comes out when the name used to save data already exit.

  figure 7 
                                                                                                          


Figure 8



Figure 9
Figure 9 shows the data that will be stored for the student after he or she saved the data. The data that is appearing is only from the gaps which require the student to enter (textfield) not to choose from the options (combox). This is the weakness of the interface because details from the combox are failing to be solved.

CONCLUSION
The project discussed the hotel booking system interface. It included all the necessary details for the student. If this can be implemented, problems like spending hour on the long queue will be history. Therefore, there is a need for The Malawi polytechnic to adopt a new means of allocating students in the hostels.