0 ratings0% found this document useful (0 votes) 41 views19 pages220912
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Electronics and Communication Engineering Discipline,
Khulna University.
An Assignment On CSE-1251
Course Title: Object Oriented Programming
Course Code: CSE-1251
Submitted By :
Hisam Uddin
Student ID: 220912
1 year, 2 Term
Electronics and Communication Engineering Discipline
Khulna University
Submitted To =
Atanu Shome
Assistant Professor
Computer Science and Engineering Discipline
Khulna University
Khulna
Submission date: 15"* October, 2023CSE 1251 Assignment
9-218 Credle a Fle and write 10 aroma
about Khulna Univeasely im sepewate lines .
Ans?
packoge sedasadi rilhighseheo! 3
import Javacio. xy
publie class Assignment ay
public stedie vord main (oirg oO angs
try X
File file = new File C KhulnabtiverstyTn-fo be 9) 3
FileWriter: widens new Fileweiten (Silk) ;
[Joniche 10 Linus of infoamedion aboucl tehulna Universi ky
Stoingl] os = 4 ikhdna Ubivensily loeded iw Khana,
Bongladesh , isa renowned public research, undvewly®,
arg uns establish im 1994 and as one of Abe -to p
univeastl ies ty ha courtlag “y
Me Aehulnia Univensily ofeas a wide rtomge 64 academe
programs, inelading avrlengrodkate and postgraduate
degrees au"ome tovivertily compus ts known for ds beaudifel
neelerreal sunnoundings and medean facilities. 5
t 4 4
‘54 has a” hong focus on feel and
innevedion in vacious fields. ”,
"OC Khulna Universtly Nas a diverse and vibrant
student community US)
"3-The Sacully members are highly qualitied
and dediceded to eveellence in Aeehing and rewsecaech.”,
Ilg"The aaniversly eonhiibudes signif few clo the
development oy Ake region vy
15.5luderts and neseanehens od Khulna University
“engage in various cornmanily and sovicl aclivilies.”,
ok \nalnes University MS committed to oeademie
erecllenee and social cesponsibality A 5fon (Staing xt 9s) 4
univer. warte (« ‘3
conten. onibe (”\n")5
Syston owt. pnt ("Indonmaction abeeet khalnor
Univenily has been cvaitHen le the Kile)
conten. closes;
? cot (TOE xeeption &) {
Syslem-oud print hy (e-gel Message C1) ;
é
x© Fie Gat View Neve Sonee felaaor Rin, Debug Pete Teor Tos. Wie. Ani
sae atten © TB D
p aheut Kheln:
Cd
foo See et eee eee nS ene
eee
including undergraduate ar
Sees eee
ee ee eee
Sarre eee eer east nee
3S sensi x Sa
ee Seed meoetone =
ASEM ice iy le© Fle GA View Nevis Souce Aetaaor Rin Debug Potie Tarn Too Win
88S 9¢ (auem (0 THD
6 =
Source) History | ie | LS FR ve 4 @
ae ee : °
att? wn
highly aBa Tmagine 1a File named “in pat Art ” contains
5 numbers, and—mubliply the Read those neumbers
ond mucliply them Aogethere . Ouctped the result in
another Sile 5
Avs:
package sadasadim| highse kool 5
irmporct JOWaTO. 95
import java-uctil: Seamnen
public class Assignment Qe 4
pablic adie void main (String h 1 args) <
try
Seannen inpoct = new Seonnen (Systm. in) ;
String 05 T] = new Swing [5]
Sydem.reel-println (7 Enter five numbers
into inpoct file? ”) 5
Sor (int i= 05 ic85 Vet) <
OSTA) = inp net O5int nes = 415
toy
File Sika = new File (" input tet "5
filed ereod New File 05
FileWeiden $0 < new Filewaiben (Silt);
Buffeaed Waiter -comlent = neco Buffered Wrikea hu);
Buffered Reader neident= new Buffered Reader (new
“Fila Reeden (Siled) ) 5
Son (Aning x4 08)X
waiters. wribe (x)5
covicten 1. wonile C" Wn");
cunitert.elose O}
Sw. elose O35
SAning lime 3
wile (CU =neodens. readline ()) t= nal) t
ik X= Trbegen: panse Tit (lind)System cut paint ln C Read 2 "4 x) 5
mes ¥*#= x5
°
teaden 1. Close O}
a
cecleh (Exe ption \<
Syskon. ood: priv bo (e.gelMesage) ;
“File Siler ~ ees File (“odpd tet") 5
Filer -eneate ew Fik 05
Budfered Reader nendenr = neor Buffered Reader (
new File Readen (Sie2) ) 5
Busfead Weater unitena = new Buffered Warten (
new Filweiler (filer) 5
urilena. waite (" Rewth of Maltiglicaliog & 4 nes)
waiter2. else;(
System-out-paictln(” Result has been weilken
in output file");
System. oul. pain (neadena read Line()) ;
Keadeno. elose O}
"
gate (Exception e) <
Systm. ou paint ln (e . gel Message 0) )
-
5semeriora x | PAGS
FAL PS
C
Co ao| 9-03: Creede -lwo hacad s . Fins one will
be used Jon painting number. 1 +o 16000 .
Second one uill be used for pale ing your manne
Jas Himes. Code in such a way Ane the
Second thread should Sinish find tho nreons
op erecting system will allow second one to ean
mone than +he Sinct Ahnead
oe pockgge assignment 435
public elass None extends Thaead
@ Override
public void can ()
fon Cini-as | Asem} ar
Syston udegeint ls (Rissa Uddin (Shawn) ("
4a")5package assignmer| 433
publie class Nemben extente Thread «
@Overnide
public void can () y
fou (int Let} 1Z= 1006003 itt) \
Systeen.purl-paird In (" prieteg number % "es
(
°
?
package asignmer 43),
pablie eles Assignment aa
public sledie veid min (sheing bt anys) <
Namber num = vew Namber() 5
Name name = “ee Name O35
name. setP iondly (Theead. MAY.PRIORITY);
num. sel Prioridy (Theerd. MaN- PREORTTY);
num. stant O35
nome. Starcd (5
A =°
Nemeiena
TE Nembernve
@a-B Vera PSs
© Fe nit vs
haegS 9
bb
int:
ia) Basin
Uadin (Shawon)
Ucdin (Shawon)
ets
>
PF_—?t
pre’
| Pour Show example of enoing ib reed el in
suo different ways (Theeod elass and
cunnable inlea-face) .
package asignnierd 443
[By exdend elas CTread)
public Class Thread Class extends Thread
@ Ovennide
public void ceun() <
fou (inp i= 1512-360 0% 5 ine) <
System. oud paint ln(” From Thacad Cus +”
+i);fackage assignmerd a4;
I by implamerc{ Runnable interface
publie elas Rawnable Tiberfnee implements Ramble
@ Overnide
pablie void aan <
fon (int i EL} 1Z=9.06000 5 iet){
Sypslem, oud: paved ln G From Runnable Tnlerace ca
+ty5prekage cusignment 44 ;
pablie elas -A ssigumer a4 ¢
pabtie cledie vad main (Stnigg C3 4093) {
114 extend Thaend Class ,
Thinend Class Thnend 2 = new Whnend Class (14
MBy implement Runnable Twlenface
“Tinend Thrend 2 = aces Thread (
new RunnableTuterree ) 5
Thinead 1. Aer QO)
Thhrend 2 starch OSctcastortas
& fuensbetnenacaaen a x BAsgmensaw x Asonmerttyaa «
ee “© Fie Eat inv Nee Sones Retr Rin Deiag ORE Ta TOOK vn
ee : SERS OE antes (OTB
© Opt Aesigamenet (ru)
Dhamvemnaie Assign wa x Bp Asigrnentazae = Gb Asonnertesa
eee i CEFR PS rracnlé