Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
75 lines (61 loc) · 1.29 KB

File metadata and controls

75 lines (61 loc) · 1.29 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package methods;
import java.util.Scanner;
public class classwork {
/*
* Q) find area and volumes as:
* a) getArea:
* -> pass l and b as a parameter
* -> calculate area
* -> return area
* -> call this method in main
*
* b) volume:
* -> pass area and height as parameter
* -> calculate volume
* -> print area
* -> print volume
* -> call this method in main
*
*/
public static void main(String[] args) {
int area = getArea(3,4);
int vol = volume(area, 6);
System.out.println(area);
System.out.println(vol);
input();
}
static int getArea(int l, int b) {
int area = 0;
area = l*b;
return area;
}
static int volume(int area, int height) {
int vol = 0;
vol = area * height;
return vol;
}
/*
* Q) SI and amout
* a) input
* b) processing
* c) output
*
*/
static void input() {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the P, T, R for calculation:");
int p = sc.nextInt();
int t = sc.nextInt();
int r = sc.nextInt();
processing(p,t,r);
}
static void processing(int a, int b , int c) {
int SI = (a*b*c)/100;
int amt = a + SI;
output(SI,amt);
}
static void output(int SI, int amt) {
System.out.println("SI : " +SI);
System.out.println("Amount : "+ amt);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.