0% found this document useful (0 votes)
126 views

Computer Project ICSE

This document contains a program submission from Siddesh S Mankar of class IX for the subject of computer. It includes 5 programs: 1) To calculate the sum of 3 numbers, 2) To calculate the area of a sphere, 3) To calculate the cube of a given number using a method, 4) To print the current date and time using the Date class, and 5) To calculate the perimeter of a circle by inputting the radius. Each program is presented with the code and output.

Uploaded by

siddesh mankar
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)
126 views

Computer Project ICSE

This document contains a program submission from Siddesh S Mankar of class IX for the subject of computer. It includes 5 programs: 1) To calculate the sum of 3 numbers, 2) To calculate the area of a sphere, 3) To calculate the cube of a given number using a method, 4) To print the current date and time using the Date class, and 5) To calculate the perimeter of a circle by inputting the radius. Each program is presented with the code and output.

Uploaded by

siddesh mankar
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/ 6

SPICER HIGHER SECONDARY SCHOOL

AUNDH ROAD, GANESHKIND – 41107

THIS PROJECT IS SUBMITTED IN THE PARTIAL


FULFILMENT OF THE COURCE, THE YEAR 2020-2021

TOPIC : PROGRAM’S

SUBMITTED TO : SWATI KHOT


SUBMITTED BY : SIDDESH S MANKAR
ROLL.NO : 37

ID.NO : EM -122
CLASS : IX

SEC :G

SUB : COMPUTER

SUBMITTED ON : /02/2020
1. Program to print te sum of three given numbers 1221, 2332, 3443.
=>
public class Test
{
void myMethod()
{
int num1,num2, num3, sum;
num1 = 1221 ;
num2 = 2332 ;
num3 = 3443 ;
sum = num1 + num2 + num3 ;
System.out.println ("3 given number are: ");
System.out.println (num1);
System.out.println (num2);
System.out.println (num3);
System.out.println ("Sum ="+ sum);
}
}

OUTPUT PRODUCED IS : -
3 given number are :
1221
2332
3443
Sum =6996
2. Program to calculate area of a sphere with radius 7 cm.
=>
class Volume_SurfaceArea
{
void calcArea ()
{
int r = 7 ;
double area , volume , pi = 3.14159 ;
System.out.println (" Radius of sphere : " + r);
area = 4 * pi * r * r ;
System.out.println (" Surface Area of sphere : " + area ) ;
}
}

OUTPUT PRODUCED IS : -
Radius of sphere : 7
Surface Area of sphere : 615.75164

3. Program to print cube of a given number using a method.


=>
class First
{
static float cube (float a)
{
float n = a*a*a ;
return n ;
}
void FirstTest ()
{
float x = 7.5f, y = 0 ;
y = cube(x) ;
System.out.println (" The cube of " + x + " is " + y ) ;
}
}

OUTPUT PRODUCED IS : -
The cube of 7.5 is 421.875

4. Program to illustrate the use of Date class for printing current


Date/Time.
=>
import java.util.*;
class DatePlay
{
static void DatePlay()
{
Date d = new Date ();
System.out.println (" This date is " + d ) ;
}
}

OUTPUT PRODUCED IS : -

This date is Sun Feb 14 16:40:48 IST 2021

5. Program that inputs radius of circle and finds its perimeter.


=>
import java.util.Scanner ;
class Circle
{
void calc_perim ()
{
double radius, perimeter ;
Scanner sc = new Scanner (System.in);
System.out.print("Enter radius : ");
radius = sc.nextDouble () ;

perimeter = 2 * Math.PI * radius ;

System.out.println ("Perimeter of circle is " + perimeter );


}
}

OUTPUT PRODUCED IS : -
Enter radius : 5
Perimeter of circle is 31.41592653589793

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy