Compare commits

...

2 Commits

Author SHA1 Message Date
232e2bf47f Merge branch 'main' of ssh.ras-pi.xyz:k0rrluna/java
Old merge
2024-10-07 19:12:25 +03:00
f82356c020 first commit 2024-10-07 19:09:36 +03:00
4 changed files with 38 additions and 0 deletions

BIN
exercise2/first.class Normal file

Binary file not shown.

26
exercise2/first.java Normal file
View File

@ -0,0 +1,26 @@
import java.util.Scanner;
public class first{
public static void main(String[] args) {
int test1;
int test2;
double radius;
System.out.println("Test Data:");
System.out.println("a. "+(-5 + 8 * 6));
System.out.println("b. "+ ((55+9) % 9));
System.out.println("c. "+ (20 + -3*5 / 8));
System.out.println("d. "+ (5 + 15 / 3 * 2 - 8 % 3));
Scanner scan = new Scanner(System.in);
System.out.println("Enter integer 1");
test1 = scan.nextInt();
System.out.println("Enter integer 2");
test2 = scan.nextInt();
System.out.println("The PRODUCT of two integer: "+ (test1*test2));
System.out.println("Enter radius of a circle! (pi taken as 3!)");
radius = scan.nextDouble();
System.out.println("The area of circle: "+(3*radius*radius)+"\nThe perimeter of circle: "+(2*3*radius));
}
}

BIN
helloworld.class Normal file

Binary file not shown.

12
helloworld.java Normal file
View File

@ -0,0 +1,12 @@
import java.util.Scanner;
public class helloworld {
public static void main(String[] args) {
String test;
Scanner scan = new Scanner(System.in);
System.out.println("ENTER A TEXT!");
test = scan.nextLine();
System.out.println("You entered\n" + test);
int result = 50;
System.out.println("Hello, World!");
}
}