Vous êtes sur la page 1sur 66

PROGRAMMING

CONCEPT
Assignment

MR ROZAN FARHAN
M R R FARHAN Programming
Concept

CONTENTS

Acknowledgement …………………………………… 1

Task 1
Task 1.1………………………………………………… 3-5
Task 1.2………………………………………………… 6 - 10
Task 1.3………………………………………………… 8-9

Task 2
Task 2.1………………………………………………… 11
Task 2.2………………………………………………… 11

Task 3
Task 3.1………………………………………………… 12-29
Task 3.2………………………………………………… 30

Task 4
Task 4.1………………………………………………… 31-34
Task 4.2………………………………………………… 35
Task 4.3………………………………………………… 36-37
Task 4.4………………………………………………… 38-40
Task 4.5………………………………………………… 41-42

Task 5
Task 5.1…………………………………………………
Task5.2…………………………………………………
Task5.3…………………………………………………

Reference

HND23 2
M R R FARHAN Programming
Concept

Acknowledgement

I feel great pleasure to acknowledge this assignment, because while I was


doing this assignment I have received plenty of assistance, advices and
contributions from my colleagues to complete this assignment successfully.

First, I feel very proud and great pleasure to thank my lecturer Mr. I.Iynharan
for helping me to understand this subject, understand problems which are in
this scenario and guided me to complete this assignment alone.

And, I am responsible to thank my Mr.Prem & Mr.Mohan for making me


comfortable to understand given scenario and for guided me to do a proper
documentation and also I thank to my colleagues, friends who shared their
knowledge with me to brainstorm this scenario.

Finally, I am responsible to thank my parents for giving me confidence while I


was struggling and I thank to all who directly or indirectly contribute to this
assignment

Thank you

HND23 3
M R R FARHAN Programming
Concept

Task 1.1

Data Storage

• What is a Data Storage

The Number of Instructions and amount of data a Computer can Store in its
memory is measured in bytes and System. Memory (or main store) is the
name giving to the group of chip inside the processing unit where data is held
temporarily whilst processing takes place .The data help in the memory is
insanity available to the computer. Unlike backing storing which has to be
accessed on disk or taps. These databases behaves like ordinary dictionaries,
with the exception that you can only
Use strings for keys and values

• Data storage advantages within computerprograming

Variable’s advantage and Array’s advantage

Programming languages what you are doing is storing things in the


computer's memory, and manipulating this store. If you want to add two
numbers together, you put the numbers into storage areas and "tell" Visual
Basic to add them up. But you can't do this without variables.

So a variable is a storage area of the computer's memory. Think of it like this


a variable is an empty cardboard box. Now, imagine you have a very large
room, and in this room you have a whole lot of empty cardboard boxes. Each
empty cardboard box is a single variable. To add two numbers together, write
the first number on a piece of paper and put the piece of paper into an empty
box. Write the second number on a piece of paper and put this second piece
of paper in a different cardboard box.

Now, out of all your thousands of empty cardboard boxes two of them contain
pieces of paper with numbers on them. To help you remember which of the
thousands of boxes hold your numbers, put a sticky label on each of the two
boxes. Write "number1" on the first sticky label, and "number2" on the second
label.

What have we just done? Well, we've created a large memory area (the room
and the cardboard boxes), and we've set up two of the boxes to hold our
numbers (two variables). We've also given each of these variables a name
(the sticky labels) so that we can remember where they are

So far you've been using variables quite a lot. You've put numbers into
variables, and you've put text into variables. But you've only done this one at
a time: you've put one number into a variable, or one string of text. You've
been doing this:

HND23 4
M R R FARHAN Programming
Concept

So one variable was holding one piece of information. An array is a variable


that can hold more than one piece of information at a time. The variable
above held one number 5. If you had an array variable called - plural - you
could hold more than one number at a time.

• Feature of Data Store

Variable

namely it’s providing character information and integer information also we


can understand ( if u want to get a character information we have to give by
String and if u want to get a number information we have to give by integer
So it, s convent to integer and string

Because of this

1. We can get particular information


(Namely we want number information or character information)

2. Quickly identify error


Namely (if we are they software developers we can identify what’s a error

For example: int Johnson;


Above example is explained character information but we had give integer
convert so here we must correct. According to below example

Example (String son)


3. When we develop Software we are divide String and integer because

This classification effecting storage namely it will make easy environment


Easy to find memory area

• Array

In data storage, an array is a method for storing information on multiple


devices. In general, an array is a number of items arranged in some specified
way - for example, in a list or in a three-dimensional table. In computer
programming languages, an array is a group of objects with the same
attributes that can be addressed individually using such techniques as
subscripting in random way in memory RAM an array is the bargain of recall

HND23 5
M R R FARHAN Programming
Concept

• Advantage of array

Array is the most important thing in any programming language. By definition,


array is the static memory allocation. It allocates the memory for the same
data type in sequence. It contains multiple values of same types. It also stores
the values in memory at the fixed size. Multiple types of arrays are used in
any programming language such as: one - dimensional, two - dimensional or
can say multi - dimensional.

• Disadvantage of array

Java is slower than C. When interpreted, Java is about 10 times slower. When
compiled by a just-in-time compiler, Java is about 2 times slower. Experts
predict that standard Java will soon be nearly as fast as C or C++, but
probably never as fast as FORTRAN. Java's run time resolution of all method
that are not declared final and its array bound checks for indexing operations
are probably the two features that hurt Jest's performance most. However, we
have not yet investigated Jest's performance systematically.

• Some information

Example

1.” Name” then I had entered 1 number then it will give name
As well as 2” age “then I had entered 2 number then it will give age
Al so we can realize this computerized system in (previous customer
information)

2. Time serving

Here we are using array length if use array length


Example: [10] [25]
So because of this within this array set we can get whole information

• Disadvantages of Data Store

1. These storage are using specific purpose only


2 .need more length namely (if use array (array length will be increased)
3. Same array can use only one time
4. May it will consume memory space
5. After data storage you have to clarify to execute the program
6. Virus can corrupt the file and you will not be able to open the particular File

HND23 6
M R R FARHAN Programming
Concept

Task 1.2

• Object Oriented Programming is a subset of structured


programming

Object Oriented Programming is path of writing programs here we are using


Objects .object’s data structure in memory that has attributes and methods
also we are using in oop object and methods .the attributes of an objects are
the same as variable and the methods. And methods of an object are the
same as function or procedures. And oop model is based on three importance
concept namely. The reason for using object instead of the old procedural
method of programming is because object group the variable and methods
about something together instead of keeping them all apart as in procedural
programming

1. Encapsulation
2. Inheritance
3. Polymorphism
And is the mechanism that binds together code and the data manipulates

• For Example

We are going to make car here car is a object but car parts and others
method

Example (oop)

Public class car


{

Public static void main (String args[])

Customer Details ob=new Customer Details ();


ob.Add name(" bans");
}
}

HND23 7
M R R FARHAN Programming
Concept

• Structure programming

structure programming we are using iteration namely (this in its simplest form
uses two values of variable, the starting and final condition for the action .the
variable is incremented on each iteration until it reaches the value identified
as the final state. structure programming we are using diagram to identify
relationship between the components of the structure and to get some idea for
developed the programmer in structure programming we can use any
languages
Structures programming three type of instruction are used such as (sequence.
selection and iteration) structure programming program order most
importance as structure programmer we ca not use Key word and structure
programmed.

For simple structure programs you often follow these steps which are shown
below.

• Get data input from the user.


• Perform calculation and make decisions.
• Display data outputs on the screen.

What is an Object-Oriented programming?

Object-oriented programming can best be describe as a programming


paradigm; a methodology of programming adopted by a programmer. Another
example of a programming paradigm would be procedural (or sometimes,
imperative) programming.

Procedural programming involves viewing a computer program as a


sequential list of computational steps (or procedures) to be carried out. In
procedural programming, the list of procedures can be further broken down
into subroutines and functions (not to be confused with mathematical
functions which are used within functional programming)

In OOP, a program is seen as comprising a collection of individual modules,


or objects, that act on each other. Each of these objects could be seen as an
independent program in itself, with a distinct role or responsibility.

OOP provides greater flexibility and easier maintenances across large


systems and can sometimes make understanding and analyzing complex
procedures a lot easier.

HND23 8
M R R FARHAN Programming
Concept

It’s worth noting, at this point, that most OOP languages (such as C++ or
Java) are tasteful where as often procedural programming languages are
stateless.

Why use Object-Oriented programming?

Object-orientation can help keep projects simple by breaking them down in to


manageable chunks. Those chunks can then be re-used in other projects,
thus saving time in the long-run. In fact, adopting an object-oriented approach
can be the foundation of a truly successful team environment; through
promoting modularity, an object-oriented environment breeds improved code
reusability and maintainability.

But don’t just take my word on this; try it for yourself! To better help you to do
that, I’m going to follow up this introduction to object-oriented programming
with tutorials on its use within JavaScript and PHP.

So in closing, I hope you’ve learnt something new from this overview. Please
feel free to post comments and questions and I’ll Endeavour to reply to the
best of my ability.

I. Three main concepts of object oriented Programming

Inheritance

Inheritance is the ability to apply another class's interface and code to your
own class. Remember, with polymorphism, you got the interface; however,
you must apply your own code. The power of inheritance is the ability to
inherit code, saving developer’s time. This type of inheritance is called
implementation inheritance. To inherit another class, use the Inherits keyword.

In the domain manager’s pattern, objects are inherited from a base class
called Domain Object. This means that every object in the system, whether it
is a student, teacher, building, address, or any other object type a system
requires will return true if asked if it is a Domain Object. The power of this
type of inheritance is that it allows us to design generic functions that take an
object of the type Domain Object and route them appropriately to specialized
code to deal with them. This is used in the Domain Manager's call to the data
layer

HND23 9
M R R FARHAN Programming
Concept

• Encapsulation

The object oriented programming will give the impression very unnatural to a
programmer with a lot of procedural programming experience. In Object
Oriented programming Encapsulation is the first pace. Encapsulation is the
procedure of covering up of data and functions into a single unit (called class).
An encapsulated object is often called and the need of encapsulation is to
protect or prevent the code (data) from accidental corruption due to the silly
little errors that we are all prone to make. In Object oriented programming
data is treated as a critical element in the program development and data is
packed closely to the functions that operate on it and protects it from
accidental modification from outside functions. Encapsulation provides a way
to protect data from accidental corruption. Rather than defining the data in the
form of public, we can declare those fields as private. The Private data are
manipulated indirectly by two ways. Let us see some example programs in C#
to demonstrate Encapsulation by those two methods. The first method is
using a pair of conventional accessory and matador methods. Another one
method is using a named property. Whatever be the method our aim is to use
the data with out any damage or change. Abstract data type in this article let
us see about it in a detailed manner.

• Polymorphism

In computer science polymorphism is a programming language programming


feature that allows values of different data types to be handled using a
uniform interface. The concept of polymorphism applies to both data types
and function. A function that can evaluate to or be applied to values of
different types is known as a polymorphic function. A data type that can
appear to be of a generalized type is designated polymorphic data type like
the generalized type from which such specializations are made. There are two
fundamentally different kinds of polymorphism, originally informally described
by Christopher Starchy. If the range of actual types that can be used is finite
and the combinations must be specified individually prior to use, it is called
Ad-hoc polymorphism. If all code is written without mention of any specific
type and thus can be used transparently with any number of new types, it is
called parametric polymorphism. Luca Card Elli and Peter Wegner later
modified Stacey’s definition by replacing parametric polymorphism with
universal polymorphism, which includes parametric polymorphism and
inclusion polymorphism.

HND23 10
M R R FARHAN Programming
Concept

• Overloading

The Overloads property allows a function to be described using deferent


combinations of parameters. Each combination is considered a signature,
thereby uniquely defining an instance of the method being defined. You can
define a function with multiple signatures without using the keyword
Overloads, but if you use the Overloads keyword in one, you must use it in all
of the function's Overloaded signatures.

• Overriding

The Overridable keyword is used when defining a property or method of an


inherited class, as overridable by the inheriting class.
The Overrides keyword allows the inheriting class to disregard the property or
method of the inherited class and implements its own code.

HND23 11
M R R FARHAN Programming
Concept

Task 2

I. Problem With The Above System

• The employ misuse the unite price

II. Importance of Developing a Computerize System

• Company all records in the computerize system they can keep a


backup so that all the records will be safety.

• All the details should be recorded in a database system with


tables,

• To find a customer details type customer name where it


indicates to type customer name and press “enter”, then all
customer details of the particular customer will be display on the
screen.

• If system available to search the sales Details and Item Details


and Damage Details and More Details.

• All this system security with the Administrator

• Purchasing and Sales records should be updating everyday.

• Employ only use this company system.

• This system easy to use.

• Calculation part is very easy.

• We can save the time and money this will be very usefully

HND23 12
M R R FARHAN Programming
Concept

Task 3.1
FLOW CHART

User Logging

HND23 13
M R R FARHAN Programming
Concept

Start

User_Name
User_Pass
Sysuser

Enter : User Name

Input : User_Name

Message
Invalid Usre
Enter : User Password

Input : User_Pass

T If Sysuser F
=Usre_Name,Usre_Pass

Boolean

Display
JOHNSON & SON

• Customer Details
Stop
Add Customer

HND23 14
M R R FARHAN Programming
Concept

Start

cusName=null; cusAdds=null; con=null; cuDate;


crAmount=0; cusCode=0; cusTele=0;
errorcusTele ; errorcrAmount

Display “Enter The Customer Code”

Auto Number

Input cusCode

Display “Enter Customer Name”

Input cusName

Display “Enter Customer Address”

Input cusAdd
F

Display “Enter Customer Telephone No”

Message Input cusTele


Invalid
Format

If T
errorcusTele=
cusTele

Display “Enter Customer TelePhone”

HND23 15
M R R FARHAN Programming
Concept

Input cusTele
F

Display “Enter Customer Address”

Input
Message cuscrAmount
Invalid
Format

If
errorcusTele=
cusTele

Out Put
cusName=null; cusAdds=null;
con=null;cuDate;crAmount=0; cusCode=0;
cusTele=0;errorcusTele ; errorcrAmount

Display
!!!!!Recode Successfully Saved!!!!!

Stop

HND23 16
M R R FARHAN Programming
Concept

Customer Edit
Start

cusName =null ; cusAdds =null ; cusTele =0

Display “Enter The Customer Name”

Input cusName

If
errorcusTele =
cusTele

Display “Enter Customer Address”

Input cusAdd

Display
Display “Enter
“Enter Customer
Customer Address”No”
Telephone

Input cusTele

Output
cusName ,cusAddress ,cusTelePhone

Stop

HND23 17
M R R FARHAN Programming
Concept

Customer Delete
Start

cusName=null;

Display “Enter The Customer Name”

Message
Input cusName Invalid
Name

If
errorcusTele=
cusTele

Deletd

Stop

HND23 18
M R R FARHAN Programming
Concept

Customer
Search

Start

cusName,SecCust

Display “Enter The Customer Name”

Input cusName

If cuName=SecCust F
T

Message
Invalid
Name

Display
cusName,cusAddres,cusTele,cus
crAmount

Stop

HND23 19
M R R FARHAN Programming
Concept

Damage Details

Add Damage

Start

itCode=0; , DamQuan=0; ,erroritCode

Boolean

Display “Enter The Iem Code”

Input itCode

If itCode=erroritCode

T
Display “Enter The Damage Item

Input DamQuan

Output
itCode,DamQuan

Stop

HND23 20
M R R FARHAN Programming
Concept

Edit damage

Start

itCode=0; , DamQuan=0; ,erroritCode

Display “Enter The Iem Code”

Input itCode

If itCode=erroritCode

T
Display “Enter The Damage Item

Input DamQuan

Output
itCode,DamQuan

Stop

HND23 21
M R R FARHAN Programming
Concept

Item Details

Item Details

Start

Model=null ,Des=null, cusName=null;


itCode=0 ,unPrice=0 ,stHand=0,

Display
Model,Des, cusName;
itCode,unPrice,stHand,

Stop

HND23 22
M R R FARHAN Programming
Concept

Search Item

Start

Model=null ,Des=null, cusName=null;


itCode=0 ,unPrice=0 ,stHand=0,
SecCust

Display “Enter The Iem Name”

Input Des

If itCode=erroritCode F
T

Message
Invalid
Format

Display
Model,Des, cusName;
itCode,unPrice,stHand,

Stop

HND23 23
M R R FARHAN Programming
Concept

Sales Details

Start

saleCode=0, cusType=null ,cusName=null, itCode=0,


UnPrice=0,qty=0,totalprice=0,discount=0, fa=0, saDate=null
Pay=null, CheNum=null ,bank=null ,CredNumb=null bankname=null
,totalprice=0,Amount=0, blanch-0,SecCust,SysgetIt

Display “Enter Salse Code”

Input salCode

Display “Enter Customer Type (Reg /Non)"

Input cusType

If If
cusType=Reg cusType=Non

Display “Enter Customer Name” Display “Enter Customer Name”

Input cusName

F
Search If
cusName=Se
cCust
T
A

HND23 24
M R R FARHAN Programming
Concept

D ispla y “E n ter Item C od e ”

Inp ut itC o de

If itC ode
=SysgetIt

D isp lay “E n ter T h e u nite P rice ”

Inp ut u nP rice

If N um ber
F orm at

D isp lay “E n te r T h e Qu antity”

In p ut qty

If N um ber
F orm at

D isp lay “D o you w a nt to con tin?”u e…

HND23 25
M R R FARHAN Programming
Concept

S
D

If (Answer. equals(“Yes”))

Input
saDate

Calculate Subtotal
[y]=qty[y]*UnPrice[y];

Calculate totalprice
=(totalprice+Subtotal[q]

HND23 26
M R R FARHAN Programming
Concept

if(C u_ty p e.e q u a ls


("R e g")) R eg

if(to ta lpric>2
e 50 0 0)

els e d is=1 0;
if(to talp ric>1
e 5 00 0)

e ls e d is=7;
if(tota lp ric>80
e 0 0)

d is=2; d is=4;

N on d is=1 0;

if(to talp ric>25


e 0 00)

e ls e
if(to ta lpric>1e 50 0 0) d is=8;

e ls e
d is=5;
if(tota lp ric>80
e 0 0)

d is=1; d is=3;

HND23 27
M R R FARHAN Programming
Concept

F F

D is p la y “E n te r P a y m e n t T y p e ”

In p u t
pay

T T
T

I f p a=y
I f p a=C
y heque If p a=C
y r e d it
C as h

D is p la y “E n t e r C h e q u e
D is p la y “E n t e r T h e A m o u n t ” D is p la y “E n t e r C re d it N u m b e r”
N u m b e r”

In pu t A m o un t In p u t Input
C heN um C re d N u m b

C a lc u la t: eb la n c=A
h m o u-F
n t a; D is p la y “E n t e r B a n k N a m e D is p la y “E n t e r B a n k N a m e

Input bank I n p u t b a1n k

HND23 28
M R R FARHAN Programming
Concept

O u tp u t
s a l e C o,cd ue s T y ,c
p eu s N a m,i tCe o d, e
U n P ric,qety,to ta lp ric,d ei s c o u,fa,s
n t a D a te F in a l
A m o u,Fn tin a l A m o,Du nistc o u,Tn ot ta l A m o u n t

D ra w L in

D is p la y
s a l e C o,cd ue s T y ,c
p eu s N a m,itC
e o e U n P,qricty,to
e ta lp
ric e,d is c o u,fa,s
n t a D a te F i n a l A m
,F oinuanl t
A m o u,Dn tis c o u,Tn ot ta l A m o u n t

D ra w L in

D is p la y “D o y o u L ik
......
e ?C( Yo eu s/N o)”

In p u t A n s w e r

If (A n s w .eerq u a ls
(“Y e s))”

S to p

HND23 29
M R R FARHAN Programming
Concept

Purchase Details
Start

SyspSppl=null;
Quantity=0,SubTotal=0,uPrice=0,itCode=0,purCode=0
Amount=0,Balnce=0,Stock=0,SyspSppl,SysitCode

Display “Enter The Purchase Code”

Input purCode

Display “The Supplier Name”

Message
Invalid
Format
Input SyspSppl

T Boolean
F
If SyspSppl =SyspSppl

Display “Enter The Item Code


F

Input itCode

Message
Invalid
Format
F
If SysitCode=itCode

A oolean

HND23 30
M R R FARHAN Programming
Concept

Display “Enter The Item Quantity

Message
Input Quantity Invalid
Format

Boolean
If errorQuantity =Quantity F

Display “PayMend Type’’

Input payMend

Input puDate

Calculate :
“SubTotal=Quantity*uPrice”

Out Put
SyspSppl;Quantity,
SubTotal,uPrice,itCode,purCode
Amount,Balnce,Stock

Display
SyspSppl,Quantit, SubTotal,
uPrice,itCode,purCode,
Amount,Balnce,Stock
!!!!! Recode Successfully Saved!!!!!

Stop

HND23 31
M R R FARHAN Programming
Concept

Task 3.2
The Trading House

• Assigning Values to Array

int itCode[]=new int[5];


int Subtotal[]=new int[5];
int UnPrice[]=new int[5];
int qty[]=new int[5];

• Creating Console

User_Pass=new String (console. read Password ("\t\t\tUser Password));

• Creating the time and date

Calendar D = new Gregorian calendar ();


int year = D.get(Calendar. YEAR);
int month = D.get(Calendar. MONTH);
int day = D.get(Calendar.DAY_OF_MONTH);

t_Date="+day+"-"+ (month+1) +"-"+year+";

• Creating the get Key

String key=null;
try {
System.out.print ("\n");
Key=obj.readLine ();
System.out.println ();
} catch (Exception e) {
System.out.println ("Error:"+e);
}
return key;

HND23 32
M R R FARHAN Programming
Concept

Task 4.1

• Functions & Procedures


 Calculate the System

Sales
Sales : Subtotal[y] =qty[y]*UnPrice[y];
Item Stock : Blanca=Stock[y]-qty[y];
Blanca : blanch=Amount-Fa;
Discount : discount= (totalprice*dis/100);
Final Amount : Fa= (totalprice-discount);

Purchase

Stock Item : Balance=Quantity+Stock;


Purchase Price : SubTotal=Quantity*uPrice;

• The array

itCode[z] = Item Code


UnPrice[z] = Unite Price
qty[z] = Quantity

• The coding to continue the program to add more


Sales items
y++;

• Printing the message

Continue to do {

Starting Form: itCode[z]


End Form : qty[z]

System.out.print ("\t\two you went continue? (Y/N) ");

• Reading the input


String

con=obj.readLine();

HND23 33
M R R FARHAN Programming
Concept

• Creating a while loop to say it is ((’’y”))

While (con.equalsIgnoreCase ("y"));

• Printing The Data’s in the invoice

cobj.DrawLine (fline);
System.out.println (" ");
System.out.println ("\t\t\t\Johnson & SON PVT LTD.\t\t\t\t\t");
System.out.println ("\t\t\t\t123 Galley Road");
System.out.println ("\t\t\t\Colombo 3");
System.out.println (" ");
cobj.DrawLine (fline);

System.out.println ("\t\Johnson Bill Menu List");


System.out.println ("\t\t**********************\t\t\tDate"+saDate);
System.out.println ("\n")

HND23 34
M R R FARHAN Programming
Concept

• Creating Discount If The Customer Type is Regular

Starting the if condition

if (cusType=="reg")

The Discount For Available To Regular Customer Total Amount

System.out.println (" Customer Type Regular");


}
if (totalprice>25000)
dis=10;
else if(totalprice>15000)
dis=7;

else if(totalprice>8000)
dis=4;

else
dis=2;
{

The Discount for Available To No Regular Customer Total Amount

System.out.println (" Customer Type No Regular");

}
else
if (totalprice>25000)
dis=8;

else if(totalprice>15000)
dis=5;

else if(totalprice>8000)
dis=3;

else
dis=1;
}

HND23 35
M R R FARHAN Programming
Concept

• The Main Class

Public class mainJohnson //Class Name


{

public static void main(String args[]) //Throws IO Exception


{

UserLogin obj = new UserLogin ();


// getting This Class method From UserLogin Class

// Displays the Main Class


Char fline = 5;

Char sline='|';
cobj.DrawLine (sline);
cobj.DrawLine (fline);
cobj.DrawLine (fline);
System.out.println ("\n");
System.out.println ("\t\t\t JOHNSON & SON INTRENATIONL PVT.LTD
");
System.out.println ("\t\t\t\t 123, GALLEY ROAD ");
System.out.println ("\t\t\t\t COLOMBO 2");
System.out.println ("\n");
System.out.println ("\t Tel No: 0117211501");
System.out.println ("\t Fax No: 0117211502");
System.out.println ("\t Web Sit: www.johnson.com");
System.out.println ("\n");
cobj.DrawLine (fline);
cobj.DrawLine (fline);

obj.User();// Getting This Class method From UserLogin Class


System.out.println("\n");
obj.DrawLine(fline); //Display

GetKey gobj=new GetKey();


// getting This Class method From GetKey Class

HND23 36
M R R FARHAN Programming
Concept

Task 4.2

Handling (Try, Catch) example coding

• Creating a while loop to check whether the input is


blank or not

Example Coding:

• Starting the try part

try {

• Creating the downhill loop to create the error

do {

• Again use the try part to make an error for the number

try {

• Print and reading the input

System.out.print ("\t\tEnter The Quantity \t\t :");


qty[y]=Integer.parseInt(obj.readLine());

• Make the input value true to bring the error

Inbox=true;

• Reading the input

qty[y]=Integer.parseInt(obj.readLine())

• Close the first Try and prints the error

} catch (Exception ex){


Index=false;

System.out.println("\n\t\sorry! It's Invalid Item Number.........?\n");

HND23 37
M R R FARHAN Programming
Concept

• Closing do while loop

} while (index==false);

Task 4.3
The coding for the login

• Import The Console Package To The User login

import java.io.Console;

public class UserLogin {

public void User () {

• Given the User name as string

String user="admin";

• Given the password as string

String password="123456";

Boolean Sysuser=true;

try{

do{

Console console = System.console();

• Read the username

User_Name= console.readLine(" User name : ");

• Read the password

User_Pass= new String (console.readPassword (" User Pass:


"));

HND23 38
M R R FARHAN Programming
Concept

• Checking the username and password

While ((User_Name.equals(User_Name)==false)||
(User_Pass.equals(User_Pass) ==false));

• That User Name and Password true Connecting the Get Key
Class

System.out.println("\n");
obj.DrawLine(fline);

GetKey gobj=new GetKey(); //GetKey Class

}
}

HND23 39
M R R FARHAN Programming
Concept

Task 4.4

This Information Which Are Already Recorded

Assigning Values

Example:

• Customer Code :

cusCode =” 1”;
cusCode =” 2”;
cusCode =” 3”;
cusCode =” 4”;
cusCode =” 5”;
cusCode =” 6”;

• Customer Name:

cusName = “Farhan”;
cusName = “Rozan”;
cusName = “Faizan”;
cusName = “Muhaz”;
cusName = “Ragavan”;
cusName = “Shopz”;

• Customer Create Amount :

crAmount =”25000”;
crAmount =”25000”;
crAmount =”30000”;
crAmount =”28000”;
crAmount =”25000”;

HND23 40
M R R FARHAN Programming
Concept

crAmount =”25000”;

• Example for Adding New Customer Details

System.out.println("\t\tADD NEW CUSTOMER");


System.out.println("\t\t================");

Boolean errorcusTele=false;
Boolean errorcrAmount=false;

try{

System.out.println("\t\tEnter The Customer Code\t\t\t: "+sd1);


//Sd1 is Get Auto Customer Code

System.out.print("\t\tEnter The Customer Name\t\t\t: ");


cusName=obj.readLine();

System.out.print("\t\tEnter The Customer Address\t\t: ");


cusAdds=obj.readLine();

do{
try{

System.out.print("\t\tEnter The Customer Telephone No\t\t: ");


cusTele=Integer.parseInt(obj.readLine());

// Her You Can Type Customer Telephone Number in Number Type


Only 10 Numbers

errorcusTele=false;
}
catch (NumberFormatException ex)
{
System.out.println("\n");

System.out.println("\t\t?..Invalied...?Please Enter Number Formatted");


System.out.println("\n");

HND23 41
M R R FARHAN Programming
Concept

errorcusTele=true;
}
}while(errorcusTele==true);

do{

try{

System.out.print("\t\tEnter The Customer Credit Amount\t: ");


crAmount=Integer.parseInt(obj.readLine());
errorcrAmount=false;

//Her so you can Type Number Format Customer Credit Amount


}
catch (NumberFormatException ex)
{
System.out.println("\n");
System.out.println("\t\t?..Invalied...?Please Enter Number Formatted");
System.out.println("\n");
errorcrAmount=true;
}
}while(errorcrAmount==true);

//Assign the System Date

cuDate=day+"-"+(month+1)+"-"+year;
System.out.println ("\t\tDate[DD.MM.YYYY] \t: "+cuDate);

// in Auto Date will Update

HND23 42
M R R FARHAN Programming
Concept

Task 4.5

• Help Commands To User


User Logging

 User Name = admin

 User Pass = 123456

Customer Details

 Customer [ C ] = Type to Customer Menu

 Add = Add New Customer Type [ Add ]

 Edit = Edit Customer Details Type [ Edit ]

 Del = Detect Customer Form Date Type [ Del ]

 Sea = Search Customer All Details Type [ Sea ]

 Display = Display You See Your All Customer Details [ Display ]

Purchase Details

 Purchase [ P ] = Type to Purchase Menu

 New = Purchase New Item Type [ New ]

 Sea = Search The What Item You Purchase all Details [ Sea
]

HND23 43
M R R FARHAN Programming
Concept

Sales Details

 Sales [ S ] = Type to Sales Menu

 Sale = Sales to Customer Type [ Sale ]

Damage Details

 Damage [ D ] = Type to Item Damage Menu

 Add = Add Damage Item Type [ Add ]

 Edit = Edit The Damage Item Type [ Edit ]

 Sea = Search The Damage Item Type [Sea] (Display)


Search Details

 Search [ F ] = Searching Item & Sales DetilasType [ F ]

 Find = Enter The Item Name to Find Type [ Find ]

 Sales = Search The Sales Bills Type [ Sales ]

 Item = Display All Item Details Type [ Item ]

Administrator

 Not Aviated Use to User This Admin [ A ]

 Main = Main Menu to Type [ Main ]

 Exit = Close The System Type [ Exit ]

HND23 44
M R R FARHAN Programming
Concept

Task 5.1

• User Training Manual

What Is Java?

Java is a high-level object oriented programming language developed


by the Sun Microsystems. It was developed to keep in mind the
consumer electronics and communication equipments. It came to
existence as a part of a web application.
A team of sun Microsystems including Patrick Haughton, Mick
Sheridan in the guidance of James Goslings decided to develop a
programming language for the betterment of consumer electronic
devices. They wanted to make new software based on the power of
networks that can be run on different application areas, such as
computers and electronic devices. In 1991 they made platform
independent software which was named Oak, but due to some patent
conflicts it was renamed as JAVA and in 1995 it was officially released
to the world.

Java is available in different form:

• JSP :
Like PHP and ASP. Java server pages based on a code with
normal HTML tags, which helps in creating dynamic web pages.

• Java Applets :
This is used within a web page to add new features to a web
browser.

HND23 45
M R R FARHAN Programming
Concept

• Java Beans :
This is like visual basic and reusable software component that
can be easily assemble to create new and advanced application.

• Java Development Kit (JDK) :-


This software program is developed by the sun Microsystems.

JDK 1.6 has following directories:

• Bin directory :-
The bin directory provides all inessential tools for developing
and testing the program through the help of command provided
by java compiler.

• Demo directory:-
This application consists many applications and applets with
source code.

• Include directory :-
It contains all header files like for ‘C’ programming language that
enables you to combine C code into a java program.

• Lib directory :-
This is a development tool which contains libraries and its
supported file.

• Docs directory :-
It is the last directory of software development kit that assists
you to store the java documents.

HND23 46
M R R FARHAN Programming
Concept

How to Open the Notepad

• There Have two ways to Open:-

 Using the Start menu


 Using the Run command

• Using the Start menu

Click
Start  All Programs  Accessories  Notepad

Scaring

HND23 47
M R R FARHAN Programming
Concept

Click the Star

HND23 48
M R R FARHAN Programming
Concept

Click the All Program

Click the Accessories

 Click the Notepad


HND23 49
M R R FARHAN Programming
Concept

Notepad

o
o

• Using the Run command

Click Start  Run

HND23 50
M R R FARHAN Programming
Concept

 In Open You Type: Notepad

HND23 51
M R R FARHAN Programming
Concept

• Run The JAVA Program in Command File

Step 1: Open
Start  Run

Step 2
Type:
Open:cmd

HND23 52
M R R FARHAN Programming
Concept

Step 3
Open the cmd :

 This You Have type is Commend

Set path=

Step 4

Click > My compute > Click the Local Disk(C :) Open It

HND23 53
M R R FARHAN Programming
Concept

There You Have Select the Program File and Open it.

In The Program File Select the Java Folder

HND23 54
M R R FARHAN Programming
Concept

Open the jdk1.6.0_01 Folder

Open the Bin Folder

HND23 55
M R R FARHAN Programming
Concept

The Bin Folder Copy the Address Link


Example C:\ProgramFiles\Java\jdk1.6.0_01\bin

Right Click Your Mouse Paste the Link in

Set Path=C: \Program Files\Java\jdk1.6.0_01\bin

HND23 56
M R R FARHAN Programming
Concept

Pate The Link Type Enter Aging Type JAVAC Type Enter JAVA will Run

Then Give you Java Class Name Run.

HND23 57
M R R FARHAN Programming
Concept

Task 5.2

• Trading House Automation System’s java program

Software tough is a process that should follow a pattern definite plane. This trying
process is often performed by an independent quality assurance faction, also called a
test team, to help make certain a luxury, highly reliable software package by finding
and improvement errors.

So we have a plane to do the testing by using several methods. Project team must
have a sub team for the testing, and the test team leader must be a fully responsible
person to the testing part. After finish the testing, he/she should prepare a testing
report and submit to project leader with in the particular days (How many days
assigned for the testing at the schedule).

Correctness testing or rightness testing


Rightness testing is the minimum equipments of software, the essential idea of
testing. The tester may or may not know the inside details of software module under
test.
When the programmers do the coding he/she must use this white box testing to test
the software parts.

HND23 58
M R R FARHAN Programming
Concept

Task 5.3

• User Menu System

User Login

 If The User Name and Password True

HND23 59
M R R FARHAN Programming
Concept

 You See This Display


• Customer Login

 You Type C you see this Message

 Her You Can Type Your Commend

Example:
Add : Add New Customer.

Edit : Edit Customer Name.

Del : Deleted Customer.

Sea : Search Customer Details.

Display: Display All Customer Details.

Main : Main Menu.

Exit : Exit the System.

HND23 60
M R R FARHAN Programming
Concept

• Purchase Login

 If You Type P you can see The Purchase Menu

 Her You Can Type Your Commend

Example:
New : Add New Purchase.

Sea : Search the Purchasing Item.

Main : Main Menu.

Exit : Exit the System.

HND23 61
M R R FARHAN Programming
Concept

• Sales Login

 If You Type S you see The Sales Menu System

 Her You Can Type Your Commend

Example:
Sale : Add New Sales.

Sea : Search the Purchasing Item.

Main : Main Menu.

Exit : Exit the System.

HND23 62
M R R FARHAN Programming
Concept

Example
Add New Sales

 You Have Use This Way To Sales Menu

HND23 63
M R R FARHAN Programming
Concept

• Damage Login

 If You Type D you see The Damage Menu System

 Her You Can Type Your Commend

Example:
Add : Add New Damage.

Edit : Edit Damage Item (Update)

Sea : Search the Damage Item.

Main : Main Menu.

Exit : Exit the System.

HND23 64
M R R FARHAN Programming
Concept

• Searching Login

 If You Type F you see The Search Menu System

 Her You Can Type Your Commend

Example:
Find : Search The Item Details.

Sales : Search Sales Bills

Item : Search All Item Details

Main : Main Menu.

Exit : Exit the System.

HND23 65
M R R FARHAN Programming
Concept

Reference

Lecture Note (Introduction to java)


Lecture Note (Flow chart)

http://en.wikipedia.org/wiki/object

www.smartdraw.com

www.mathworld.wolfram.com

www.nos.org/htm/course.htm

www.nos.org/htm/basic2.htm

http://math.about.com/od/combinatorics/index_r.htm

HND23 66

Vous aimerez peut-être aussi