100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

UGRD-ITE6201F Computer Programming 2 - Midterm Exam (100% Correct Answers) GRADED A

Rating
-
Sold
-
Pages
23
Grade
A+
Uploaded on
28-10-2024
Written in
2024/2025

UGRD-ITE6201F Computer Programming 2 - Midterm Exam (100% Correct Answers) GRADED A

Institution
Sti
Course
BSIT 00










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
October 28, 2024
Number of pages
23
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

UGRD-ITE6104 Computer Programming 2
Midterm Lab Exam



1. What will happen if you use JOptionPane. showInputDialog statement in your
program?
Select one:
a. The program will display message dialog box returns String value.
b. The program will display an input dialog box that allows the user to input text and
returns String value.
c. The program will display message dialog box.
d. The program will display an input dialog box that allows the user to input text and
returns the correct type value.
e. None of these


2. What is the output of the code snippet below:
void main(){
test(1.0);
test(1);}
void test(double x){
System.out.print(x); }
void test(int x){
System.out.print(x);}
Select one:
a. 1.01
b. 1.0
c. 11
d. 1.01.0
e. None of the choices


3. Which is not a decision control structure?
Select one:

,a. if else-if else
b. if
c. switch
d. if else
e. None of these


4. What will happen if you use JOptionPane.showMessageDialog statement in your
program? The program will display message dialog box.


5. Which of the following shows Overloading method?
Select one:
a. void test(int x){} void test(int y){}
b. All of these
c. void test(){} void test(){}
d. void test(int x){} void test(double x){}


6. What will be the value of x after executing this code
for(int x=0; x<=10; x++) {} is run?

Select one:
a. 1
b. 0
c. 11
d. 10
e. None of these


7. Which of the following correctly accesses the sixth element stored in an array of
10 elements?
Select one:
a. intArray[7];
b. stringArray[5];
c. intArray[10];
d. intArray[6];

, e. None of these


8. What is the output of the code snippet below:
void main(){test(“11”);test(“1”);}
void test(String x){System.out.print(x + x);}
Select one:
a. 222
b. None of the choices
c. 111111
111
d. 6


9. Which of the following is a valid nexDouble() return value?
Select one:
a. floating-point literal
b. double value
c. 12.0
d. All of these
e. 3.1416


10. Which of the following is a valid nextByte() return value?
Select one:
a. None of these
b. int value
c. 128
d. short value
e. 3


11. What will be the output if you execute this code?
do{System.out.println("Hello World!");}while(false);


Select one:

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ProfGoodlucK Rasmussen College
View profile
Follow You need to be logged in order to follow users or courses
Sold
3474
Member since
4 year
Number of followers
2867
Documents
8655
Last sold
3 days ago
High Quality Exams, Study guides, Reviews, Notes, Case Studies

All study solutions.

4.0

704 reviews

5
379
4
131
3
83
2
39
1
72

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions