Sei sulla pagina 1di 3

College of Information Technology 3rd Periodical Examinations ITE 025 Programming 1

I. Match items in column A with items in column B. Write the letter on the space provided before each number. _________1. Stores multiple data items of the same data type. a. index _________2. Used to access elements in array. b. constant _________3. An expression that has a value of either true or false. c. ifelse statement _________4. An operator that allows you to make comparisons in a d. nextInt() program. _________5. If logical expression is true, the statement executes. If e. nextDouble() it is false, the statement does not execute and the computer goes on to the next statement in the program. _________6. If the value of the logical expression is true, then f. if.else format Statement 1 executes. If the value of the logical expression is false, then statement 2 executes. _________7. Iimplemented as arrays ofarrays. g. arrays _________8. Greater than or equal to h. Scanner i. Multi-dimensional _________9. if (logical expression) statement1; Array
else statement2; _________10. if (logical expression) statement;

University of Iloilo PEN

j. k. l. m. n.

Relational Operator

_________11.Equal to _________12. Modulus operator _________13. A variable declared with a permanent value. _________14. Stores information permanently _________15.Method that returns the size of the array. _________16. Single-line comment _________17.Read data from the standard input device. _________18. Data type for decimal numbers. _________19.Data type for positive and negative whole numbers. _________20. Concatenation operator _________21.Devices including monitor and printer _________22.Performs a specific task; examples include word processors, spreadsheets, and games. _________23.Brain of the computer. _________24.Boolean Values _________25. If the input can be interpreted as an integer. _________26. If the input can be interpreted as floating-point/decimal. _________27.Method used to convert strings to integers. _________28.Two types of Java programs _________29. If the input can be interpreted as string. _________30. Method used to convert strings to double.

parseDouble() next () >= Applications and Applets o. if statement p. q. r. s. t. u. v. length == if format (int) Integer Double Secondary Storage //

w. CPU x. + y. Logical (Boolean) z. True or False a.1. parseInt () a.2. Application Program a.3. Output devices a.4. %

Ijsc13

College of Information Technology 3rd Periodical Examinations ITE 025 Programming 1


II. Fill in the blanks with the missing codes. a. A program that adds two integers using JOptionPane class. importjavax.swing.__________; public__________ Addition { publicstatic__________ main ( String args[] ) { String firstNumber,secondNumber; int number1,number2,sum; firstNumber = JOptionPane.showInputDialog( "Enter first integers" ); secondNumber = JOptionPane.showInputDialog( "Enter second integers" ); __________ = Integer. parseInt(__________ ) __________ = Integer. parseInt(__________ ) sum = number1 + number2;
JOptionPane. __________ (null, "The sum is " + sum); } }

University of Iloilo PEN

b. Reading strings and numeric data using Scanner class. import__________.util.*; public class InputConsole { static__________ console = new Scanner(System. __________); public__________ void main(String[] args) { String firstName; String lastName; int age; double weight; System.out.println("Enter first name, last name, age, and weight separated by spaces."); firstName = console.next(); lastName = console. __________(); age = console. __________ weight = console. __________(); System.out.println("Name: " + firstName+ " " + lastName); System.out.println("Age: " + age); System.out.println("Weight: " + weight); } } Sample Run: Enter first name, last name, age, and weight separated by spaces. Sheila Mann 23 120.5 Name: Sheila Mann Age: 23 Weight: 120.5

Ijsc13

College of Information Technology 3rd Periodical Examinations ITE 025 Programming 1


Answer Key: 1. G 2. A 3. Y 4. J 5. O 6. C 7. I 8. M 9. F 10. R 11. Q 12. A.4 13. B 14. U 15. P 16. V 17. H 18. T 19. S 20. X 21. A.3 22. A.2 23. W 24. Z 25. D 26. E 27. A.1 28. N 29. L 30. K

University of Iloilo PEN

II. JOptionPane, class, void, number1, firstNumber, number2, secondNumber, showMessageDialog, Java, Scanner, In, static, next, nextInt (), nextDouble

Ijsc13

Potrebbero piacerti anche