0% found this document useful (0 votes)
65 views13 pages

Computer Project Class12

The document describes code for a basic calculator program that uses functions like addition, subtraction, multiplication, and division, and prompts the user to input numbers and select an operation to perform calculations. It also includes code examples for other programming concepts like loops, lists, finding the mean and maximum value.

Uploaded by

Aanshi agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views13 pages

Computer Project Class12

The document describes code for a basic calculator program that uses functions like addition, subtraction, multiplication, and division, and prompts the user to input numbers and select an operation to perform calculations. It also includes code examples for other programming concepts like loops, lists, finding the mean and maximum value.

Uploaded by

Aanshi agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

COMDUTER

Cocding
#Sinp Calculatare
Puint MENDECR CELRALIoNG
citaADDITION
uint"S-SUESIREACTION"
ouiok'71-MULTLPLICHTION')
imtd-DIVISION)
pecint e-EXPONEN T"

NO-intLinputCEteLtatalna
Lomt tocda cheaticn))
wilh Lhich
NO==2:
NUMBER-= Waatnbut"Sntex No )
NUMBER2-Wsatinput
NO==3;
"ertex mo. )
NUMBER1Elcatlinput ("£ntee NO"))
NUMBER_2laat Unpukl EnteANO ")
NUMBER3-loatLinputCEnteNO:))
elin NO== 4:
NUMBERJ= Loatlinhut LEntot No.)-
NUMBER2=laatE;inkuutl_5nter No."2
NUMBER3- lontinkut Eder NO.)
NUMBER y= Uoatlinfut ErntexNo )
elis NO==5
NUMBER_ E not LnRutEntexeND2)_
NUMBER_2 oot LiNputErteeNo"))
NUMEER3 oat linpLutEnteseNo.)).
NUMBER 4=Jeoct(LnputlenterNo))
NUMBER 5 oat inbutlEntseNO)_
elLe
Lnt Min wmkere Aith tLA LOAtchopexatton
Cn be dne 4/MAX nutmbeohid
peadton am be done 5 )
LADI. No.

Date
Page

a-ADDITION"
S-SUBSTRACTION
m-MULTIPUCATION
d-DhUSION
e-ExpONENT"
SER_INPUT= inkutSntex the yunctan
USER_NPUTE=\a'aad NO2=22
INUMBER 3=0
NUM BER Y=OL
NUMBER S=0.
USERINDUTE=Nal adl NO==3:
NUMBER_uO
NUMBER 5-0_

USER TNPUT =z a and NO==Y:


NUMBER5=0
i USER_TNPUT==S amd NO==2
NUMBER 5-O
NUMBER 9=O
O
NUMBER 5
SER INPUT E="S amd NO==8:
NUMBER 4=0.
NUMBER 5=0
LSER_TNPLIT==S amod NO==4:
NUMBERSe0
SER TNPUT=="M'amd NO2:
NUMBER_ 3
NUMBER s
NUMBER 5 1
DSER_ TNPUTE=Mana NO==3:
NUMBER =al
NUMBER S
(Date
Page

SER_ INEDI==\m'and NO=Ly:


NUMBER5
i USER_TNPUT=="d'and NO=:2:
NUMBER_3 =
NUMBER Y=
NUMBER 5
SER_TNPUT==dancl N0==3
NUMBER Y=L
NUMBER5 u
ISER_ INDUT==d amdNO==41i
NUMRER 5 =-
DSER TNPUT="A
OUTPUT: NUMBER 2NDMBER 1+NUMBER 3+ NUMBER Y
+NUMBER 5
eintCOUIUI
ei USER TNPUT ==s": 3-NUMBER.Y_
OUTPUT: NOMBER.2-NUMBER.I-NUMBER
- NUMBER 5
puintlOUTPUT)
eli UsER_INEUT=="m"
NDMBER 2 NUMBER 3 *AMEE-
OVTPUTE NUMBER I
NUMBER *NUMBER_S
Purt (OUTPUT)
e i L UsER TNPUT=="d
2/NUMBER 3/NDMBER Y/
OUTPUTs NUMBERL/NUMBER
NUMBERS
RinHOUTPUT)
e uSER INPUT==e ",
OUTPUT=NOMBER 2* * NUMBER

urd (TNVOLID ENTRY")


BOacltean
caregQK

Outpt
dStnake
MENUEOK OPEAALIONS

a-ADDITON
6-SUBSTRACTION
m - MULTIPLICATION

d-DIVISION A n u m = l

e-ExPONE NT
soamta.tnda
ente tbtad nauaith slich uain
Sbeucdticon: a
entex nO.5-
Entex no 2
Snten theunction:e u
QuTpUE : 9

gum
k=l

X=
(Date
Pag

a Dsiteamy 5hMnqamR(0each_Lhejatlasi
cateco3

ilSingle Laob ({ou RULAile)


OAoLAmumbeai in canae 5) :
suint W elcame
emum=lQ

olLle Mum >=6:


uintmum)a
Dumenum-

um=o
L0zkin eangeLlaa a):
SLUm=Sim+R
n t (sum)

um=0
k=
ehile k <22:
um=2umtk
R=k+3
psuirtlsum)
DoHd=Pythaon

X=Xti
puin
Paga

Nestero faops Cho AuAita)

uint C2end=

xcint C

l15,A5)
xagge
mum in
a u a e e i i h Hangel mum):
mum 21==0:

Mumi

(EQunda ladtox (L,)fou', num


bsuirt
bxeak
elA e
buuntlmLumirahuime Mumbeu

3aA=5
iin Hamae (Hauno-1)

AuihtlNLuM,end=
aliStein Date
Pag

Atinb1utlSnted
Wenoth PenC(enteyOAuino
Ate)
uimt Oseioinal Atlnobuing
w

Ateina =
oxa in Hange
(0, Lengti,2)2
Abing 2+=sbino[o_
a<(Lengkh-1)
taingQtE inalatl-upeO
Aimt ALernatiuelyabitalizecl stngstuino)

QAtuing=inputEntea
2engfh.len (Abuing) stuing
BuintQuiinalsDringszing
ing 2-
Rox AJO HOnge(0,
Jenglh
Atxinq 2 sting Ta
aLength -B:
Sbingt= sbiino
buint ALtemati OIuhexO
oelu cábitolizecl
tina:uina
Aing=ÄnpLut Etex asbuin
Lengkh=lentuing
stint-
micd= LengkA/2_
eL-L
0L a Ln suamge (mid):
at=

else
jseint(S6ung mat a palincbame
l CAtina L falindcome)
Cate
Page

Amberl:
nk'Sntet a Atuing (a Clecimal
Es pastition (".2
#uint CGiuen atxinmgs
n outatteyoiecinalt2

SAt inputCEntouaAtzuiog
Text= EalAe

NChÎn AtLL kedligit a


int Phe atuimgcoontiuing a
teste u e
bueak
test z=Fale
QaigiE
int (The Abiingdmemat Comtasn

iat)_
OLst=eual ltobuct (Snte
longthslenCLtt)
min ele=litlo0
Min irnd e =O
a t i n Hange ULeng£h):
stLIKmin ele
min ele =Lti
min ele=
Ant(inen Liatat)
Lint h e minimum eLement a theqiuenlins
Bnt min_eleat Lnclear,min incle
oate
Page

lEntex At:)
Lt eLLal (input
Leng&hz len llst
(Enteu elementio bo4eancheod
element- unttinkut 6 6as))
lO,Qengkh)E
Oxiin Limge
elemend== lstTL:
clement,Lorund atëndex i )
_rumt
bueak

else {aumdL Ln the aisen


buimtelementimat

3DAteLucOinkutl ' S r t e a l i n t ) .

length = lerllat)_
meam= Aum=O_

O, Length)
auiin mge(
Sumt-ut[tL

meam=um/lengLh

piint"isenQiati lat)
Mean)
aisen liut:
uint he mean gAthe

linpL(Ente liat:")D
t = elsal
Lengih=len(Ot)
kiggert2 secandbiggest=lat[o1
(1Lengfh):
oei in eange
SeCOndagtigeat

S e c o n d b i m e s t t T 1

Bingent
eintkasugest mnumber e Lhe list" econciige
Mumber.List
langeak
auinACd ecand
03tei
pa9

Lt=onas Lickut(Enterlint
Lerath= len COat
emd= Lemgth-
t
Amt Licainol lint
AwhileK=end
el=ut
Lelea=O:
a i o sange liend:
Phtli:1at[iti
ehse
e t end0
encd=end-|

itel
ointZexa hijted: t )

Tmble
O T-(a3, u5,34, 6611 61,70
ma 1alue=ma (D_
Lemgth=anlT)

aN a in Mamge (Lergth):
ecmax KI[aKmaxLualue
SecmaX=TC]
Bsunt (Secamd ianaeT AlLueJeCmax
Date

p z a t t e m e n t c h è k h g

tups euLalLinkutCCatercatule')

ln=Lenltup
iea False
mn= Muntus)

iLIh2 2 E=0:_
hatt= lnll2
imn=tplhalL@Lma==A ho/-D:
=Iue

elae
Aa=inl/2
i mn hip[halTE
Lies= Taue

puintMinimum liesa the uplemiddle)_

buimt"Minimum cloesn't lest druhlen


middle)
tu= eualLioput ("Sntey a list))
o eL in tub:
pHimt CComiaintezdublrate lement
Heak
Oate
Page

=Raa i u t S a t e a up l e : )

mmx=maz
maacCub-
tubicQumtCmx)>l+
pauadt Comtaimimiultilple macimUmele

nt (CanialnA on me omaximLLmaelemeat
ttau
kA= eAal (Entexmonk fuple2
otal AUm Cmba
aun= total/5-
anq =75:
gade='A

geade=3

xade= C'

gLadee D'_
Auint ( T a t a l M a r e k a t n t a l O t a d e - , r a d e )

gictionan
OM= {1
n=smt [ i n b u t H D 0mamyatuclent?"))1
a A i n Lamge(n}:_
Hm=QLnal tnputC£ntex Rol0
ma, Masks: "
Mlul=m_
retnt(Grented clictiomany
uint lM1
(0te
Pag

Emplcyee 1chn: age';25, 'salaz O000, Du


age 25,Aulax 5000oi
Wov keuin Embloyee
intEnlakayae" key
aeatulEmpeoL2egkeu NageD
e s o =

bimt
eintSata t (EmhlnyeekeyJlsalar

n= intliobutlg Hauanuatudenta)
Complinnea={}
kora in xangeln):
Ray=inkLt (Nameqthettulent")
A90lue =iattabut(UN&umber @KcombetitienALon
kambiDinnexatreul= L0alue
imtThe olictianaumas
uint ComplDione

You might also like