Advertisement
Kuebjii

Kuebjii's Console V1.2

Dec 16th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 37.58 KB | None | 0 0
  1.     import javafx.scene.paint.Stop;
  2.     import java.text.SimpleDateFormat;
  3.     import java.util.ArrayList;
  4.     import java.util.Date;
  5.     import java.util.Scanner;
  6.     import java.util.Random;
  7.     import java.util.concurrent.TimeUnit;
  8.     import java.awt.Graphics;
  9.  
  10.     class Colors {
  11.         public static final String RESET = "\u001B[0m";
  12.         public static final String BLACK = "\u001B[30m";
  13.         public static final String RED = "\u001B[31m";
  14.         public static final String GREEN = "\u001B[32m";
  15.         public static final String YELLOW = "\u001B[33m";
  16.         public static final String BLUE = "\u001B[34m";
  17.         public static final String PURPLE = "\u001B[35m";
  18.         public static final String CYAN = "\u001B[36m";
  19.         public static final String WHITE = "\u001B[37m";
  20.     }
  21.  
  22.     class Users {
  23.         String Name;
  24.         double powerLevel;
  25.         boolean passwordProtected;
  26.  
  27.  
  28.         public Users(String Name, int powerLevel)
  29.         {
  30.             this.Name = Name;
  31.             this.powerLevel = powerLevel;
  32.         }
  33.  
  34.         public String getName()
  35.         {
  36.             return Name;
  37.         }
  38.         public double getLevel()
  39.         {
  40.             return powerLevel;
  41.         }
  42.  
  43.         public String UserSummary()
  44.         {
  45.             return("Username: " + this.getName() + " | " + " Level: " + this.powerLevel);
  46.         }
  47.     }
  48.  
  49.     public class Main {
  50.  
  51.         public static void Guestinput() {
  52.             String user = "Guest";
  53.             Scanner reader = new Scanner(System.in);
  54.             System.out.print(Colors.GREEN + "@" + user + "|"+ "> " + Colors.RESET);
  55.             String input = reader.nextLine();
  56.  
  57.             if (input.equals("hello") || input.equals("HELLO")) {
  58.                 System.out.println("Hello World!");
  59.                 Guestinput();
  60.             }
  61.             if (input.equals("help")) {
  62.                 System.out.println(Colors.RED + "Commands:" + Colors.RESET);
  63.                 System.out.println(Colors.RED + "hello - outputs Hello World" + Colors.RESET);
  64.                 System.out.println(Colors.RED + "help - you're already here" + Colors.RESET);
  65.                 System.out.println(Colors.RED + "shutdown - shuts the console down" + Colors.RESET);
  66.                 System.out.println(Colors.RED + "exit - shuts the console down" + Colors.RESET);
  67.                 System.out.println(Colors.RED + "run - runs a program" + Colors.RESET);
  68.                 System.out.println(Colors.RED + "run help - displays all programs you can run" + Colors.RESET);
  69.                 System.out.println(Colors.RED + "back - takes you back to the main menu" + Colors.RESET);
  70.                 System.out.println(Colors.RED + "time - says your current time and date" + Colors.RESET);
  71.                 System.out.println(Colors.RED + "flip - flips a coin" + Colors.RESET);
  72.                 System.out.println(Colors.RED + "whoami - self explanitory" + Colors.RESET);
  73.                 Guestinput();
  74.             }
  75.             if (input.equals("shutdown") || input.equals("exit")) {
  76.                 System.exit(0);
  77.             }
  78.             if (input.equals("run help")) {
  79.                 System.out.println(Colors.RED + "Programs:" + Colors.RESET);
  80.                 System.out.println(Colors.RED + "scalculator - shape calculator, defines area, circumference, and similar items" + Colors.RESET);
  81.                 System.out.println(Colors.RED + "calculator - simple calculator" + Colors.RESET);
  82.                 Guestinput();
  83.             }
  84.  
  85.             if (input.equals("run calculator")) {
  86.                 normalCalculator();
  87.             }
  88.  
  89.             if (input.equals("run scalculator")) {
  90.                 KuebjiiCalculatorMenu();
  91.             }
  92.  
  93.             if (input.equals("back"))
  94.             {
  95.                 GuestmainMenu();
  96.             }
  97.  
  98.             if (input.equals("time"))
  99.             {
  100.                 SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
  101.                 Date date = new Date(System.currentTimeMillis());
  102.                 System.out.println(formatter.format(date));
  103.                 Guestinput();
  104.             }
  105.             if (input.equals("flip"))
  106.             {
  107.                 if (Math.random() < 0.5){
  108.                     System.out.println("Heads");
  109.                 }else{
  110.                     System.out.println("Tails");
  111.                 }
  112.             }
  113.             if (input.equals("clear"))
  114.             {
  115.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  116.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  117.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  118.                 Guestinput();
  119.             }
  120.             if (input.equals("login"))
  121.             {
  122.                 userBase();
  123.             }
  124.             if (input.equals("whoami"))
  125.             {
  126.                 System.out.println("You are logged in with: " + user);
  127.                 Guestinput();
  128.             }
  129.             else
  130.             {
  131.                 System.out.println("Command: " + input + " was not found!");
  132.                 GuestmainMenu();
  133.             }
  134.         }
  135.  
  136.         public static void grupinput() {
  137.             String user = "grup";
  138.             Scanner reader = new Scanner(System.in);
  139.             System.out.print(Colors.GREEN + "@" + user + "|"+ "> " + Colors.RESET);
  140.             String input = reader.nextLine();
  141.  
  142.             if (input.equals("hello") || input.equals("HELLO")) {
  143.                 System.out.println("Hello World!");
  144.                 grupinput();
  145.             }
  146.             if (input.equals("help")) {
  147.                 System.out.println(Colors.RED + "Commands:" + Colors.RESET);
  148.                 System.out.println(Colors.RED + "hello - outputs Hello World" + Colors.RESET);
  149.                 System.out.println(Colors.RED + "help - you're already here" + Colors.RESET);
  150.                 System.out.println(Colors.RED + "shutdown - shuts the console down" + Colors.RESET);
  151.                 System.out.println(Colors.RED + "exit - shuts the console down" + Colors.RESET);
  152.                 System.out.println(Colors.RED + "run - runs a program" + Colors.RESET);
  153.                 System.out.println(Colors.RED + "run help - displays all programs you can run" + Colors.RESET);
  154.                 System.out.println(Colors.RED + "back - takes you back to the main menu" + Colors.RESET);
  155.                 System.out.println(Colors.RED + "time - says your current time and date" + Colors.RESET);
  156.                 System.out.println(Colors.RED + "flip - flips a coin" + Colors.RESET);
  157.                 System.out.println(Colors.RED + "whoami - self explanitory" + Colors.RESET);
  158.                 grupinput();
  159.             }
  160.             if (input.equals("shutdown") || input.equals("exit")) {
  161.                 System.exit(0);
  162.             }
  163.             if (input.equals("run help")) {
  164.                 System.out.println(Colors.RED + "Programs:" + Colors.RESET);
  165.                 System.out.println(Colors.RED + "scalculator - shape calculator, defines area, circumference, and similar items" + Colors.RESET);
  166.                 System.out.println(Colors.RED + "calculator - simple calculator" + Colors.RESET);
  167.                 grupinput();
  168.             }
  169.  
  170.             if (input.equals("run calculator")) {
  171.                 grupnormalCalculator();
  172.             }
  173.  
  174.             if (input.equals("run scalculator")) {
  175.                 grupKuebjiiCalculatorMenu();
  176.             }
  177.  
  178.             if (input.equals("back"))
  179.             {
  180.                 grupmainMenu();
  181.             }
  182.  
  183.             if (input.equals("time"))
  184.             {
  185.                 SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
  186.                 Date date = new Date(System.currentTimeMillis());
  187.                 System.out.println(formatter.format(date));
  188.                 grupinput();
  189.             }
  190.             if (input.equals("flip"))
  191.             {
  192.                 if (Math.random() < 0.5){
  193.                     System.out.println("Heads");
  194.                 }else{
  195.                     System.out.println("Tails");
  196.                 }
  197.             }
  198.             if (input.equals("clear"))
  199.             {
  200.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  201.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  202.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  203.                 grupinput();
  204.             }
  205.             if (input.equals("login"))
  206.             {
  207.                 userBase();
  208.             }
  209.             if (input.equals("whoami"))
  210.             {
  211.                 System.out.println("You are logged in with: " + user);
  212.                 grupinput();
  213.             }
  214.             else
  215.             {
  216.                 System.out.println("Command: " + input + " was not found!");
  217.                 grupmainMenu();
  218.             }
  219.         }
  220.  
  221.         public static void GuestmainMenu() {
  222.             Scanner reader = new Scanner(System.in);
  223.             System.out.println(Colors.RED + "Kuebjii's Console" + Colors.RESET);
  224.             System.out.println(Colors.RED + "Please enter your comamand below" + Colors.RESET);
  225.             System.out.println();
  226.             Guestinput();
  227.         }
  228.  
  229.         public static void grupmainMenu() {
  230.             Scanner reader = new Scanner(System.in);
  231.             System.out.println(Colors.RED + "Kuebjii's Console" + Colors.RESET);
  232.             System.out.println(Colors.RED + "Please enter your comamand below" + Colors.RESET);
  233.             System.out.println();
  234.             grupinput();
  235.         }
  236.  
  237.         public static void rootinput() {
  238.             String user = "root";
  239.             Scanner reader = new Scanner(System.in);
  240.             System.out.print(Colors.GREEN + "@" + user + "|"+ "> " + Colors.RESET);
  241.             String input = reader.nextLine();
  242.  
  243.             if (input.equals("hello") || input.equals("HELLO")) {
  244.                 System.out.println("Hello World!");
  245.                 rootinput();
  246.             }
  247.             if (input.equals("help")) {
  248.                 System.out.println(Colors.RED + "Commands:" + Colors.RESET);
  249.                 System.out.println(Colors.RED + "hello - outputs Hello World" + Colors.RESET);
  250.                 System.out.println(Colors.RED + "help - you're already here" + Colors.RESET);
  251.                 System.out.println(Colors.RED + "shutdown - shuts the console down" + Colors.RESET);
  252.                 System.out.println(Colors.RED + "exit - shuts the console down" + Colors.RESET);
  253.                 System.out.println(Colors.RED + "run - runs a program" + Colors.RESET);
  254.                 System.out.println(Colors.RED + "run help - displays all programs you can run" + Colors.RESET);
  255.                 System.out.println(Colors.RED + "back - takes you back to the main menu" + Colors.RESET);
  256.                 System.out.println(Colors.RED + "time - says your current time and date" + Colors.RESET);
  257.                 System.out.println(Colors.RED + "flip - flips a coin" + Colors.RESET);
  258.                 System.out.println(Colors.RED + "whoami - self explanitory" + Colors.RESET);
  259.                 rootinput();
  260.             }
  261.             if (input.equals("shutdown") || input.equals("exit")) {
  262.                 System.exit(0);
  263.             }
  264.             if (input.equals("run help")) {
  265.                 System.out.println(Colors.RED + "Programs:" + Colors.RESET);
  266.                 System.out.println(Colors.RED + "scalculator - shape calculator, defines area, circumference, and similar items" + Colors.RESET);
  267.                 System.out.println(Colors.RED + "calculator - simple calculator" + Colors.RESET);
  268.                 rootinput();
  269.             }
  270.  
  271.             if (input.equals("run calculator")) {
  272.                 rootnormalCalculator();
  273.             }
  274.  
  275.             if (input.equals("run scalculator")) {
  276.                 rootKuebjiiCalculatorMenu();
  277.             }
  278.  
  279.             if (input.equals("back"))
  280.             {
  281.                 rootmainMenu();
  282.             }
  283.  
  284.             if (input.equals("time"))
  285.             {
  286.                 SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
  287.                 Date date = new Date(System.currentTimeMillis());
  288.                 System.out.println(formatter.format(date));
  289.                 rootinput();
  290.             }
  291.             if (input.equals("flip"))
  292.             {
  293.                 if (Math.random() < 0.5){
  294.                     System.out.println("Heads");
  295.                 }else{
  296.                     System.out.println("Tails");
  297.                 }
  298.             }
  299.             if (input.equals("clear"))
  300.             {
  301.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  302.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  303.                 System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();System.out.println();
  304.                 rootinput();
  305.             }
  306.             if (input.equals("login"))
  307.             {
  308.                 userBase();
  309.             }
  310.             if (input.equals("whoami"))
  311.             {
  312.                 System.out.println("You are logged in with: " + user);
  313.                 rootinput();
  314.             }
  315.             else
  316.             {
  317.                 System.out.println("Command: " + input + " was not found!");
  318.                 rootmainMenu();
  319.             }
  320.         }
  321.  
  322.         public static void rootmainMenu() {
  323.             Scanner reader = new Scanner(System.in);
  324.             System.out.println(Colors.RED + "Kuebjii's Console" + Colors.RESET);
  325.             System.out.println(Colors.RED + "Please enter your comamand below" + Colors.RESET);
  326.             System.out.println();
  327.             rootinput();
  328.         }
  329.  
  330.  
  331.         public static void main(String[] args) throws InterruptedException {
  332.             Scanner reader = new Scanner(System.in);
  333.             System.out.print(Colors.GREEN + "> " + Colors.RESET);
  334.             String input = reader.findInLine("start");
  335.  
  336.             if (input.equals("start")) {
  337.                 System.out.println(Colors.GREEN + "Booting Console" + Colors.RESET);
  338.                 Thread.sleep(500);
  339.                 System.out.println(Colors.GREEN + "Console Loaded" + Colors.RESET);
  340.                 Thread.sleep(500);
  341.                 System.out.println(Colors.GREEN + "Showing Console Now!" + Colors.RESET);
  342.                 Thread.sleep(50);
  343.                 userBase();
  344.  
  345.             } else {
  346.                 System.out.println("System.Start Error: Entered unknown command");
  347.             }
  348.         }
  349.  
  350.  
  351.         public static void userBase ()
  352.         {
  353.             Scanner reader = new Scanner(System.in);
  354.             Users Grup = new Users("grup" , 3);
  355.             Users Root = new Users("root" , -1);
  356.             Users Guest = new Users("guest", 1);
  357.  
  358.             System.out.println("List of users:");
  359.             System.out.println("Name: " + Grup.UserSummary());
  360.             System.out.println("Name: " + Root.UserSummary());
  361.             System.out.println("Name: " + Guest.UserSummary());
  362.  
  363.             System.out.println("Which user would you like to login to?");
  364.             String loginUser = reader.nextLine();
  365.  
  366.             if (loginUser.equals("grup"))
  367.             {
  368.                 System.out.println(Colors.CYAN + "That user is password protected");
  369.                 System.out.println(Colors.CYAN + "Please enter the password" + Colors.RESET);
  370.                 String password = reader.nextLine();
  371.  
  372.                 if (password.equals("password"))
  373.                 {
  374.                     grupmainMenu();
  375.                 }
  376.                 else {
  377.                     System.out.println(Colors.RED + "That is incorrect, try again later" + Colors.RESET);
  378.                     userBase();
  379.                 }
  380.             }
  381.             if (loginUser.equals("root"))
  382.             {
  383.                 System.out.println(Colors.CYAN + "That user is password protected");
  384.                 System.out.println(Colors.CYAN + "Please enter the password" + Colors.RESET);
  385.                 String password = reader.nextLine();
  386.  
  387.                 if (password.equals("toor"))
  388.                 {
  389.                     rootmainMenu();
  390.                 }
  391.                 else {
  392.                     System.out.println(Colors.RED + "That is incorrect, try again later" + Colors.RESET);
  393.                     userBase();
  394.                 }
  395.             }
  396.             if (loginUser.equals("guest"))
  397.             {
  398.                 System.out.println(Colors.CYAN + "You have logged in with " + loginUser);
  399.                 GuestmainMenu();
  400.             }
  401.             else {
  402.                 System.out.println(Colors.RED + "That user does not exist!");
  403.                 userBase();
  404.             }
  405.  
  406.  
  407.         }
  408.  
  409.         /// ######################################################################## SHAPE CALCULATOR ######## DO NOT TOUCH ########################################################
  410.         public static void grupKuebjiiCalculatorMenu() {
  411.             Scanner reader = new Scanner(System.in);
  412.             System.out.println("Welcome to Kuebjii's Calculator");
  413.             System.out.println("Circle");
  414.             System.out.println("Square");
  415.             System.out.println("Rectangle");
  416.             System.out.println("Please type out the number you would like to use");
  417.             String input = reader.nextLine();
  418.             if (input.equals("circle")) {
  419.                 grupcircles();
  420.             }
  421.             if (input.equals("square")) {
  422.                 grupsquares();
  423.             }
  424.             if (input.equals("rectangle")) {
  425.                 gruprectangle();
  426.             }
  427.             if (input.equals("devmode")) {
  428.                 grupdevMode();
  429.             }
  430.             if (input.equals("back")) {
  431.                 grupmainMenu();
  432.             }
  433.         }
  434.  
  435.         public static void gruprectangle() {
  436.             Scanner reader = new Scanner(System.in);
  437.             System.out.println("Please enter the length of the rectangle");
  438.             double length = reader.nextDouble();
  439.             System.out.println("Please enter the width of the rectangle");
  440.             double width = reader.nextDouble();
  441.  
  442.             double perimeter = 2 * (length * width);
  443.             double area = length * width;
  444.  
  445.             System.out.println("Here is the perimeter of the rectangle: " + perimeter);
  446.             System.out.println("Here is the area of the rectangle: " + area);
  447.             System.out.println();
  448.             KuebjiiCalculatorMenu();
  449.  
  450.         }
  451.  
  452.         public static void grupsquares() {
  453.             Scanner reader = new Scanner(System.in);
  454.             System.out.println("Please enter one side of the square");
  455.             double side = reader.nextDouble();
  456.             double perimeter;
  457.             double area;
  458.  
  459.             perimeter = side + side + side + side;
  460.             area = side * side;
  461.  
  462.             System.out.println("Here is the perimeter of the square: " + perimeter);
  463.             System.out.println("Here is the area of the square: " + area);
  464.             System.out.println();
  465.             KuebjiiCalculatorMenu();
  466.  
  467.         }
  468.  
  469.         public static void grupcircles() {
  470.             System.out.println("What is the radius of the circle?");
  471.             Scanner reader = new Scanner(System.in);
  472.             double radius = reader.nextDouble();
  473.             double circumference;
  474.             double area;
  475.             circumference = 2 * 3.14 * radius;
  476.             area = 3.14 * radius * radius;
  477.             System.out.println("Here is the circumference of the circle" + circumference);
  478.             System.out.println("Here is the area of the circle" + area);
  479.             System.out.println();
  480.             KuebjiiCalculatorMenu();
  481.         }
  482.  
  483.         public static void grupdevMode() {
  484.             Scanner reader = new Scanner(System.in);
  485.             System.out.println("D E V   C O N S O L E");
  486.             System.out.println("1. Circle");
  487.             System.out.println("2. Square");
  488.             System.out.println("3. Rectangle");
  489.             System.out.println("4. Testing Cycle");
  490.             int selector = reader.nextInt();
  491.             if (selector == 1) {
  492.                 System.out.println("What is the radius of the circle?");
  493.                 double radius = reader.nextDouble();
  494.                 double circumference;
  495.                 double area;
  496.                 circumference = 2 * 3.14 * radius;
  497.                 area = 3.14 * radius * radius;
  498.                 System.out.println("Radius = " + radius + " Equation for circumference: 2 * 3.14 * " + radius);
  499.                 System.out.println("Radius = " + radius + " Equation for area: 3.14 * " + radius + " * " + radius);
  500.                 System.out.println("Here is the circumference of the circle: " + circumference);
  501.                 System.out.println("Here is the area of the circle: " + area);
  502.             }
  503.         }
  504.  
  505.         public static void grupnormalCalculator() {
  506.             Scanner reader = new Scanner(System.in);
  507.  
  508.             System.out.println(Colors.RED + "Welcome to the normal calculator" + Colors.RESET);
  509.             System.out.println(Colors.RED + "Type any equation into the line below" + Colors.RESET);
  510.             System.out.println(Colors.BLUE + "Do you want to add, subtract, mutliply, or divide");
  511.  
  512.             System.out.print(Colors.GREEN + "> " + Colors.RESET);
  513.             String input = reader.nextLine();
  514.  
  515.             if (input.equals("add")) {
  516.                 System.out.println(Colors.BLUE + "Now type the first number you want to add");
  517.                 double input1 = reader.nextDouble();
  518.  
  519.                 System.out.println(Colors.BLUE + "Now type the second number you wan to add");
  520.                 double input2 = reader.nextDouble();
  521.  
  522.                 double inputTotal = input1 + input2;
  523.  
  524.                 System.out.println("Your number is: " + inputTotal);
  525.                 grupnormalCalculator();
  526.             }
  527.             if (input.equals("subtract")) {
  528.                 System.out.println(Colors.BLUE + "Now type the first number you want to subtract");
  529.                 double input1 = reader.nextDouble();
  530.  
  531.                 System.out.println(Colors.BLUE + "Now type the second number you wan to subtract");
  532.                 double input2 = reader.nextDouble();
  533.  
  534.                 double inputTotal = input1 - input2;
  535.  
  536.                 System.out.println("Your number is: " + inputTotal);
  537.                 grupnormalCalculator();
  538.             }
  539.             if (input.equals("multiply")) {
  540.                 System.out.println(Colors.BLUE + "Now type the first number you want to multiply");
  541.                 double input1 = reader.nextDouble();
  542.  
  543.                 System.out.println(Colors.BLUE + "Now type the second number you wan to multiply");
  544.                 double input2 = reader.nextDouble();
  545.  
  546.                 double inputTotal = input1 * input2;
  547.  
  548.                 System.out.println("Your number is: " + inputTotal);
  549.                 grupnormalCalculator();
  550.             }
  551.             if (input.equals("divide")) {
  552.                 System.out.println(Colors.BLUE + "Now type the first number you want to divide");
  553.                 double input1 = reader.nextDouble();
  554.  
  555.                 System.out.println(Colors.BLUE + "Now type the second number you wan to divide");
  556.                 double input2 = reader.nextDouble();
  557.  
  558.                 double inputTotal = input1 / input2;
  559.  
  560.                 System.out.println("Your number is: " + inputTotal);
  561.                 grupnormalCalculator();
  562.             }
  563.         }
  564.         public static void KuebjiiCalculatorMenu() {
  565.             Scanner reader = new Scanner(System.in);
  566.             System.out.println("Welcome to Kuebjii's Calculator");
  567.             System.out.println("Circle");
  568.             System.out.println("Square");
  569.             System.out.println("Rectangle");
  570.             System.out.println("Please type out the number you would like to use");
  571.             String input = reader.nextLine();
  572.             if (input.equals("circle")) {
  573.                 circles();
  574.             }
  575.             if (input.equals("square")) {
  576.                 squares();
  577.             }
  578.             if (input.equals("rectangle")) {
  579.                 rectangle();
  580.             }
  581.             if (input.equals("devmode")) {
  582.                 devMode();
  583.             }
  584.             if (input.equals("back")) {
  585.                 GuestmainMenu();
  586.             }
  587.         }
  588.  
  589.         public static void rectangle() {
  590.             Scanner reader = new Scanner(System.in);
  591.             System.out.println("Please enter the length of the rectangle");
  592.             double length = reader.nextDouble();
  593.             System.out.println("Please enter the width of the rectangle");
  594.             double width = reader.nextDouble();
  595.  
  596.             double perimeter = 2 * (length * width);
  597.             double area = length * width;
  598.  
  599.             System.out.println("Here is the perimeter of the rectangle: " + perimeter);
  600.             System.out.println("Here is the area of the rectangle: " + area);
  601.             System.out.println();
  602.             KuebjiiCalculatorMenu();
  603.  
  604.         }
  605.  
  606.         public static void squares() {
  607.             Scanner reader = new Scanner(System.in);
  608.             System.out.println("Please enter one side of the square");
  609.             double side = reader.nextDouble();
  610.             double perimeter;
  611.             double area;
  612.  
  613.             perimeter = side + side + side + side;
  614.             area = side * side;
  615.  
  616.             System.out.println("Here is the perimeter of the square: " + perimeter);
  617.             System.out.println("Here is the area of the square: " + area);
  618.             System.out.println();
  619.             KuebjiiCalculatorMenu();
  620.  
  621.         }
  622.  
  623.         public static void circles() {
  624.             System.out.println("What is the radius of the circle?");
  625.             Scanner reader = new Scanner(System.in);
  626.             double radius = reader.nextDouble();
  627.             double circumference;
  628.             double area;
  629.             circumference = 2 * 3.14 * radius;
  630.             area = 3.14 * radius * radius;
  631.             System.out.println("Here is the circumference of the circle" + circumference);
  632.             System.out.println("Here is the area of the circle" + area);
  633.             System.out.println();
  634.             KuebjiiCalculatorMenu();
  635.         }
  636.  
  637.         public static void devMode() {
  638.             Scanner reader = new Scanner(System.in);
  639.             System.out.println("D E V   C O N S O L E");
  640.             System.out.println("1. Circle");
  641.             System.out.println("2. Square");
  642.             System.out.println("3. Rectangle");
  643.             System.out.println("4. Testing Cycle");
  644.             int selector = reader.nextInt();
  645.             if (selector == 1) {
  646.                 System.out.println("What is the radius of the circle?");
  647.                 double radius = reader.nextDouble();
  648.                 double circumference;
  649.                 double area;
  650.                 circumference = 2 * 3.14 * radius;
  651.                 area = 3.14 * radius * radius;
  652.                 System.out.println("Radius = " + radius + " Equation for circumference: 2 * 3.14 * " + radius);
  653.                 System.out.println("Radius = " + radius + " Equation for area: 3.14 * " + radius + " * " + radius);
  654.                 System.out.println("Here is the circumference of the circle: " + circumference);
  655.                 System.out.println("Here is the area of the circle: " + area);
  656.             }
  657.         }
  658.  
  659.         public static void normalCalculator() {
  660.             Scanner reader = new Scanner(System.in);
  661.  
  662.             System.out.println(Colors.RED + "Welcome to the normal calculator" + Colors.RESET);
  663.             System.out.println(Colors.RED + "Type any equation into the line below" + Colors.RESET);
  664.             System.out.println(Colors.BLUE + "Do you want to add, subtract, mutliply, or divide");
  665.  
  666.             System.out.print(Colors.GREEN + "> " + Colors.RESET);
  667.             String input = reader.nextLine();
  668.  
  669.             if (input.equals("add")) {
  670.                 System.out.println(Colors.BLUE + "Now type the first number you want to add");
  671.                 double input1 = reader.nextDouble();
  672.  
  673.                 System.out.println(Colors.BLUE + "Now type the second number you wan to add");
  674.                 double input2 = reader.nextDouble();
  675.  
  676.                 double inputTotal = input1 + input2;
  677.  
  678.                 System.out.println("Your number is: " + inputTotal);
  679.                 normalCalculator();
  680.             }
  681.             if (input.equals("subtract")) {
  682.                 System.out.println(Colors.BLUE + "Now type the first number you want to subtract");
  683.                 double input1 = reader.nextDouble();
  684.  
  685.                 System.out.println(Colors.BLUE + "Now type the second number you wan to subtract");
  686.                 double input2 = reader.nextDouble();
  687.  
  688.                 double inputTotal = input1 - input2;
  689.  
  690.                 System.out.println("Your number is: " + inputTotal);
  691.                 normalCalculator();
  692.             }
  693.             if (input.equals("multiply")) {
  694.                 System.out.println(Colors.BLUE + "Now type the first number you want to multiply");
  695.                 double input1 = reader.nextDouble();
  696.  
  697.                 System.out.println(Colors.BLUE + "Now type the second number you wan to multiply");
  698.                 double input2 = reader.nextDouble();
  699.  
  700.                 double inputTotal = input1 * input2;
  701.  
  702.                 System.out.println("Your number is: " + inputTotal);
  703.                 normalCalculator();
  704.             }
  705.             if (input.equals("divide")) {
  706.                 System.out.println(Colors.BLUE + "Now type the first number you want to divide");
  707.                 double input1 = reader.nextDouble();
  708.  
  709.                 System.out.println(Colors.BLUE + "Now type the second number you wan to divide");
  710.                 double input2 = reader.nextDouble();
  711.  
  712.                 double inputTotal = input1 / input2;
  713.  
  714.                 System.out.println("Your number is: " + inputTotal);
  715.                 normalCalculator();
  716.             }
  717.         }
  718.         public static void rootKuebjiiCalculatorMenu() {
  719.             Scanner reader = new Scanner(System.in);
  720.             System.out.println("Welcome to Kuebjii's Calculator");
  721.             System.out.println("Circle");
  722.             System.out.println("Square");
  723.             System.out.println("Rectangle");
  724.             System.out.println("Please type out the number you would like to use");
  725.             String input = reader.nextLine();
  726.             if (input.equals("circle")) {
  727.                 rootcircles();
  728.             }
  729.             if (input.equals("square")) {
  730.                 rootsquares();
  731.             }
  732.             if (input.equals("rectangle")) {
  733.                 rootrectangle();
  734.             }
  735.             if (input.equals("devmode")) {
  736.                 rootdevMode();
  737.             }
  738.             if (input.equals("back")) {
  739.                 rootmainMenu();
  740.             }
  741.         }
  742.  
  743.         public static void rootrectangle() {
  744.             Scanner reader = new Scanner(System.in);
  745.             System.out.println("Please enter the length of the rectangle");
  746.             double length = reader.nextDouble();
  747.             System.out.println("Please enter the width of the rectangle");
  748.             double width = reader.nextDouble();
  749.  
  750.             double perimeter = 2 * (length * width);
  751.             double area = length * width;
  752.  
  753.             System.out.println("Here is the perimeter of the rectangle: " + perimeter);
  754.             System.out.println("Here is the area of the rectangle: " + area);
  755.             System.out.println();
  756.             rootKuebjiiCalculatorMenu();
  757.  
  758.         }
  759.  
  760.         public static void rootsquares() {
  761.             Scanner reader = new Scanner(System.in);
  762.             System.out.println("Please enter one side of the square");
  763.             double side = reader.nextDouble();
  764.             double perimeter;
  765.             double area;
  766.  
  767.             perimeter = side + side + side + side;
  768.             area = side * side;
  769.  
  770.             System.out.println("Here is the perimeter of the square: " + perimeter);
  771.             System.out.println("Here is the area of the square: " + area);
  772.             System.out.println();
  773.             rootKuebjiiCalculatorMenu();
  774.  
  775.         }
  776.  
  777.         public static void rootcircles() {
  778.             System.out.println("What is the radius of the circle?");
  779.             Scanner reader = new Scanner(System.in);
  780.             double radius = reader.nextDouble();
  781.             double circumference;
  782.             double area;
  783.             circumference = 2 * 3.14 * radius;
  784.             area = 3.14 * radius * radius;
  785.             System.out.println("Here is the circumference of the circle" + circumference);
  786.             System.out.println("Here is the area of the circle" + area);
  787.             System.out.println();
  788.             rootKuebjiiCalculatorMenu();
  789.         }
  790.  
  791.         public static void rootdevMode() {
  792.             Scanner reader = new Scanner(System.in);
  793.             System.out.println("D E V   C O N S O L E");
  794.             System.out.println("1. Circle");
  795.             System.out.println("2. Square");
  796.             System.out.println("3. Rectangle");
  797.             System.out.println("4. Testing Cycle");
  798.             int selector = reader.nextInt();
  799.             if (selector == 1) {
  800.                 System.out.println("What is the radius of the circle?");
  801.                 double radius = reader.nextDouble();
  802.                 double circumference;
  803.                 double area;
  804.                 circumference = 2 * 3.14 * radius;
  805.                 area = 3.14 * radius * radius;
  806.                 System.out.println("Radius = " + radius + " Equation for circumference: 2 * 3.14 * " + radius);
  807.                 System.out.println("Radius = " + radius + " Equation for area: 3.14 * " + radius + " * " + radius);
  808.                 System.out.println("Here is the circumference of the circle: " + circumference);
  809.                 System.out.println("Here is the area of the circle: " + area);
  810.             }
  811.         }
  812.  
  813.         public static void rootnormalCalculator() {
  814.             Scanner reader = new Scanner(System.in);
  815.  
  816.             System.out.println(Colors.RED + "Welcome to the normal calculator" + Colors.RESET);
  817.             System.out.println(Colors.RED + "Type any equation into the line below" + Colors.RESET);
  818.             System.out.println(Colors.BLUE + "Do you want to add, subtract, mutliply, or divide");
  819.  
  820.             System.out.print(Colors.GREEN + "> " + Colors.RESET);
  821.             String input = reader.nextLine();
  822.  
  823.             if (input.equals("add")) {
  824.                 System.out.println(Colors.BLUE + "Now type the first number you want to add");
  825.                 double input1 = reader.nextDouble();
  826.  
  827.                 System.out.println(Colors.BLUE + "Now type the second number you wan to add");
  828.                 double input2 = reader.nextDouble();
  829.  
  830.                 double inputTotal = input1 + input2;
  831.  
  832.                 System.out.println("Your number is: " + inputTotal);
  833.                 rootnormalCalculator();
  834.             }
  835.             if (input.equals("subtract")) {
  836.                 System.out.println(Colors.BLUE + "Now type the first number you want to subtract");
  837.                 double input1 = reader.nextDouble();
  838.  
  839.                 System.out.println(Colors.BLUE + "Now type the second number you wan to subtract");
  840.                 double input2 = reader.nextDouble();
  841.  
  842.                 double inputTotal = input1 - input2;
  843.  
  844.                 System.out.println("Your number is: " + inputTotal);
  845.                 rootnormalCalculator();
  846.             }
  847.             if (input.equals("multiply")) {
  848.                 System.out.println(Colors.BLUE + "Now type the first number you want to multiply");
  849.                 double input1 = reader.nextDouble();
  850.  
  851.                 System.out.println(Colors.BLUE + "Now type the second number you wan to multiply");
  852.                 double input2 = reader.nextDouble();
  853.  
  854.                 double inputTotal = input1 * input2;
  855.  
  856.                 System.out.println("Your number is: " + inputTotal);
  857.                 rootnormalCalculator();
  858.             }
  859.             if (input.equals("divide")) {
  860.                 System.out.println(Colors.BLUE + "Now type the first number you want to divide");
  861.                 double input1 = reader.nextDouble();
  862.  
  863.                 System.out.println(Colors.BLUE + "Now type the second number you wan to divide");
  864.                 double input2 = reader.nextDouble();
  865.  
  866.                 double inputTotal = input1 / input2;
  867.  
  868.                 System.out.println("Your number is: " + inputTotal);
  869.                 rootnormalCalculator();
  870.             }
  871.         }
  872.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement