0% found this document useful (0 votes)
31 views6 pages

Question Text: Feedback

This document contains 10 multiple choice questions about Java programming concepts like loops, data types, and input/output methods. Each question is followed by feedback indicating whether the user's answer was correct or not. The questions cover topics such as the output of different loop structures, return types of input methods, and valid data types for Scanner input.

Uploaded by

Lollz Autida
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
31 views6 pages

Question Text: Feedback

This document contains 10 multiple choice questions about Java programming concepts like loops, data types, and input/output methods. Each question is followed by feedback indicating whether the user's answer was correct or not. The questions cover topics such as the output of different loop structures, return types of input methods, and valid data types for Scanner input.

Uploaded by

Lollz Autida
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

Question 1

Complete
Mark 1.00 out of 1.00

Flag question

Question text

What will be the output if you execute this code?


do{System.out.println("Hello World!");}while(true);

Select one:
a. print "Hello World"
b. Do nothing
c. print "Hello World" infinitely
d. The code will not run because of syntax error

e. None of these
Feedback

Your answer is correct.

Question 2
Complete
Mark 1.00 out of 1.00

Flag question

Question text

What will be the output if you execute this code?


do{System.out.println("Hello World!");}while(false);

Select one:
a. The code will not run because of syntax error
b. None of these

This study source was downloaded by 100000850007811 from CourseHero.com on 07-26-2022 07:05:01 GMT -05:00

https://www.coursehero.com/file/67205674/Q3docx/
c. print "Hello World" infinitely
d. print "Hello World"

e. Do nothing
Feedback

Your answer is correct.

Question 3
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following does not return numeric value?


Select one:
a. nextInt()
b. nextDouble()
c. None of these
d. nextShort()
e. nextLong()

Question 4
Complete
Mark 1.00 out of 1.00

Flag question

Question text

What will be the value of x after you execute this statement


int z=0; for(int x=0; x<10; x++) for(int y=0; y<x; y++) z*=(x*y);
Select one:
a. 128

This study source was downloaded by 100000850007811 from CourseHero.com on 07-26-2022 07:05:01 GMT -05:00

https://www.coursehero.com/file/67205674/Q3docx/
b. 236
c. None of these
d. 512

e. 1
Feedback

Your answer is correct.

Question 5
Complete
Mark 1.00 out of 1.00

Flag question

Question text

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

Question 6
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which is not a repetition control structure?

This study source was downloaded by 100000850007811 from CourseHero.com on 07-26-2022 07:05:01 GMT -05:00

https://www.coursehero.com/file/67205674/Q3docx/
Select one:
a. while
b. for
c. switch
d. do while
e. None of these

Question 7
Complete
Mark 1.00 out of 1.00

Flag question

Question text

What will happen if you use JOptionPane.showMessageDialog statement in your


program?
Select one:
a. The program will display an input dialog box that allows the user to input text
and returns String value.
b. The program will display message dialog box returns String value.
c. None of these
d. The program will display an input dialog box that allows the user to input text
and returns the correct type value.
e. The program will display message dialog box.

Question 8
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following is a valid statement to accept int input? Let us assume
that we have declared scan as Scanner.

This study source was downloaded by 100000850007811 from CourseHero.com on 07-26-2022 07:05:01 GMT -05:00

https://www.coursehero.com/file/67205674/Q3docx/
Select one:
a. int num = scan.nextLong();
b. short num = scan.nextInt();
c. int num = scan.getInt();
d. short num = scan.nextShort();
e. None of these

Question 9
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following is a valid nexDouble() return value?


Select one:
a. 3.1416
b. All of these
c. 12.0
d. double value
e. floating-point literal

Question 10
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Which of the following is a valid nextInt() return value?


Select one:
a. long value
b. floating-point literal

This study source was downloaded by 100000850007811 from CourseHero.com on 07-26-2022 07:05:01 GMT -05:00

https://www.coursehero.com/file/67205674/Q3docx/
c. 1010
d. None of these
e. 3.1416

This study source was downloaded by 100000850007811 from CourseHero.com on 07-26-2022 07:05:01 GMT -05:00

https://www.coursehero.com/file/67205674/Q3docx/
Powered by TCPDF (www.tcpdf.org)

You might also like