Skip to content

Commit 6ae82b4

Browse files
authored
Create BMI Calculator
it will calculate your category
1 parent b23583b commit 6ae82b4

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

BMI Calculator

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
class Complex{
3+
int real;
4+
int img;
5+
Complex(){
6+
7+
}
8+
Complex(int real,int img){
9+
this.real=real;
10+
this.img=img;
11+
}
12+
void display() {
13+
System.out.println(real+" + i"+img);
14+
}
15+
Complex add(Complex c1,Complex c2) {
16+
Complex temp=new Complex();
17+
temp.real=c1.real+c2.real;
18+
temp.img=c1.img+c2.img;
19+
return temp;
20+
21+
22+
}
23+
24+
}
25+
public class q3 {
26+
27+
public static void main(String[] args) {
28+
Complex c=new Complex(10,20);
29+
Complex c1=new Complex(20,30);
30+
Complex c3=new Complex();
31+
c3=c1.add(c1, c);
32+
33+
c1.display();
34+
c.display();
35+
c3.display();
36+
37+
}
38+
39+
}

0 commit comments

Comments
 (0)