EAS 2023 Exam Questions with Correct Answers
EAS 2023 Exam Questions with Correct Answers In Java, what reserved word is used to identify constants? - Answer-final Which of the following correctly defines a constant in a class? - Answer-public static final int DAYS_PER_YEAR = 365; Which statement is true about the following code fragment involving a conditional? if (amount balance) ; Sln("Insufficient funds"); - Answer-Only prints out "Insufficient funds" when amount balance What type carries out floating-point computation without roundoff errors? - Answer-BigDecimal What is the correct order of the steps in the program development process: i. Develop and describe the algorithm. ii. Translate the algorithm into Java. iii. Understand the problem. iv. Compile and test the program. v. Test the algorithm with different inputs. - Answer-iii, i, v, ii, iv The following code is an example of what kind of statement? if (balance = amount) balance = balance - amount; - Answer-compound In a switch statement ( switch(???) ) what are the two type of variables that may be used in the area designated by? - Answer-char, int The decimal equivalent of 111010 binary is ____. - Answer-58 What is the purpose of the following algorithm? int input = Int(); while (NextInt()) { int p = input; input = nextInt(); if (input == p) { Sln("Duplicate input"); } } - Answer-comparing adjacent values Consider the following code fragment: do input = JOptionPInputDialog("Do you want to continue (Y or N): "); while (input != null && !s("Y") && !s("N")); What should the while condition be when the do loop is changed to a while loop, assuming input is initially an empty string? - Answer-(input != null && !s("Y") && !s("N"))
Written for
- Institution
- EAS
- Course
- EAS
Document information
- Uploaded on
- November 1, 2023
- Number of pages
- 15
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
- eas
- eas 2023 exam
-
eas 2023 exam questions with correct answers
Also available in package deal