Professional Documents
Culture Documents
Project To Print
Project To Print
SCHOOL
Sign Remarks
INDEX
1) Program 4.2 1
2) Program 5.9 2
3) Program 6.1 3
4) Program 7.1 4
5) Program 8.3 5
PROGRAM 4.2
Write a program to find the sum of three given numbers 1221, 2332, 3443.
OUTPUT
3 given numbers are:
1221
2332
3443
Sum = 6996
PROGRAM 5.9
OUTPUT
Radius of sphere : 7
Surface Area of sphere : 615.75614
PROGRAM 6.1
OUTPUT
The cube of 7.5 is 421.875
PROGRAM 7.1
Program to illustrate the use of Date class for printing current Date/Time.
import.java.util.*;
class Dateplay
{
static public void DatePlay()
{
Date d = newDate();
System.out.println(“The date is” + d);
}
}
OUTPUT
The date is sat Feb 24 20:46:16 EST 2018
PROGRAM 8.3
Write a program that inputs the radius of a circle and finds its perimeter.
import.java.util.Scanner ;
public class Circle
{
void calc_perim()
{
double radius, perimeter ;
Scanner sc = new Scanner(System.in);
System.out.println(“Enter radius : ”);
radius = sc.nextDouble();
perimeter = 2 * Math.PI * radius ;
System.out.println(“Perimeter of a circle is ” + perimeter);
}
}
OUTPUT
Enter radius : 3.5
Perimeter of a circle is 21.991148575128552