Sei sulla pagina 1di 65

A REPORT ON:

STUDENT INDUSTRIAL WORK EXPERIENCE SCHEME (SIWES)

BY

MAMUDU, FRANCIS I.

(UG14/SCCS/1008)

CONDUCTEDAT

KHEMSAFE INSTITUTE OF TECHNOLOGY, KADUNA, KADUNA STATE

A REPORT SUBMITTED TO THE DEPARTMENT OF MATHEMATICS/

FACULTY OF SCIENCES, GOMBE STATE UNIVERSITY IN PARTIAL

FULFILLMENT OF THE REQUIRMENT OF THE COMPLETION OF

INDUSTRIAL TRAINING.

NOVEMBER, 2017
DECLARATION

I hereby declared that this work is the product of my training effort, undertaken

under the supervision of Mal. Lamido Yahaya and has not been presented and will

not be presented elsewhere for the fulfilment of any Industrial Training

requirement.

_______________ _______________

Name of student Signature Date

I|Page
CERTIFICATION

This is to certify that the report was carried out under my/our supervision

_______________________

Mal. Lamido Yahaya Date

(Departmental Based Supervisor)

II | P a g e
DEDICATION

This industrial work experience scheme (SIWES) is dedicated to my beloved

parents, Mr. Mamudu Friday and Mrs. Grace Mamudu.

III | P a g e
ACKNOWLEDGEMENT
My appreciation first goes to God almighty, the creator of Heaven and

Earth for granting me the grace and privilege to be able to complete this

SIWES program successfully and on schedule.

And also to the Director of SIWES (Gombe State University) for given us

this platform to explore and acquire relevant practical knowledge.

I am also grateful to my industrial based supervisors Mr. Idowu Kenny

and my tutors for their thorough supervision and useful advice which helped

and also contributed to the success of the SIWES program.

My special regards goes to the coordinator of SIWES, Mathematics

Department Mal. Muhammad Ahmad kabir for his advice and encouragement.

Also my regards goes to my Departmental Based supervisor Mal.

Lamido Yahaya for his advice and help in fulfillment of my SIWES report.

And finally, I want to thank my parents Mr. Mamudu Friday and Mrs.

Mamudu Grace for their financial support and love. Thanks and GOD bless

you all.

IV | P a g e
TABLE OF CONTENTS

DECLARATION ................................................................................................................................................. I
CERTIFICATION .............................................................................................................................................. II
DEDICATION ................................................................................................................................................... III
CHAPTER ONE ................................................................................................................................................ 1
1.0 INTRODUCTION TO SIWES .......................................................................................................... 1
1.1 AIM AND OBJECTIVES OF SIWES ............................................................................................. 2
1.2 HISTORY OF THE ORGANISATION (KHEMSAFE TECHNOLOGY) ..................................... 3
1.3.0 ORGANISATIONAL CHART OF KHEMSAFE TECHNOLOGY ................................................. 4
Brief description here .............................................................................. Error! Bookmark not defined.
CHAPTER TWO ................................................................................................................................................ 9
WORK EXPERIENCE .................................................................................................................................. 9
2.1. Java Programming .............................................................................................................................. 9
Philosophy .............................................................................................................................................. 10
Basic syntax of java ............................................................................................................................. 12
 Exception Handling ...................................................................................................................... 20
 Static polymorphism(Method Overloading) ........................................................................... 22
 GUI Design(Swing)........................................................................................................................ 26
 JDBC(Java database connectivity) .......................................................................................... 27
 Concept of JInternalFrame in java GUI builder(Swing) ...................................................... 30
Table 2: Java JInternalFrame. ............................................................................................................. 37
2.2. Introduction to graphics design .................................................................................................... 37
2.3 Ms Access ............................................................................................................................................ 38
2.4 Ms PowerPoint .................................................................................................................................... 39
CHAPER THREE ............................................................................................................................................ 40
APPLICATION OF KNOWLEDGE ACQUIRED .................................................................................... 40
3.1.1 Graphic Design ............................................................................................................................ 40
3.1.2 Java Programming...................................................................................................................... 41
CHAPTER FOUR ............................................................................................................................................ 49
4.1 Summary............................................................................................................................................... 49
4.3 Conclusion ........................................................................................................................................... 49
4.4 Recommendations ............................................................................................................................. 49
REFERENCES ................................................................................................................................................ 51
APPENDICES.................................................................................................................................................. 53
Program source code for supermarket billing system ................................................................... 53

V|Page
LIST OF TABLES

Table 1: java wrapper classes 16

Table 2: java JInternalFrame 25

VI | P a g e
LIST OF FIGURES

Figure 1: Organizational Chart 3

Figure 2: Java programming workflow 8

Figure 3: 2017 calendar 32

Figure 4: Supermarket billing system welcome window 33

Figure 5: Admin login window 33

Figure 6: Change admin 34

Figure 7: Loading 35

Figure 8: Admin main window 36

Figure 9: Admin signup new cashier and update

existing record 36

Figure 10: Adding stock to inventory 37

Figure 11: Cashier main window 37

Figure 12: Record of all bills created 39

VII | P a g e
GLOSSARY

 Class: - A class can be defined as a template/blue print that describes the

behaviors/states that object of its type support.

 Object: - Objects have states and behaviors. Example: A dog has states-color,

name, and breed as well as behaviors -wagging, barking, and eating. An object is

an instance of a class.

 Methods: - A method is basically a behavior. A class can contain many methods.

It is in methods where the logics are written, data is manipulated and all the

actions are executed.

VIII | P a g e
ABBREVIATIONS

API Application programming interface

CSS Cascading style sheet

PHP Hypertext pre-processor

DBMS Database management system

JDBC Java database connectivity

JDK Java development kit

IDE Integrated development environment

JSP Java server pages

DCL Data control language

DDL Data definition language

DML Data manipulation language

IX | P a g e
CHAPTER ONE

INTRODUCTION
1.0 INTRODUCTION TO SIWES

Acquisition of practical skill is an antidote to meaningful development in any

given society. Ochiagha (1995) also posits that practical knowledge is learning

without which mastery of an area of knowledge may be too difficult to achieve and

that practical knowledge involves developing skills through the use of tools or

equipment to perform tasks that are related to a field of study.

The Student Industrial Work Experience Scheme otherwise known as

SIWES is a practical oriented scheme designed to offer participant the opportunity

of familiarizing themselves to the needed practical skills, knowledge and

experience of their respective field of studies and to get acquainted with life

outside the classroom before he/she graduates.

The Student Industrial Work Experience Scheme (SIWES) was founded in the

year 1973 under the Federal Government of Nigeria with its headquarters in Jos,

Plateau State and thereby making it mandatory for all ministries, companies and

parastatals to offer places for the participant for the minimum period of three (3)

months and a maximum of six (6) months in accordance with the provision of the

decree no. 47 of 1979, which was further amended 1980. The federal government

of Nigeria introduced the SIWES Scheme in tertiary institutions in 1974 to ensure

acquisition of field practical knowledge and skills by students before graduation.

The scheme exposes students to industrial based skills that are necessary for

1|Page
smooth transition from the classroom to the world of work and it gives the students

opportunity to be part of real work situation outside the lecture room.

The government’s decree No. 47 of 8th Oct; 1971 as amended in 1990,

highlighted the capacity building of human resources in industry, commerce and

government through training and retraining of workers in order to effectively

provide the much needed high quality goods and services in a dynamic economy

as ours (Jemerigbo, 2003). This decree led to the establishment of Industrial

Training Fund (ITF) in 1973/1974. The growing concern among our industrialists

that graduates of our institutions of Higher learning, lack adequate practical

background studies preparatory for employment in industries, led to the formation

of students Industrial Work Experience Scheme (SIWES) by ITF in

1993/1994(Information and Guideline for SIWES, 2002). ITF has as one of its key

functions; to work as cooperative entity with industry and commerce where

students in institutions of higher learning can undertake mid-career work

experience attachment in industries which are compatible with student’s area of

study (Okorie2002, inAsikadi 2003).

1.1 AIM AND OBJECTIVES OF SIWES

SIWES programme is aimed at exposing students to professional work

methods, equipment, machines, tools, and the necessary perception to safety

measures needed for safeguarding the work area and the workers in the industry.

The objectives of SIWES are:


2|Page
1. It is a skill training program designed to expose and prepare students of tertiary

Institutions for the industrial work situation they are likely to meet after graduation.

2. Providing an avenue for student in Nigerian University to acquire industrial skill

experience in their area of study

3. Providing student an opportunity to apply theoretical knowledge in a real situation

thereby bridging between the University work and the actual practice.

4. Exposing student to the right and proper attitude and the disciplinary measures to

work.

1.2 HISTORY OF THE ORGANISATION (KHEMSAFE INSTITUTE OF

TECHNOLOGY)

Khemsafe computers and communications LTD is an indigenous Nigerian

Company, with an office complex building (Khemsafe House), situated at No. 6A

& 7A Constitution Road Kaduna as its headquarter with branches in Lagos,Gusau,

Enugu, Port Harcourt, Abuja, Makurdi and Sokoto. The company was

incorporated in 1992 and is affiliated to Meridian Computers Inc. New Jersey

USA. It was born out of the desire to create a Nigerian company that can always

be depended upon for reliable and high quality services in the areas of information

communication technology. Khemsafe has a network of domestic and foreign

suppliers of original computer equipment and accessories. The computer institute

offers computer certificate course on computer appreciation, word processing,

desktop publishing graphics, spreadsheet, database management system

(DBMS) and computer aided design, web design, and programming.

3|Page
1.3.0 ORGANISATIONAL CHART

Khemsafe computer institute Kaduna has Dr. Dave Obiora as the managing

director and it operates in a hierarchical manner i.e. from director down to the

cleaners as shown below:

Board of Directors

MD/CEO Corporat
e Affairs

GM business Company GM Admin


development Secretary & Accts

Asst. Gen. Asst. Gen. Manager


Manager Admin & Accts

(Business
Dev.)

Marketing Training Store Account Admin

Engineering Sales Cyberc Estate Unit


&branc afé
hes
Debt
Recovery
Hardware Software
Security Office
Asst.

Cleaners

Figure 1: organization chart.

4|Page
1.2.1 Objectives of the organisation:

 To assist individual, private and public organization to identify the need for the

computerization of their operations.

 To training staff of private and public organizations in the use of computer for their

routine operations.

 To improve the knowledge of computer users through additional training in

software operations, advance graphics and software engineering.

 To ensure smooth transition from manual operations to automated operations.

Short term executive training on application packages e.g. Ms Excel, Dbase, Word

Perfect, and Ms Word among others.

Khemsafe and Computer Communication Limited have various departments or

units charged with the responsibilities of providing a smooth running of the

organisation. These units include:

1. Selling Unit: this unit deals purchase and selling of computer accessories like

desktop, laptop, cameras, computer software, hardware, game devices,

networking equipment’s etc.

2. Maintenance and Repair Unit: this department is responsible for the repair and

maintenance of the damaged system. It involves the trouble shooting of the

system to solve the particular problem.

3. Training Unit: As we know one of the objectives of this organisation is to educate

the community on the use and need of computer in their day to day operation. In

5|Page
this manner, the training department is responsible for providing this knowledge.

In line with the above objectives our training programme is divided into the

following areas:

I. DIPLOMA COURSE: The course is designed for both graduates and non-

graduates with little or no knowledge of computer. The programme can be Full

time morning, Full- time afternoon and part-time evening. And the course duration

is between six (6) to eleven (11) months.

II. COMPUTER ENGINEERING/MAINTENANCE: This course is designed for those

who want to specialize in computer maintenance and repairs. Such as Computer

assembling, Installation, Repairs, Troubleshooting etc. which can be between 3 to

6 months and certificate of attendance will be issued to the end of the course.

III. CERITFICATE COURSE: This course is designed for those who want to

specialize in a particular area or areas in the use of computer such as computer

appreciation, Word processing, Desktop publishing graphics, Spread sheet,

Database management system (DBMS), Computer aided design etc. which can

last for 3 to 6 months.

IV. EXECUTIVE COURSE: The course is designed for Managers, Board Chairman,

Executive Directors and professionals who cannot afford the time for a full-blown

computer course, but wish to latch into the computer train. The trainee has the

opportunity of deciding on where to have the course; either in his/her office or in

our training canters. The courses available include:

 Computer appreciation
6|Page
 Word processing

 Spread sheet accounting

 Database management system (DBMS)

 Presentation graphics.

 Project management with Micro computers

 Computer applications in management.

Course duration: As arranged by interested person.

V. PROFESSIONAL COURSES: This is design for those who want to computing full,

courses available include:

 Microsoft certified Courses

 System Administration Course (UNIX)

 Database Administration Course (ORACLE)

 Website Design using (JavaScript, php,css, html, and Django)

 Networking(CISCO)

 Programming(C#, Java, VB.net, VB 6.0, and Python)

 Computer graphic design(Corel draw, MAYA and Photoshop)

FACILITIES: The company has well-trained experience staff, as well as seasoned

professionals in different fields who are experienced users of different application

programs.The company also has fully air-conditioned and equipped training rooms

to ensure the best training environment for student/participants. There are enough

7|Page
computers to guarantee a computer to each student/participants throughout the

duration of the course.

In conclusion, Khemsafe offers a broad range of computer management,

Networking and Consultant services to individuals, government and Non-

governmental organizations within and outside the state.

8|Page
CHAPTER TWO

WORK EXPERIENCE

My experiences at khemsafe during the period of my SIWES attachment

include but not limited to:

1. Java Programming

2. Introduction to Graphics design

3. Ms Access

4. Ms PowerPoint

2.1. Java Programming

Programming means to create or develop software, which is also called

program.Java is an object-oriented programming language developed by James

Gosling and colleagues at Sun Microsystems in the early 1990s. Unlike

conventional languages which are generally designed either to be compiled to

native (machine) code, or to be interpreted from source code at runtime, Java is

intended to be compiled to a bytecode, which is then run (generally using JIT

compilation) by a Java Virtual Machine. The language itself borrows much syntax

from C and C++ but has a simpler object model and fewer low-level facilities. The

stages of program compilation is shown below;

9|Page
Figure 2: java programming language workflow.

Philosophy

There were five primary goals in the creation of the Java language:

1. It should use the object-oriented programming methodology.

2. It should allow the same program to be executed on multiple operating

systems.

3. It should contain built-in support for using computer networks.

4. It should be designed to execute code from remote sources securely.

5. It should be easy to use by selecting what was considered the good parts of

other object-oriented languages.

Tools required for application development in java

 MAC OS or Linux or Windows operating system.

 Java JDK

 Microsoft Notepad or any other text editor

 Integrated development environment (IDE) such as Netbeans, eclipse, Jcreator,

JBuilder, intellijjetbrain etc. (optional)


10 | P a g e
Advantages of using IDE (Netbeans)

 It has an easy to use Swing GUI design tool to build user interfaces through

dragging and dropping components, such as Buttons and Textboxes.

 It auto completed code and gives programmers a list of possible code fragments

to choose from, even as they type.

 It debugs and gives hints on optimizing code, and even inserts the right code.

 It has version control, and many other advanced tools.

Disadvantages of using IDE (Netbeans)

 NetBeans IDE is a little bit slow to load.

 Takes up more memory than lighter IDEs.

 Advanced tools and features require some training.

As an object oriented programming Language, Java program can be seen as a

collection of objects that communicate via invoking each other’s methods. We

can’t talk about java without talking about objects, class, and methods.

 Class: - A class can be defined as a template/blue print that describes the

behaviors/states that object of its type support.

 Object: - Objects have states and behaviors. Example: A dog has states-color,

name, and breed as well as behaviors -wagging, barking, and eating. An object is

an instance of a class.
11 | P a g e
 Methods: - A method is basically a behavior. A class can contain many methods.

It is in methods where the logics are written, data is manipulated and all the

actions are executed.

Basic syntax of java

 Case Sensitivity: - Java is case sensitive, which means identifier Hello and hello

would have different meaning in Java.

 Class Names: - For all class names, the first letter should be in Upper Case. If

several words are used to form a name of the class, each inner word's first letter

should be in Upper Case. Example class MyFirstJavaClass.This type of naming

convention is known as kermel casing.

 Method Names: - All method names should start with a Lower Case letter. If

several words are used to form the name of the method, then each inner word's

first letter should be in Upper Case. Example public void myMethodName().

 Program File Name: - Name of the program file should exactly match the class

name. When saving the file, you should save it using the class name (Remember

Java is case sensitive) and append '.java' to the end of the name (if the file name

and the class name do not match your program will not compile). Example :

Assume 'MyFirstJavaProgram' is the class name, then the file should be saved

as'MyFirstJavaProgram.java'

 public static void main(String args []): - Java program processing starts from

the main() method, which is a mandatory part of every Java program.

Types of variables
12 | P a g e
Local variables: Local variables are declared in methods, constructors, or blocks.

Local variables are created when the method, constructor or block is entered and

the variable will be destroyed once it exits the method, constructor or block.

Instance Variables: Instance variables are declared in a class, but outside a

method, constructor or any block. Instance variables are created when an object

is created with the use of the keyword 'new' and destroyed when the object is

destroyed

Class/Static Variables: Class variables also known as static variables are

declared with the static keyword in a class, but outside a method, constructor or a

block. There would only be one copy of each class variable per class, regardless

of how many objects are created from it.

Types of Modifiers

 Access Modifiers

 Non-Access Modifiers

- Access Modifiers: Java provides a number of access modifiers to set access

levels for classes, variables, methods and constructors. The four access levels

are:

1. Visible to the package, the default. No modifiers are needed.

2. Visible to the class only (private).

3. Visible to the world (public).

4. Visible to the package and all subclasses (protected).

13 | P a g e
- Non-Access Modifiers: Java provides a number of non-access modifiers to

achieve many other functionality.

1. The static modifier for creating class methods and variables.

2. The final modifier for finalizing the implementations of classes, methods, and

variables.

3. The abstract modifier for creating abstract classes and methods.

4. The synchronized and volatile modifiers, which are used for threads.

Basic Operators

i. Arithmetic Operators (+, -, *, /, % ,++, -- )

ii. Relational Operators (==, !=, <=, >= , <, >)

iii. Bitwise Operators (&, ~, ^, |, >>, <<,>>>)

iv. Logical Operators (&&, ||, !)

v. Assignment Operators (=, +=, -=,*=, /=, &=, %=, <<=, >>=, |=, ^=)

vi. Misc Operators

Loop Controls

i. While loop: A while loop is a control structure that allows you to repeat a task a

certain number of times. Syntax

while(Boolean_expression)

//Statements

14 | P a g e
When executing, if the boolean_expression result is true, then the actions inside

the loop will be executed. This will continue as long as the expression result is

true. Here, key point of the while loop is that the loop might not ever run. When

the expression is tested and the result is false, the loop body will be skipped and

the first statement after the while loop will be executed.

ii. do...while loop: A do...while loop is similar to a while loop, except that a

do...while loop is guaranteed to execute at least one time. Syntax

do {

//Statements

}while(Boolean_expression);

Notice that the Boolean expression appears at the end of the loop, so the

statements in the loop execute once before the Boolean is tested.

If the Boolean expression is true, the flow of control jumps back up to do, and the

statements in the loop execute again. This process repeats until the Boolean

expression is false.

iii. for loop: A for loop is a repetition control structure that allows you to efficiently

write a loop that needs to execute a specific number of times. A for loop is useful

when you know how many times a task is to be repeated. Syntax

for(initialization;Boolean_expression; update) {

//Statements

15 | P a g e
Enhanced for loop in Java: Syntax

for(declaration : expression) {

//Statements

• Declaration: The newly declared block variable, which is of a type compatible

with the elements of the array you are accessing. The variable will be available

within the for block and its value would be the same as the current array element.

• Expression: This evaluates to the array you need to loop through. The

expression can be an array variable or method call that returns an array.

Decision Making

– if statements: An if statement consists of a Boolean expression followed by one

or more statements. Syntax

if(Boolean_expression) {

//Statements will execute if the Boolean expression is true

If the Boolean expression evaluates to true, then the block of code inside the if

statement will be executed. If not, the first set of code after the end of the if

statement(after the closing curly brace) will be executed.

– If…else statements: An if statement can be followed by an optional else

statement, which executes when the Boolean expression is false. Syntax

if(Boolean_expression){
16 | P a g e
//Executes when the Boolean expression is true

}else{

//Executes when the Boolean expression is false

– If…else if…else statements:An if statement can be followed by an optional else

if...else statement, which is very useful to test various conditions using single

if...else if statement. When using if, else if, else statements there are few points to

keep in mind.

• An if can have zero or one else's and it must come after any else if's.

• An if can have zero to many else if's and they must come before the else.

• Once an else if succeeds, none of the remaining else if's or else's will be

tested.

Syntax

if(Boolean_expression1){

//Executes when the Boolean expression 1 is true

}elseif(Boolean_expression2){

//Executes when the Boolean expression 2 is true

}elseif(Boolean_expression3){

//Executes when the Boolean expression 3 is true

}else{

//Executes when the none of the above condition is true.


17 | P a g e
}

– Nested if...else Statement: It is always legal to nest if-else statements which

means you can use one if or else if statement inside another if or else if

statement. Syntax

if(Boolean_expression1){

//Executes when the Boolean expression 1 is true

if(Boolean_expression2){

//Executes when the Boolean expression 2 is true

– Switch Statement: A switch statement allows a variable to be tested for equality

against a list of values. Each value is called a case, and the variable being

switched on is checked for each case. Syntax

switch(expression){

case value :

//Statements

break;

case value :

//Statements

break; //You can have any number of case statements.

default://Optional

//Statements
18 | P a g e
}

The following rules apply to a switch statement:

 The variable used in a switch statement can only be a byte, short, int, or char.

 You can have any number of case statements within a switch. Each case is

followed by the value to be compared to and a colon.

 The value for a case must be the same data type as the variable in the switch and

it must be a constant or a literal.

 When the variable being switched on is equal to a case, the statements following

that case will execute until a break statement is reached.

 When a break statement is reached, the switch terminates, and the flow of control

jumps to the next line following the switch statement.

 Not every case needs to contain a break. If no break appears, the flow of control

will fall throughto subsequent cases until a break is reached.

A switch statement can have an optional default case, which must appear at the

end of the switch. The default case can be used for performing a task when none

of the cases is true. No break is needed in the default case.

 Java Array

Array is a data Structure of homogeneous or the same data type.

Declaration of an array

Syntax

datatype[ ] array_name= datatype[size of array];


19 | P a g e
Initializing an array

array_name[row_number]=value;

datatype[ ] array_name={ value 0, value1, value 2,…..};

 Java Wrapper Classes

Primitive Data Wrapper Class

Byte Byte

Int Integer

Double Double

Float Float

Boolean Boolean

Char Character

Long Long

Table 1: java wrapper classes.

 Exception Handling

An exception is a condition that may arise during the execution of a Java

program when a normal path of execution is not defined. For example, a Java

20 | P a g e
program may encounter a numeric expression that attempts to divide an integer

by zero. Such a condition may occur during the execution of the program and

thereby result into an exception or error. Therefore, Exception handling simply

means catching an exception and the code that handles the exception is known

as an exception handler.

 Ways of handling exception

i. Using try-catch block: A try/catch block is placed around the code that might

generate an exception. the syntax for using try/catch looks like the following:

try {

//codes that will generate an exception

}catch(ExceptionName e1) {

//catch block

A catch statement involves declaring the type of exception you are trying to catch.

ii. finallyblock:The finally keyword is used to create a block of code that follows a

try block. A finally block of code always executes, whether or not an exception has

occurred. It is with try-catch block. Syntax:

try {

//code

}catch(ExceptionType1 e1) {

//Catch block

}catch(ExceptionType2 e2) {

//Catch block
21 | P a g e
}catch(ExceptionType3 e3) {

//Catch block

}finally {

//The finally block always executes.

 Static polymorphism(Method Overloading)

Method Overloading:isa feature that allows a class to have two or more

methods having same name, but their argument lists are different. Argument list

could differ;

i. Number of parameters

ii. Data type of the parameters

iii. Sequence of data type of parameters

Method Overloading happens at compile time(early binding).

Example of Overloaded Methods:

classDisplayOverloading{

public void disp(char c){

Public void disp(char c, intnum){

22 | P a g e
From the example above, the two methods have same name but there are

different number of parameters in the two methods.

 Inheritance

Inheritance is one of the cornerstones of object-orientedprogramming.It lets you

create a new class by reusing code from an existing class. The new class is called

a subclass and the existing class is called the superclass. A superclass contains

the code that is reused and customized by thesubclass. It is saidthat the subclass

inherits from the superclass. A superclass is also known as a base class or a

parent class. A subclass is also known as a derived class or a child class.

Technically, it may be possible to inherit a class from any existing class. However,

practically it is not always a good idea to inherit a new class from any existing

class. Inheritance in software development works much the same way as

inheritance in normal human life. You inherit something from your parents; your

parents inherit something from their parents, and so on. . You need to use the

keyword extends followed by the superclass name in the class declaration of your

subclass. The general syntax is;

<<class_modifiers>>class<<Subclass_Name>>extends <<Superclass_Name>>

// Code for the Subclass goes here

 Interface

23 | P a g e
Interface looks likes class but it is not a class. An Interface can have

methods and variables just like the class but the methods declared in interface are

by default abstract(only method signature, no body). Also, the variables declared

in an interface are public, final, and static by default.

Interfaces are used for abstraction. Since methods in interface do not have

body, they have to implemented by the class before you can access them. The

class that implements interface must implement all its methods. Also, java

programming language does not support multiple inheritance, using interfaces we

can achieve this as a class can implement more than one interfaces. However, it

cannot extends more than one classes.

Declaration of an interface

Interface are declared by specifying a keyword “interface”. For Instance;

Interface MyInterface{

//all the methods are are public abstract by default

//note down that these methods are not having body

public void method1();

public void method2();

Interface Implementation

24 | P a g e
This is how a class implements an interface. It has to provide the body of

all the methods that are declared in interface.

Note: class implements interface but an interface extends another interface.

For instance;

Interface MyInterface{

public void method1();

public void method2();

Class XYZ implements MyInterface{

public void method1(){

System.out.println(“implementation of method1”);

public void method2(){

System.out.println(“implementation of method2”);

public static void main(String[] args){

MyInterfaceobj=new XYZ();

obj.method1();

25 | P a g e
obj.method2();

Benefit of having interfaces

i. Without bothering about the implementation part we can achieve the security of

implementation.

ii. In java, multiple inheritance is not allowed, however by using interface you can

achieve the same.

 GUI Design(Swing)

Swing provides graphical user interface (GUI) components to develop Java

applications with a rich set of graphics such as windows, buttons, checkboxes,

etc. What is a GUI? Before I define a GUI, let me first define a user interface (UI).

A program does three things:

a. Accepts inputs from the user

b. Processes the inputs, and

c. Produces outputs

A user interface provides a means to exchange information between a user

and a program, in terms of inputs and outputs. In other words, a user interface

defines the way the interaction between the user and a program takes place.

Typing text using a keyboard, selecting a menu item using a mouse, or clicking a
26 | P a g e
button can provide input to a program. The output from a program can be

displayed on a computer monitor in the form of character-based text, a graph such

as a bar chart, a picture, etc. A GUI lets users interact with a program using

graphical elements called controls or widgets, using a keyboard, a mouse, and

other devices.

SwingComponents:JFrame,JPanel,JLabel,JMenu,JCheckBox,JRadioButto

n,JSeperator,JProgressBar,JDatePicker,JCalender, etc. We used this UI

components to design GUI for some simply application we develop and also

perform some Event handling such as ActionEvent,MouseEvent etc.

 JDBC(Java database connectivity)

JDBC stands for Java Database Connectivity, which is a standard Java

API for database-independent connectivity between the Java programming

language, and a wide range of databases. The JDBC library includes APIs for

each of the tasks mentioned below that are commonly associated with database

usage.

i. Making a connection to a database.

ii. Creating SQL or MySQL statements.

iii. Executing SQL or MySQL queries in the database.

iv. Viewing & Modifying the resulting records.

27 | P a g e
JDBC provides a complete set of interfaces that allows access to an underlying

database. Java can be used to write different types of executable, such as:

i. Java Applications

ii. Java Applets

iii. Java ServerPages (JSPs) etc.

All of these different executable are able to use a JDBC driver to access a

database, and take advantage of the stored data. JDBC provides the same

capabilities as ODBC, allowing Java programs to contain database-independent

code.

Prerequisite

i. Core java programming

ii. SQL or MySql Database

The JDBC API supports both two-tier and three-tier processing models for

database access but in general, JDBC Architecture consists of two layers:

i. JDBC API: This provides the application-to-JDBC Manager connection.

ii. JDBC Driver API: This supports the JDBC Manager-to-Driver Connection.

Common JDBC Components

i. DriverManager: This class manages a list of database drivers. Matches

connection requests from the java application with the proper database driver

28 | P a g e
using communication subprotocol. The first driver that recognizes a certain

subprotocol under JDBC will be used to establish a database Connection.

ii. Driver: This interface handles the communications with the database server. You

will interact directly with Driver objects very rarely. Instead, you use

DriverManager objects, which manage objects of this type. It also abstracts the

details associated with working with Driver objects.

iii. Connection: This interface with all methods for contacting a database. The

connection object represents communication context, i.e., all communication with

database is through connection object only.

iv. Statement: You use objects created from this interface to submit the SQL

statements to the database. Some derived interfaces accept parameters in

addition to executing stored procedures.

v. ResultSet: These objects hold data retrieved from a database after you execute

an SQL query using Statement objects. It acts as an iterator to allow you to move

through its data.

vi. SQLException: This class handles any errors that occur in a database

application.

Since, JDBC requires the knowledge of a relational database (Like SQL), so the

knowledge of SQL (Structured Query Language) is required to perform operations

on the database, such as creating entries, reading content, updating content, and

deleting entries.

Commonly used JDBC API

29 | P a g e
i. MySql Connector driver:which is use with MySql database.

ii. Derbyclient connector driver:which is use with DB2 database.

iii. Oracle driver: which is use with Oracle database.

iv. Sybase:which is used with Sybase database.

Steps in connecting java program with database

i. Import JDBC packages: Add import statements to your java program to import

the required class into your java code.

ii. Register JDBC Driver: This step causes the JVM(Java Virtual Machine) to load

the desired driver implementation into memory so that it can fulfill your JDBC

requests.

iii. Database URL Formulation: This is to create a properly formatted address that

points to the database to which you wish to connect.

iv. Create Connection Object: Finally, code a call to the DriverManager object’s

getConnection() method to establish actual database connection.

After all these steps, now you can manipulate your database using the DML(Data

Manipulation Language), DCL(Data Control language), DDL(Data Definition

Language).

 Concept of JInternalFrame in java GUI builder(Swing)

With the JInternalFrame class you can display a JFrame-like window

within another window. Usually, you add internal frames to a desktop pane.
30 | P a g e
The desktop pane, in turn, might be used as the content pane of a JFrame.

The desktop pane is an instance of JDesktopPane, which is a subclass

of JLayeredPane that has added API for managing multiple overlapping

internal frames.You should consider carefully whether to base your program's

GUI around frames or internal frames. Switching from internal frames to

frames or vice versa is not necessarily a simple task. By experimenting with

both frames and internal frames, you can get an idea of the tradeoffs involved

in choosing one over the other.Here is a picture of an application that has two

internal frames (one of which is iconified) inside a regular frame:

Creating the Internal Frame

Constructor or Method Purpose

Create
JInternalFrame()
a JInternalFrame instance. The
JInternalFrame(String)
first argument specifies the title
JInternalFrame(String, boolean)
(if any) to be displayed by the
JInternalFrame(String, boolean, boolean)
internal frame. The rest of the
JInternalFrame(String, boolean, boolean,
arguments specify whether the
boolean)
internal frame should contain
JInternalFrame(String, boolean, boolean,
decorations allowing the user to
boolean, boolean)
resize, close, maximize, and

31 | P a g e
iconify the internal frame

(specified in that order). The

default value for each boolean

argument is false, which means

that the operation is not allowed.

static

intshowInternalConfirmDialog(Component,

Object)

static String

showInternalInputDialog(Component,

Object) Create a JInternalFrame that

static Object simulates a dialog. See How to

showInternalMessageDialog(Component, Make Dialogs for details.

Object)

static

intshowInternalOptionDialog(Component,

Object, String, int, int, Icon, Object[],

Object)

Adding Components to the Internal Frame

Method Purpose

32 | P a g e
Set or get the internal frame's content pane,

void setContentPane(Container) which generally contains all of the internal

Container getContentPane() frame's GUI, with the exception of the menu

bar and window decorations.

void setJMenuBar(JMenuBar)
Set or get the internal frame's menu bar.
JMenuBargetJMenuBar()

void

setLayeredPane(JLayeredPane) Set or get the internal frame's layered pane.

JLayeredPane getLayeredPane()

Specifying the Internal Frame's Visibility, Size, and Location

Method Purpose

Make the internal frame visible (if true) or invisible

void (if false). You should invoke setVisible(true) on

setVisible(boolean) each JInternalFrame before adding it to its container.

(Inherited from Component).

Size the internal frame so that its components are at


void pack()
their preferred sizes.

void setLocation(Point) Set the position of the internal frame. (Inherited

void setLocation(int, from Component).

33 | P a g e
int)

void

setBounds(Rectangle) Explicitly set the size and location of the internal

void setBounds(int, int, frame. (Inherited from Component).

int, int)

void
Explicitly set the size of the internal frame. (Inherited
setSize(Dimension)
from Component).
void setSize(int, int)

Performing Window Operations on the Internal Frame

Method Purpose

Set or get what the internal frame does when

the user attempts to "close" the internal

frame. The default value


void
is DISPOSE_ON_CLOSE. Other possible
setDefaultCloseOperation(int)
values
intgetDefaultCloseOperation()
are DO_NOTHING_ON_CLOSE and HIDE_

ON_CLOSE See Responding to Window-

Closing Events for details.

void Add or remove an internal frame listener

addInternalFrameListener(Intern (JInternalFrame's equivalent of a window

34 | P a g e
alFrameListener) listener). See How to Write an Internal

void Frame Listener for more information.

removeInternalFrameListener(In

ternalFrameListener)

If the internal frame's parent is a layered

void moveToFront() pane such as a desktop pane, moves the

void moveToBack() internal frame to the front or back

(respectively) of its layer.

Set or get whether the internal frame is

currently closed. The argument

void setClosed(boolean) to setClosed must be true. When reopening

booleanisClosed() a closed internal frame, you make it visible

and add it to a container (usually the desktop

pane you originally added it to).

void setIcon(boolean) Iconify or deiconify the internal frame, or

booleanisIcon() determine whether it is currently iconified.

void setMaximum(boolean) Maximize or restore the internal frame, or

booleanisMaximum() determine whether it is maximized.

void setSelected(boolean) Set or get whether the internal frame is the

booleanisSelected() currently "selected" (activated) internal

35 | P a g e
frame.

Controlling Window Decorations and Capabilities

Method Purpose

void setFrameIcon(Icon) Set or get the icon displayed in the title bar of the

Icon getFrameIcon() internal frame (usually in the top-left corner).

void setClosable(boolean) Set or get whether the user can close the internal

booleanisClosable() frame.

void
Set or get whether the internal frame can be
setIconifiable(boolean)
iconified.
booleanisIconifiable()

void
Set or get whether the user can maximize this
setMaximizable(boolean)
internal frame.
booleanisMaximizable()

void setResizable(boolean) Set or get whether the internal frame can be

booleanisResizable() resized.

void setTitle(String)
Set or get the window title.
String getTitle()

Using the JDesktopPane API

36 | P a g e
Constructor or Method Purpose

JDesktopPane() Creates a new instance of JDesktopPane.

JInternalFrame[] Returns all JInternalFrame objects that the desktop

getAllFrames() contains.

Returns all JInternalFrame objects that the desktop


JInternalFrame[]
contains that are in the specified layer. See How to
getAllFramesInLayer(int)
Use Layered Panes for information about layers.

Set or get the drag mode used for internal frames in


void setDragMode(int)
this desktop. The integer can be
intgetDragMode()
either JDesktopPane.LIVE_DRAG_MODE or

Table 2: Java JInternalFrame.

2.2. Introduction to graphics design

Computer graphic is an essential aspect of computer human interaction.

Graphic design is not only associated to the design and creating of wedding

and birthday cards, flyers but also in application development (either web app,

desktop or standalone app, phone app graphics design is essential). My interest

in graphics design came as a result of its importance in various computer fields

and also in various life application.

37 | P a g e
The tool we used in the graphic design class is CorelDraw-X7. Knowledge

acquired include:

a. Definition and explanation of Image resolution, pixels, inches, centimeter, file

Format, Image Size etc.

b. CorelDraw-X7 workspace tour.

c. Drawing different forms of shapes in CorelDraw.

d. Shaping objects in CorelDraw and concepts of objects, layers and symbols.

e. Creating 2017 calendar using different forms of designs and calendar wizard

f. Creating of custom Supermarket logo to be used in my java program

g. Designing of other Logos and icons

2.3 Ms Access

Ms Access is a database management system that is available in the Microsoft

packages.Ms Access is a type of relational database.

Database is a collection of information that is organised so that it can easily be

accessed, managed, and updated. It can be summarily described as a repository

of that data. It is also a collection of information organized to provide efficient

retrieval.

Database management System is a general-purpose software system that

facilitates the process of defining, constructing, manipulating, and sharing

databases among various users and applications. It can be said to be the

Liberian while the database is the library.

38 | P a g e
Terms in Ms Access

- Table

- Forms

- Query

- Report

2.4 Ms PowerPoint

Ms PowerPoint is an application used for presentation purpose in a lectures,

seminars, workshops, conference, Project defence, Business proposals, etc.

We were taught type of PowerPoint slide such as:

i. Title slide

ii. Title and Content Slide

iii. Two content slide

And their uses.

Also we were taught how to:

i. Animate our slide

ii. Add chart to our slide

iii. Add some shapes to our slide and to animate them

iv. How to organize a presentation

39 | P a g e
CHAPER THREE

APPLICATION OF KNOWLEDGE ACQUIRED

3.1.1 Graphic Design

With the knowledge acquired in graphics design using Corel Draw, I was able to

design a 2017 calendar sample.

Figure 3: 2017 calendar.

40 | P a g e
3.1.2 Java Programming

With the knowledge acquired in java programming using netbeans IDE, I was

able to develop a Supermarket billing system using the java programming

language.

Figure 4: Welcome window.

41 | P a g e
Figure 5: admin login window.

42 | P a g e
Figure 6: cashier login window.

43 | P a g e
Figure 4: Change admin.

44 | P a g e
Figure 7: Loading.

45 | P a g e
Figure 8: Admin main window.

Figure 9: Admin signup new cashier and update existing record.

46 | P a g e
Figure 9: Adding stock to inventory.

Figure 11: Cashier main window.

47 | P a g e
Figure 12: Creating bill for customer.

Figure 13: Record of all bills created.

48 | P a g e
CHAPTER FOUR

SUMMARY, CONCLUSION AND RECOMMENDATIONS


4.1 Summary

This report is vividly on what the Student industrial experience scheme is all

about and the experience acquired during the period of industrial training which is

based on computer graphics, java programming and networking.

4.3 Conclusion

Student Industrial Work Experience Scheme (SIWES) is an interesting

part of study which helps students to go for industrial attachment and equip

them with necessary skills needed for industrial adaptation. Thus, it enhances

ones behavior, knowledge and exposure. Experience they say is the best

teacher, no doubt to say that I have also benefited from this scheme. During

this six months programme, I have been able to put in practice the theory part

of my studies. The study also thought me on how to teach. I also was

opportune to learn not only about computer science but also about life after

school and I can confidently say it is indeed a real experience

4.4 Recommendations

SIWES is a very relevant and necessary program for all Students and should be

taken seriously by every student for each student’s professional development prior

to graduation.

1. SIWES should be properly presented to potential sponsors, such as banks,

multinational companies and other corporate institutions for support in creating

49 | P a g e
placement opportunities, training, equipment, facilities, as well as direct funding of

SIWES

2. SIWES Supervisors should be those related to one’s course of studies

50 | P a g e
REFERENCES

point, t. (2014). Tutorial point. Tutorials Point (I) Pvt. Ltd. .

Roy Shilkrot, D. l. (2012). Mastering OpenCV with practical computer vision project.

BIRMINGHAM - MUMBAI: Packt Publishing.

Roy, U. K. (2015). Advanced java programming. Kolkata: Oxford University Press 2015.

Savitch, W. (2016). Absolute Java. California, San Diego: Pearson.

Sharan, K. (2015). Beginning Java 8 fundamentals . Apress.

51 | P a g e
52 | P a g e
APPENDICES

Program source code for supermarket billing system

 Cashier bill creation code


/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
packageMyFrames;
importjava.sql.*;
importjava.text.*;
importjava.text.SimpleDateFormat;
importjava.awt.print.*;
importorg.jdesktop.swingx.autocomplete.AutoCompleteDecorator;

importjava.util.*;
importjavax.swing.JOptionPane;
importjavax.swing.JTable;
importjavax.swing.table.DefaultTableModel;
/**
*
* @author SAMEER
*/
public class CreateBillextendsjavax.swing.JInternalFrame {

/**
* Creates new form CreateBill
*/
publicCreateBill() {
initComponents();
Fillcombo();
showdate();
getsum();
billno();
AutoCompleteDecorator.decorate(jComboBox2);
this.setLocation(260, 10);
53 | P a g e
}

/**
* This method is called from within the constructor to initialize the
form.
* WARNING: Do NOT modify this code. The content of this method is
always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
able1.getValueAt(i,3).toString());
}
jTextField7.setText(Integer.toString(sum));
}
private void jButton2ActionPerformed(java.awt.event.ActionEventevt) {
DefaultTableModelmodel=(DefaultTableModel) jTable1.getModel();
model.removeRow(jTable1.getSelectedRow());
// Update query;
String sql1="UPDATE `stock` SET `available`=`available` +
'"+jTextField5.getText()+"' WHERE `pname`='"+jTextField3.getText()+"'";
Connection con;
Statement st;
// ResultSet rs1;
try{
con=DriverManager.getConnection("jdbc:mysql://localhost/qb", "root",
"");
st=con.createStatement();
54 | P a g e
//st.setString(1, tmp);
st.executeUpdate(sql1);

}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,e);
}
}

55 | P a g e

Potrebbero piacerti anche