Page 72 - iPro_trackGPT_V5_Class8
P. 72
2. public class d1
{
public static void main(String[] args)
{
int x = 45.6;
int y = 12;
int z = x - y;
System.out.println("The value of z is: "+z);
}
}
3. public class C1
{
public Static Void Main[String args()]
{
int length, width, area;
length = 15;
width = 4;
area = length * width;
System.out.println("Area of the rectangle is: " + area);
}
}
4. public class calccube
{
public static void main(float side)
{
float cube=side*side*side;
\\ It will find cube of a number
System.out.println("The value of cube is " + cube);
}
}
E. Application-based questions.
1. If you had to write a simple program that asks for your name and age,
how would you do it in BlueJ?
2. Simi is measuring her mother's temperature in Celsius and needs a Java program to
convert this temperature to Fahrenheit. How can she write a program to perform the
conversion?
70 TrackGPT iPRO (V5.0)-VIII

