logo

Crowdly

FIT1051 Programming fundamentals in java - MUM S1 2025

Looking for FIT1051 Programming fundamentals in java - MUM S1 2025 test answers and solutions? Browse our comprehensive collection of verified answers for FIT1051 Programming fundamentals in java - MUM S1 2025 at learning.monash.edu.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

When the following code is executed an error is encountered and the program crashes. On which line do you think the error is encountered?

You may assume that all required classes have been defined elsewhere.

Demo class

0%
0%
0%
0%
0%
View this question

Which of the following loops will execute the statements at least once, even though the condition is false initially?

View this question

What will be printed when the following code is executed?

String firstname = "John";

String surname = "Smith";

surname.toUpperCase();

System.out.print(firstname.charAt(0) + " " + surname);

View this question

What does the following Java code display on the screen?

int rows = 4;

String output = "";

for (int i = 0; i < rows; i++)

{

output = output + i;

for (int j = 0; j < i; j++)

output = output + "*";

}

System.out.print(output);

View this question

Consider the following code:

public void displayNames()

{

   int i = 5;

String[] names = new String[10];

System.out.println(names[i]);

}

What will be the output when displayNames executes?

View this question

You have been provided with the following loop. It is required to do some processing on all the odd numbers between one and maxNumber inclusive.

int index = 1;

do

{

    //Some processing code is done here

    //insert line here

} while (index < maxNumber);

What line of code can be inserted before the end of the loop, so that the loop only checks the odd numbers between 1 and maxNumber? Multiple responses are allowed — select all that apply.

View this question

When the following code is executed an error is encountered and the program crashes. On which line do you think the error is encountered?

You may assume that all required classes have been defined elsewhere.

Image failed to load: Demo class

View this question

How many rows will be displayed on the screen when the following code is executed?

for (int index = 0; index <= 20; index++)

{

System.out.println("The current number is : " + index);

index++;

}

View this question

You have been provided with the following class diagram:

Quiz Class Diagram

and the following code:

Package objPack = new Package();

Based on the provided information only, how many objects are created in total (external and internal) when the code is executed?

View this question

What is the value of x after the execution of the following program segment?

int x = 1;

while (x < 2)

{

x = 10;

x = x - 5;

}

View this question

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!