Microsoft Word - Pre-Assessment ICS4U Pre-Assessment ICS4U Name:__________________ K(25%) I (30%) C (25%) A (20%) Total /10 /12 /10 /8 /40 1. Which statement correctly converts an integer to a strng?...

.


Microsoft Word - Pre-Assessment ICS4U Pre-Assessment ICS4U Name:__________________ K(25%) I (30%) C (25%) A (20%) Total /10 /12 /10 /8 /40 1. Which statement correctly converts an integer to a strng? [1K] a. int i = 90; String rightAngle = Integer.parseInteger (i); b. int i = 90; String rightAngle; rightAngle = integer.toString(i); c. int i = 90; String rightAngle = string.parseString(i); d. int i = 90; String rightAngle; rightAngle = string.toInteger(i); 2. Block comments in Java are marked with [1K] a. // c. /*  */ b. \\ d. % 3. What is the appropriate data type for a variable holding: [4K, 1C] The price of the basketball? The number of basketballs in a store? The first initial of a basketball player’s first name? The name of the basketball player? 4. Assume the array: [3K, 3T, 3C] int oddNum[] = {1,3,5,7,9}; What is the array name? What is the array type? What is oddNum.length? What is oddNum[4]? What is the index of number 3 ? Why would oddNum[9] produce an error? 5. Name one advantage of using each of the following in your code: [5T, 2C] Loop If statement Array Method Comments 6. Find the mistake in the following line of code: [1K] System.out.println("Have a nice day") 7. dayNum is a method that takes a String and returns an int. The String will be the name of the month and the int will be the number of days in the month as shown in the below table. [4A, 1C] Using Python or Java, write a short code that completes this operation. 8. Write the Python or Java code that is being illustrated by the following Flow chart: [4I, 1C] 9. In your own words, explain what this code is doing, and what the output means. [4A, 2C]
Apr 29, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here