From dcd6b49fc604827553a0e26edcb0bd1ab3a77bf7 Mon Sep 17 00:00:00 2001 From: Samuel Edward Date: Sun, 1 Dec 2019 14:19:03 +0100 Subject: [PATCH 1/2] Issue 2.19 solved --- samueledward/Question 2.0/Circle.java | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 samueledward/Question 2.0/Circle.java diff --git a/samueledward/Question 2.0/Circle.java b/samueledward/Question 2.0/Circle.java new file mode 100644 index 0000000..74a33f2 --- /dev/null +++ b/samueledward/Question 2.0/Circle.java @@ -0,0 +1,43 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package classes; + +/** + * + * @author Samuel Edward + */ + +import java.util.Scanner; + +public class Circle { + public static void main (String args[]) { + // Declaration of varriable + int radius, diameter; + double circumfrence, area; + double PI = 3.14159; + + // Getting varriable from the user + Scanner sc = new Scanner(System.in); + System.out.println("Enter the radius of a Circle: "); + radius = sc.nextInt(); + + //Output Assignment + diameter = 2 * radius; + circumfrence = PI * radius * 2; + area = PI * radius * radius; + + //Printing all the requiered variable to the console + System.out.println("The value for the diameter : " + diameter); + System.out.println("The value for the circumfrence: " + circumfrence); + System.out.println("The value for the area : " + area); + + + + + + } + +} From 5abd1c32f64a4e1538fa2515e9409948660cb175 Mon Sep 17 00:00:00 2001 From: Samuel Edward Date: Mon, 2 Dec 2019 08:37:07 +0100 Subject: [PATCH 2/2] insert those 2 --- .../Question 2.0/Square_and_Cubes.java | 45 +++++++++++++++++++ samueledward/Question 2.0/TOD.java | 21 +++++++++ 2 files changed, 66 insertions(+) create mode 100644 samueledward/Question 2.0/Square_and_Cubes.java create mode 100644 samueledward/Question 2.0/TOD.java diff --git a/samueledward/Question 2.0/Square_and_Cubes.java b/samueledward/Question 2.0/Square_and_Cubes.java new file mode 100644 index 0000000..91b9ca9 --- /dev/null +++ b/samueledward/Question 2.0/Square_and_Cubes.java @@ -0,0 +1,45 @@ +//Compute the square and cubes +package classes; + +/** + * + * @author Samuel Edward + */ +public class Square_and_Cubes { + public static void main (String args []) { + + //Block for displaying the numbers itself + System.out.print("The numbers are : "); + for(int i =1; i<=10; i++){ + System.out.print( i); + if (i < 10) { + System.out.print(","); + }else { + System.out.println("."); + } + } + //Block for displaying the square of those numbers + System.out.print("The numbers for the square are : "); + for(int i =1; i<=10; i++){ + System.out.print( i*i); + if (i < 10) { + System.out.print(","); + }else { + System.out.println("."); + } + } + + //Block for displaying the cube of those numbers + System.out.print("The numbers for the cube are : "); + for(int i =1; i<=10; i++){ + System.out.print( i*i*i); + if (i < 10) { + System.out.print(","); + }else { + System.out.print("."); + } + } + + +} +} diff --git a/samueledward/Question 2.0/TOD.java b/samueledward/Question 2.0/TOD.java new file mode 100644 index 0000000..3dd9ad2 --- /dev/null +++ b/samueledward/Question 2.0/TOD.java @@ -0,0 +1,21 @@ + +package classes; + +/** + * + * @author Samuel Edward + */ +public class TOD { + public static void main (String args []) { + + //Printing TOD + System.out.println(" *********** * *"); + System.out.println(" * * * * *"); + System.out.println(" * * * * *"); + System.out.println(" * * * * *"); + System.out.println(" * * * * *"); + System.out.println(" * * * * * *"); + + + } +}