CENG 104

searchcoilSoftware and s/w Development

Aug 15, 2012 (5 years and 3 days ago)

218 views

CENG 104

B

Lab #1

Solutions


Q
1)

Download and install Netbeans 6.8 from the
www.netbeans.org


Go to the website below, and view Introduction to Netbeans video.


http://www.deitel.com/Books/Java/JavaHowtoProgram8eEarlyObjectsVersion/tabid/3415
/Default.aspx


Go to the website below and read the following.


http://www.hrzafer.com/netbeans
-
ile
-
java
-
01
-
netbean
s
-
ile
-
uygulama
-
gelistirmeye
-
giris


Q2)

Create a java application.


Go to the website below and read the following.


http://www.hrzafer.com/netbeans
-
ile
-
java
-
02
-
hizli
-
bir
-
baslangic


Q3)

Write a program that prints "
Hello, World
".


public

class

HelloWorld
{



public

static

void

main
(
String
[]

args
)

{


System
.
out
.
println
(
"Hello, World"
);


}


}


Q4)

Write a program that prints "
Hello, World
" ten times.


public

class

TenHelloWorlds
{



public

static

void

main
(
String
[]

args
)

{


System
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


Sys
tem
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


System
.
out
.
println
(
"Hello, World"
);


}


}


Q5)

Write a program that prints "Hi, yourname. How are you?" where "yourname" is
replaced by the

argument.


public

class

UseArgument
{



public

static

void

main
(
String
[]

args
)

{


System
.
out
.
print
(
"Hi, "
);


System
.
out
.
print
(
args
[
0
]);


System
.
out
.
println
(
". How are you?"
);


}


}