0% found this document useful (0 votes)
23 views1 page

Programming Assignment 3

Uploaded by

LLLLL MMMMM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

Programming Assignment 3

Uploaded by

LLLLL MMMMM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

COMP 1412 - Introduction to CS II

Chapters - 5
Faculty: Likhitha Kanagala
Programming Assignment-3

Name: __ __

Due Date: __10/23/2024___

Grade: _______

Section-I

Answer any one of the questions below:

1. What output is produced by the following code fragment?

float product = 100.05, data = 21.75;


if (product < data + 50)
System.out.println("One is printed!");
System.out.println("Two is printed!");
System.out.println("Three is printed!");
(OR)
2. What output is produced by the following code fragment?

int max = 1000, min = 100;


while (max > min)
{
max - = min;
System.out.println(max);
}

Section-II

Answer any one of the questions below:

3. Write a while loop that verifies that the user enters a positive integer value.
(OR)
4. Write a method called floatEquals that accepts three floating point values as parameters. The
method should return true if the first two parameters are equal within the tolerance of the third
Parameter.

You might also like