0% found this document useful (0 votes)
40 views

Computer Semester Assessment 2

This document discusses sorting an array and calculating employee salary. It contains code to input elements into an array, sort the array, and calculate salary based on basic pay and allowance percentages. Key variables include an integer array to store elements, loop variables for sorting, and data types like int and double to store employee number, basic pay, and salary details.

Uploaded by

Hello
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Computer Semester Assessment 2

This document discusses sorting an array and calculating employee salary. It contains code to input elements into an array, sort the array, and calculate salary based on basic pay and allowance percentages. Key variables include an integer array to store elements, loop variables for sorting, and data types like int and double to store employee number, basic pay, and salary details.

Uploaded by

Hello
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Condruttor Me

has h Saroe nama + kas a diferen hame


khe class name. thdenhat he cla4s
nam

9AA arame tutze Consrutlor is a mumberr meho hidh is use


to niiateu iganee vavtableb ypairing parumet vales
af he irns objec 15 create.
size at4 lbyBes
elenunt 4yfes
he lemans (5x1)
y
60byhes
port'javat.tilk
Clas4Bubble o
yod aiat

iainput
C),
Voi Input C)
Scanner sczneu canan (Sysemin)
int a ]ziger Neus int L20]
System.out prirtln "Enhr 20 elemerts")
Citie 0ji<20jif
QL112Sc.next ntt)
Sort(a)
3
void Sort A Gat al1)
Forintiz0f k19itt)

orint j s19-1jt)

int empz a11;


oit4 lemp

Systum.outprintin( Sore ra arrOy..J


br (int e DiA1,)
ystt mout.prninth(ari

5 Impoct ava.util.XK
class Salarry
Int emp- no, basie obeble-daz0:0,
As aalany Cind e it b)

hasice b
cla 2 00
Voi taleula te C)
ifprice{e25000)
dds /100-0 prRb45ic
elseif Cpricez25001 * price k= 50000)_
dos 2 20/100-0 * pr
elseitCprica J*50000)
da 25/c0-0 basic
System.out. paintln Degrness alowaree
"tda)

oi main C)

Scannen SCEncu SCANner (System, in):


Sys om.t.println("Ener e asic "):
t b e sc.nextfrtU;
Sstem.out.printm (Enter emplaye rne.";
intec next Snt)
Salary Se neu alaryle,b),
SCafculate)_
Da eNac
urpose
h e array
in To store he .
elements n

Use as e loup variable

i Use a looe vari@ble


|Dsts lor Swappi ng elements

5Dota tpeVaiable Purpose


iat J o 2tore gpud krom the usr
int
b To skpre inpu rom he user
iot emp-n ToStere Umployee no.
at hasi To Store basie SalaTy
doube da Store deamess allotwdmce.

You might also like