## Question: QUESTION 12 What is the value of text[10] for the following character array? char text[] = “GOOD …

QUESTION 12 What is the value of text[10] for the following character array? char text[] = “GOOD LUCK!”; ок O ! Array Index Out Of Bounds O 10 QUESTION 13 What is the value of x when the following while loop exited? int x = 5; while (x >= 1) oo 05

## Question: Remaining Time: 1 hour, 58 minutes. 06 seconds. Question Completion Status: 10 points Save Answer…

Remaining Time: 1 hour, 58 minutes. 06 seconds. Question Completion Status: 10 points Save Answer Write a java program that prompts a user to enter the numbers of students in three sections of Course “Problem Solving and Algorithms and computes the maximum of average marks for the final examinations taken by these three sections. The program must include the following methods: Method arrayInitializer that receives the number of students in a section as input prints the array of randomly generated integers from range 0 to 100. and returns the array Hint: to generate random integers, use Math.random method or Random class. Method average that receives an array of integers and returns the average of the elements in the array, Method printArray prints all elements of the array as shown in the example Method main prompts a user to enter the number of students in three sections initializes three arrays using arrayInitializer method. calculates the average marks of three sections using average method. computes the maximum of three average marks, and prints the result. Hint: to find the maximum, use Math.max method. Example run: Enter the numbers of students in three sections: 9 8 10 The marks for the first section: 37 90 12 58 23 97 52 10 The marks for the second section: 69 40 78 81 60 30 61 11 The marke for the third section: 19 60 30 35 74 73 41 36 63 11 The maximum average mark 1: 54.75 TTT Anal 3 /120 – T.E.E. .

## Question: Given the code: int x = 5; int y = 14; while(x

Given the code: int x = 5; int y = 14; while(x <= y) { System.out.println("Hello"); X How many times is "Hello" printed? NE BE S EE 3 LES 1

## Question: For i in range(1, n): on o n-1 n+1 ol+n

for i in range(1, n): on o n-1 n+1 ol+n

## Question: Write a program that calculates the distance between two points A and B, and the area of the circ…

using c programming
straightforward

Write a program that calculates the distance between two points A and B, and the area of the circle which is centred on the mid-point of the line joining A and B (where the line AB represents! the circle’s diameter). The program should read in two pairs of integers (x1, y1) and (x2, y2) representing A and B as shown below. The program should print the distance between A and B (diameter), and the area of the circle, area. Take PI = 3.1416. Hint: to read properly the input with scanf, you have to respect the specific format of the input which is in this case “x=%d y=%dnx=%d y=%d”. For example: Test Input Result Example x=4 y=4 Distance between A-B: 2.00

## Question: CREATE TABLESPACE user_tbspace DATAFILE ‘user.dbf’ SIZE 2m; create user mary identified by mary; …

CREATE TABLESPACE user_tbspace DATAFILE ‘user.dbf’ SIZE 2m;
create user mary identified by mary;
grant create session to mary with admin option;
create role tester;
grant create table to tester;
grant tester to peter;
grant select on table to peter;
CREATE VIEW emp_1 AS ( SELECT E.employee_id, E.first_name,
E.last_name, E.email, E.phone_number, E.hire_date, E.job_id,
E.commission_pct, E.manager_id, E.department_id
FROM employees E
JOIN departments D
ON E.department_id = D.department_id
JOIN locations L
ON D.location_id = L.location_id
WHERE L.country_id = ‘US’);
grant select on emp_1 to mary;
Question:
Explain whether It is possible for Mary to grant the privilege
and the role emp_1 to other users?

## Question: 1. Which of the following statements is correct? IF order > 5   prize = ‘yes’; END I…

1. Which of the following statements is correct?
IF order > 5

prize = ‘yes’;

END IF;
IF order > 5 THEN

prize = ‘yes’;

ENDIF
IF order > 5 THEN;

prize = ‘yes’;

END IF;
IF order > 5 THEN

prize := ‘yes’;

END IF;
2. Which one of these methods is not a standard HTTP method?
GET
POST
PUT
UPDATE

## Question: Moving to another question will save this response. Question 5 What is the output of the followin…

Moving to another question will save this response. Question 5 What is the output of the following program: public static void main(String[] args) { int[][ board = {{12, 3, 1}, {1, 20, 13}, {20, 10, 7}}; int i,temp; for(i=0;i<3;i++) System.out.printf("%3d", board[i][i]); System.out.println(""); for(i=0;i<3;i+){ temp=board[i][i]; board[i][i]=board[i][2-i); board[i][2-i]=temp: for(i=0;i<3;i++) System.out.printf("%3d", board[i][i]); System.out.println(""); TT T Arial 3 (12pt) TE E

## Question: A counter-controlled while loop uses user inputs to control the loop. True False QUESTION 5 In an…

A counter-controlled while loop uses user inputs to control the loop. True False QUESTION 5 In an infinite loop, the condition expression (the decision-maker) is always false. Hence the loop will not stop/exit. True False QUESTION 6 C++ has three looping (repetition) structures: while, for, and switch. True O False Click Save and Submit to save and submit. Click Save All Answers to save all answers. Arrays index is always between 0 – ArraySize. True False QUESTION 8 An array can be passed as value parameter to function. True False QUESTION 9 Functions, also called modules, are like miniature programs. O True False Click Save and Submit to save and submit. Click Save All Answers to save all answers. The while and for loop bodies (statements) may not execute at all, but the do…while loop body always executes at least once. True False QUESTION 11 Given the following C++ code, what is saved in array Y at the end? int X[] = {1,2,3,4,5 }; int Y[5] = {0}; for (int i=0; i<5; i++) { Y[4-i] = X[i]; } O 01234 O 54321 O 00000 O 12345 QUESTION 12 Click Save and Submit to save and submit. Click Save All Answers to save all answers.

## Question: Create a function named draybox), which takes an integer number and a character as input paramete…

Create a function named draybox), which takes an integer number and a character as input parameters and returns no result vold). drawBox() function will output to screen the pattern shape of a box with number of characters on all sides with the same as specified according to the input parameters (shown below). For example, drawBox[10. X) will draw 10 x characters to all sides. SAMPLE INPUT/OUTPUT If input parameter to the function has value 5, drawBox(5,’*’): You must use loop in your codes, otherwise, marks will be deduced. drawBox TTT Arial 3 (12pt) T.E E