Write a code fragment that determines and prints the number of times the character 'z' appears in a String object called name.

What will be an ideal response?


```
int count = 0;
for (int index = 0; index < name.length(); index++)
if (name.charAt(index) == 'z')
count++;
System.out.println("The character \'z\' appears "
+ count + " time(s)");

```

Computer Science & Information Technology

You might also like to view...

Ergonomics is an important consideration

a. only for desktop computers. b. only for laptop computers. c. only for laptop and desktop computers, but never for mobile devices. d. for all computing devices.

Computer Science & Information Technology

Consider the following schema:


Professor(Id: INTEGER,Name: STRING,DeptId:DEPTS)
Teaching(ProfId:INTEGER,CrsCode:COURSES,Semester:SEMESTERS)
Transcript(StudId:INTEGER,CrsCode:COURSES,Semester:SEMESTERS,Grade:GRADES)

(a) Write a SELECT statement that returns the course code of every course that has ever
been taught by a professor whose DeptId is 'CS'.
(b) Translate the above statement into an equivalent relational algebra expression. Briey
describe the evaluation procedure that your expression specifies.
(c) Translate the following relational algebra expression into an SQL statement.

Computer Science & Information Technology

To create a table from an existing range of data,

A) click in a cell and on the Home tab, click the Insert arrow in the Cells group. B) click the Insert tab and then click Table in the Tables group. C) select any cell in the worksheet then click Existing Range in the Tools group. D) click within the range, click the Table Tools Design tab, and then select Convert to Table.

Computer Science & Information Technology

A macro is actually a Microsoft Visual Basic (VBA) ________

Fill in the blank(s) with correct word

Computer Science & Information Technology