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

Java Lab Task: Coding Questions

The document outlines three Java lab tasks. The first task requires implementing a piecewise function based on the value of x. The second task involves calculating the average of even numbers less than 20, and the third task requires using a switch statement to print a message based on a student's grade.

Uploaded by

laila.alheilat
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)
6 views1 page

Java Lab Task: Coding Questions

The document outlines three Java lab tasks. The first task requires implementing a piecewise function based on the value of x. The second task involves calculating the average of even numbers less than 20, and the third task requires using a switch statement to print a message based on a student's grade.

Uploaded by

laila.alheilat
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

Java Lab Task - Questions Only

1. Write code to implement the following equation:

Fx =
x + 7 , if x < 10
x^2 + 3 , if x == 10
x^3 + 5 , if x > 10

2. Write Java code to calculate the average of even numbers less than 20.

3. Write Java code to enter the student grade, then print the following sentence using switch
statement:

A -> Excellent
B -> Very Good
C -> Good
D -> Passed
E -> Failed

You might also like