CSC EXAM 1 PREP WITH 100% GUARANTEE PASS
1.A ysingle ysilicon ychip ymade yfrom ypotentially ymillions yof ytransistors yis
ycalled-
: yA ycentral yprocessing yunit, yCPU
2.How ydoes yJava yachieve yportability?: yJava yprograms yare ycompiled yto
yinstruc- ytions yfor ya yvirtual ymachine.
3.An yexample yof yan yinput ydevice ythat yinterfaces ybetween ycomputers
yand yhumans yis: ya ymicrophone
4.Consider ythe yfollowing ystatements yabout ycomputer yprograms:
I. Computer yprograms ycan ybe ywritten yby ysomeone ywho yhas ya ybasic
yknowledge yof yoperating ya ycomputer.
II. Computer yprograms ycan ycomplete ycomplex ytasks yquickly.
III. Large yand ycomplex ycomputer yprograms yare ygenerally ywritten yby ya
ygroup yof yprogrammers.
IV. Computer yprograms yare ycomposed yof yextremely yprimitive
yoperations. yWhich yof ythe ystatements yare ycorrect?: yII, yIII, yand yIV
yonly
5.Which yone yof ythe yfollowing ytranslates yhigh-level ydescriptions yinto
ymachine ycode?: ycompiler
6.What yis ythe ydifference ybetween yan yeditor yand ya ycompiler?: yAn yeditor
1 y/
y28
,yallows yprogram yfiles yto ybe ywritten yand ystored; ya ycompiler yconverts
yprogram yfiles yinto yan yexecutable yprogram.
7.What yis ythe youtput yfrom ythis ycode ysnippet?
System.out.print("The ysum yis y");
ySystem.out.println("7 y+ y3");: yThe ysum yis y7 y+ y3
8.Consider ythe yfollowing ypseudocode. yWhat ydoes yit yproduce?
Set yn yto
y1 ySet yp
yto y1
Repeat yuntil yn yequals y20
Multiply yp yby y2 yand ystore yresult yin yp
yAdd y1 yto yn
Print yp: yTwo yraised yto ythe ypower y20
9.Sometimes yerrors ythrow ythe ycompiler yoff ytrack ybecause: ythe
ycompiler ydoes ynot ygive yup ywhen yit yfinds ythe yfirst yerror
10.Evaluate ythe ypseudocode ybelow yto ycalculate ythe ypayment y(pmt) ywith
ythe yfollowing ytest yvalues:
The ytotal ynumber yof yhours yworked y(workingHours) y= y50
The yrate ypaid yfor yhourly ywork y(rate) y= y10
y
2 y/
y28
, Input
yworkingHours
yInput yrate
pmt y= yworkingHours y*
yrate yIf yworking_hours y>
y45
extraHours y= yworkingHours y-
y45 yextraPmt y= yextraHours y*
yrate y* y2 ypmt y= ypmt y+
yextraPmt
Output ypmt: y600
11.Which ystatement yis ytrue yabout yvariable ynames yin yJava?
They ycan ycontain ythe ypercent ysign y(%).
They ycan ycontain yan yunderscore ysymbol y("_").
yThey ymust ymake ysense yas ya yword.
They ycan ycontain yspaces.: yThey ycan ycontain yan yunderscore ysymb
y("_").
12.Which yof ythe yfollowing ystatements ywith ycomments yis(are) yvalid?
I. int ycnt y= y0; y/* ySet ycount yto y0
II. int ycnt y= y0; y/* ySet ycount yto y0 y*/
III. int ycnt y= y0; y// ySet ycount yto y0: yII yand yIII yonly
13.What ywill ybe ythe yvalue yinside ythe yvariables yx yand yy yafter ythe ygiven
yset yof yassignments?
int yx y=
y20; yint yy
y= y10;
x y= y(x y- yy) y* y2;
y y= yx y/ y2;: yx y= y20, yy y= y10
14.Assuming ythe yfollowing yinitializations:
double yx y= y-
2.5; ydouble yy y=
y1.5; yint ym y= y4;
int yn y= y18;
What yis ythe yvalue yof ythe yfollowing yexpression?
3 y/
y28
1.A ysingle ysilicon ychip ymade yfrom ypotentially ymillions yof ytransistors yis
ycalled-
: yA ycentral yprocessing yunit, yCPU
2.How ydoes yJava yachieve yportability?: yJava yprograms yare ycompiled yto
yinstruc- ytions yfor ya yvirtual ymachine.
3.An yexample yof yan yinput ydevice ythat yinterfaces ybetween ycomputers
yand yhumans yis: ya ymicrophone
4.Consider ythe yfollowing ystatements yabout ycomputer yprograms:
I. Computer yprograms ycan ybe ywritten yby ysomeone ywho yhas ya ybasic
yknowledge yof yoperating ya ycomputer.
II. Computer yprograms ycan ycomplete ycomplex ytasks yquickly.
III. Large yand ycomplex ycomputer yprograms yare ygenerally ywritten yby ya
ygroup yof yprogrammers.
IV. Computer yprograms yare ycomposed yof yextremely yprimitive
yoperations. yWhich yof ythe ystatements yare ycorrect?: yII, yIII, yand yIV
yonly
5.Which yone yof ythe yfollowing ytranslates yhigh-level ydescriptions yinto
ymachine ycode?: ycompiler
6.What yis ythe ydifference ybetween yan yeditor yand ya ycompiler?: yAn yeditor
1 y/
y28
,yallows yprogram yfiles yto ybe ywritten yand ystored; ya ycompiler yconverts
yprogram yfiles yinto yan yexecutable yprogram.
7.What yis ythe youtput yfrom ythis ycode ysnippet?
System.out.print("The ysum yis y");
ySystem.out.println("7 y+ y3");: yThe ysum yis y7 y+ y3
8.Consider ythe yfollowing ypseudocode. yWhat ydoes yit yproduce?
Set yn yto
y1 ySet yp
yto y1
Repeat yuntil yn yequals y20
Multiply yp yby y2 yand ystore yresult yin yp
yAdd y1 yto yn
Print yp: yTwo yraised yto ythe ypower y20
9.Sometimes yerrors ythrow ythe ycompiler yoff ytrack ybecause: ythe
ycompiler ydoes ynot ygive yup ywhen yit yfinds ythe yfirst yerror
10.Evaluate ythe ypseudocode ybelow yto ycalculate ythe ypayment y(pmt) ywith
ythe yfollowing ytest yvalues:
The ytotal ynumber yof yhours yworked y(workingHours) y= y50
The yrate ypaid yfor yhourly ywork y(rate) y= y10
y
2 y/
y28
, Input
yworkingHours
yInput yrate
pmt y= yworkingHours y*
yrate yIf yworking_hours y>
y45
extraHours y= yworkingHours y-
y45 yextraPmt y= yextraHours y*
yrate y* y2 ypmt y= ypmt y+
yextraPmt
Output ypmt: y600
11.Which ystatement yis ytrue yabout yvariable ynames yin yJava?
They ycan ycontain ythe ypercent ysign y(%).
They ycan ycontain yan yunderscore ysymbol y("_").
yThey ymust ymake ysense yas ya yword.
They ycan ycontain yspaces.: yThey ycan ycontain yan yunderscore ysymb
y("_").
12.Which yof ythe yfollowing ystatements ywith ycomments yis(are) yvalid?
I. int ycnt y= y0; y/* ySet ycount yto y0
II. int ycnt y= y0; y/* ySet ycount yto y0 y*/
III. int ycnt y= y0; y// ySet ycount yto y0: yII yand yIII yonly
13.What ywill ybe ythe yvalue yinside ythe yvariables yx yand yy yafter ythe ygiven
yset yof yassignments?
int yx y=
y20; yint yy
y= y10;
x y= y(x y- yy) y* y2;
y y= yx y/ y2;: yx y= y20, yy y= y10
14.Assuming ythe yfollowing yinitializations:
double yx y= y-
2.5; ydouble yy y=
y1.5; yint ym y= y4;
int yn y= y18;
What yis ythe yvalue yof ythe yfollowing yexpression?
3 y/
y28