commit f82356c02002fcb184f1e1d6ace68705c21cf002 Author: k0rrluna Date: Mon Oct 7 19:09:36 2024 +0300 first commit diff --git a/exercise2/first.class b/exercise2/first.class new file mode 100644 index 0000000..e8c4833 Binary files /dev/null and b/exercise2/first.class differ diff --git a/exercise2/first.java b/exercise2/first.java new file mode 100644 index 0000000..941373d --- /dev/null +++ b/exercise2/first.java @@ -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)); + } +} \ No newline at end of file diff --git a/helloworld.class b/helloworld.class new file mode 100644 index 0000000..3c6e4f1 Binary files /dev/null and b/helloworld.class differ diff --git a/helloworld.java b/helloworld.java new file mode 100644 index 0000000..d20b115 --- /dev/null +++ b/helloworld.java @@ -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!"); + } +}