Search Header Logo

OOP_Lecture 07 & 08

Authored by lecturer note

Education

University

OOP_Lecture 07 & 08
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

6 questions

Show all answers

1.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a Java statement that declares a string array initialized with the following strings:

"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" and "Saturday".

After that, write a loop that displays the contents of each element in the array that you declared.

Evaluate responses using AI:

OFF

2.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a program that creates an array of 10 elements size. Your program should prompt the user to input numbers in array and then display the sum of all array elements.

Evaluate responses using AI:

OFF

3.

OPEN ENDED QUESTION

3 mins • 1 pt

4. The variable list1 and list2 are reference arrays that each have 5 elements. Write code that copies the values in list1 to list2. Values in list1 are input by user.

Evaluate responses using AI:

OFF

4.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a Java program and use for loop to find the largest and smallest element of an array.

Evaluate responses using AI:

OFF

5.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a Java program that creates an array of int and initializes it with the values 3, 2, 5, and 1. Then, use a while loop to find and print the smallest element in the array.

Evaluate responses using AI:

OFF

6.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a Java program that creates an array of integers and initializes it with the values 2, 4, 6, 8, and 10. Then, use a do-while loop to calculate and print the product of all the values in the array

Evaluate responses using AI:

OFF

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?