forked from fcsiba/IC1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab3.java
79 lines (48 loc) · 1.85 KB
/
lab3.java
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
76
77
78
79
public class lab3
{
/* static void velocity()
{
int Vi = 100;
int a = 2;
int t = 10;
int Vf = Vi + a * t;
System.out.println("The final velocity is " + Vf );
}
public static void main(String[] args)
{
velocity();
}*/
/*public static void main(String[] args)
{
int intValue = 100;
String strValue = "john";
System.out.println(strValue + "scorad" + intValue );
}*/
/*public static void main(String[] args)
{
String strValue = "188";
int intValue = 80 + Integer.parseInt(strValue);
System.out.println("john's score is " + intValue );
int score = 50;
String shirtno = Integer.toString(score) + "A";
System.out.println("john's T-shirt no is " + shirtno);
}*/
/*public static void main(String[] args)
{
int num1 = 9;
int num2 = 4;
System.out.println("the result of additio " + num1 + " and " + num2 + " is " +( num1 + num2) );
System.out.println("the result of subtracting " + num1 + " and " + num2 + " is " + (num1 - num2 ));
System.out.println("the result of multiplicatin " + num1 + " and " + num2 + " is " + num1 * num2 );
System.out.println("the result of division " + num1 + " with " + num2 + " is " + num1/num2 );
System.out.println("the riminder after dividing " + num1 + " with " + num2 + " is " + num1 % num2 );
System.out.println("the result of division " + num1 + " with " + num2 + " is " + (float)num1 / num2 );
}*/
public static void main(String[] args)
{
int x = Integer.parseInt(args[0]);
int y = Integer.parseInt(args[1]);
double distance = Math.sqrt(x*x + y*y);
System.out.println("the distance from (" + x + " , " + y + ") to the (0,0) is = " + distance);
}
}