Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javafx.scene.paint.Stop;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.Scanner;
- import java.util.Random;
- import java.util.concurrent.TimeUnit;
- import java.awt.Graphics;
- class Colors {
- public static final String RESET = "\u001B[0m";
- public static final String BLACK = "\u001B[30m";
- public static final String RED = "\u001B[31m";
- public static final String GREEN = "\u001B[32m";
- public static final String YELLOW = "\u001B[33m";
- public static final String BLUE = "\u001B[34m";
- public static final String PURPLE = "\u001B[35m";
- public static final String CYAN = "\u001B[36m";
- public static final String WHITE = "\u001B[37m";
- }
- class Users {
- String Name;
- double powerLevel;
- boolean passwordProtected;
- public Users(String Name, int powerLevel)
- {
- this.Name = Name;
- this.powerLevel = powerLevel;
- }
- public String getName()
- {
- return Name;
- }
- public double getLevel()
- {
- return powerLevel;
- }
- public String UserSummary()
- {
- return("Username: " + this.getName() + " | " + " Level: " + this.powerLevel);
- }
- }
- public class Main {
- public static void Guestinput() {
- String user = "Guest";
- Scanner reader = new Scanner(System.in);
- System.out.print(Colors.GREEN + "@" + user + "|"+ "> " + Colors.RESET);
- String input = reader.nextLine();
- if (input.equals("hello") || input.equals("HELLO")) {
- System.out.println("Hello World!");
- Guestinput();
- }
- if (input.equals("help")) {
- System.out.println(Colors.RED + "Commands:" + Colors.RESET);
- System.out.println(Colors.RED + "hello - outputs Hello World" + Colors.RESET);
- System.out.println(Colors.RED + "help - you're already here" + Colors.RESET);
- System.out.println(Colors.RED + "shutdown - shuts the console down" + Colors.RESET);
- System.out.println(Colors.RED + "exit - shuts the console down" + Colors.RESET);
- System.out.println(Colors.RED + "run - runs a program" + Colors.RESET);
- System.out.println(Colors.RED + "run help - displays all programs you can run" + Colors.RESET);
- System.out.println(Colors.RED + "back - takes you back to the main menu" + Colors.RESET);
- System.out.println(Colors.RED + "time - says your current time and date" + Colors.RESET);
- System.out.println(Colors.RED + "flip - flips a coin" + Colors.RESET);
- System.out.println(Colors.RED + "whoami - self explanitory" + Colors.RESET);
- Guestinput();
- }
- if (input.equals("shutdown") || input.equals("exit")) {
- System.exit(0);
- }
- if (input.equals("run help")) {
- System.out.println(Colors.RED + "Programs:" + Colors.RESET);
- System.out.println(Colors.RED + "scalculator - shape calculator, defines area, circumference, and similar items" + Colors.RESET);
- System.out.println(Colors.RED + "calculator - simple calculator" + Colors.RESET);
- Guestinput();
- }
- if (input.equals("run calculator")) {
- normalCalculator();
- }
- if (input.equals("run scalculator")) {
- KuebjiiCalculatorMenu();
- }
- if (input.equals("back"))
- {
- GuestmainMenu();
- }
- if (input.equals("time"))
- {
- SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
- Date date = new Date(System.currentTimeMillis());
- System.out.println(formatter.format(date));
- Guestinput();
- }
- if (input.equals("flip"))
- {
- if (Math.random() < 0.5){
- System.out.println("Heads");
- }else{
- System.out.println("Tails");
- }
- }
- if (input.equals("clear"))
- {
- 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();
- 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();
- 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();
- Guestinput();
- }
- if (input.equals("login"))
- {
- userBase();
- }
- if (input.equals("whoami"))
- {
- System.out.println("You are logged in with: " + user);
- Guestinput();
- }
- else
- {
- System.out.println("Command: " + input + " was not found!");
- GuestmainMenu();
- }
- }
- public static void grupinput() {
- String user = "grup";
- Scanner reader = new Scanner(System.in);
- System.out.print(Colors.GREEN + "@" + user + "|"+ "> " + Colors.RESET);
- String input = reader.nextLine();
- if (input.equals("hello") || input.equals("HELLO")) {
- System.out.println("Hello World!");
- grupinput();
- }
- if (input.equals("help")) {
- System.out.println(Colors.RED + "Commands:" + Colors.RESET);
- System.out.println(Colors.RED + "hello - outputs Hello World" + Colors.RESET);
- System.out.println(Colors.RED + "help - you're already here" + Colors.RESET);
- System.out.println(Colors.RED + "shutdown - shuts the console down" + Colors.RESET);
- System.out.println(Colors.RED + "exit - shuts the console down" + Colors.RESET);
- System.out.println(Colors.RED + "run - runs a program" + Colors.RESET);
- System.out.println(Colors.RED + "run help - displays all programs you can run" + Colors.RESET);
- System.out.println(Colors.RED + "back - takes you back to the main menu" + Colors.RESET);
- System.out.println(Colors.RED + "time - says your current time and date" + Colors.RESET);
- System.out.println(Colors.RED + "flip - flips a coin" + Colors.RESET);
- System.out.println(Colors.RED + "whoami - self explanitory" + Colors.RESET);
- grupinput();
- }
- if (input.equals("shutdown") || input.equals("exit")) {
- System.exit(0);
- }
- if (input.equals("run help")) {
- System.out.println(Colors.RED + "Programs:" + Colors.RESET);
- System.out.println(Colors.RED + "scalculator - shape calculator, defines area, circumference, and similar items" + Colors.RESET);
- System.out.println(Colors.RED + "calculator - simple calculator" + Colors.RESET);
- grupinput();
- }
- if (input.equals("run calculator")) {
- grupnormalCalculator();
- }
- if (input.equals("run scalculator")) {
- grupKuebjiiCalculatorMenu();
- }
- if (input.equals("back"))
- {
- grupmainMenu();
- }
- if (input.equals("time"))
- {
- SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
- Date date = new Date(System.currentTimeMillis());
- System.out.println(formatter.format(date));
- grupinput();
- }
- if (input.equals("flip"))
- {
- if (Math.random() < 0.5){
- System.out.println("Heads");
- }else{
- System.out.println("Tails");
- }
- }
- if (input.equals("clear"))
- {
- 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();
- 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();
- 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();
- grupinput();
- }
- if (input.equals("login"))
- {
- userBase();
- }
- if (input.equals("whoami"))
- {
- System.out.println("You are logged in with: " + user);
- grupinput();
- }
- else
- {
- System.out.println("Command: " + input + " was not found!");
- grupmainMenu();
- }
- }
- public static void GuestmainMenu() {
- Scanner reader = new Scanner(System.in);
- System.out.println(Colors.RED + "Kuebjii's Console" + Colors.RESET);
- System.out.println(Colors.RED + "Please enter your comamand below" + Colors.RESET);
- System.out.println();
- Guestinput();
- }
- public static void grupmainMenu() {
- Scanner reader = new Scanner(System.in);
- System.out.println(Colors.RED + "Kuebjii's Console" + Colors.RESET);
- System.out.println(Colors.RED + "Please enter your comamand below" + Colors.RESET);
- System.out.println();
- grupinput();
- }
- public static void rootinput() {
- String user = "root";
- Scanner reader = new Scanner(System.in);
- System.out.print(Colors.GREEN + "@" + user + "|"+ "> " + Colors.RESET);
- String input = reader.nextLine();
- if (input.equals("hello") || input.equals("HELLO")) {
- System.out.println("Hello World!");
- rootinput();
- }
- if (input.equals("help")) {
- System.out.println(Colors.RED + "Commands:" + Colors.RESET);
- System.out.println(Colors.RED + "hello - outputs Hello World" + Colors.RESET);
- System.out.println(Colors.RED + "help - you're already here" + Colors.RESET);
- System.out.println(Colors.RED + "shutdown - shuts the console down" + Colors.RESET);
- System.out.println(Colors.RED + "exit - shuts the console down" + Colors.RESET);
- System.out.println(Colors.RED + "run - runs a program" + Colors.RESET);
- System.out.println(Colors.RED + "run help - displays all programs you can run" + Colors.RESET);
- System.out.println(Colors.RED + "back - takes you back to the main menu" + Colors.RESET);
- System.out.println(Colors.RED + "time - says your current time and date" + Colors.RESET);
- System.out.println(Colors.RED + "flip - flips a coin" + Colors.RESET);
- System.out.println(Colors.RED + "whoami - self explanitory" + Colors.RESET);
- rootinput();
- }
- if (input.equals("shutdown") || input.equals("exit")) {
- System.exit(0);
- }
- if (input.equals("run help")) {
- System.out.println(Colors.RED + "Programs:" + Colors.RESET);
- System.out.println(Colors.RED + "scalculator - shape calculator, defines area, circumference, and similar items" + Colors.RESET);
- System.out.println(Colors.RED + "calculator - simple calculator" + Colors.RESET);
- rootinput();
- }
- if (input.equals("run calculator")) {
- rootnormalCalculator();
- }
- if (input.equals("run scalculator")) {
- rootKuebjiiCalculatorMenu();
- }
- if (input.equals("back"))
- {
- rootmainMenu();
- }
- if (input.equals("time"))
- {
- SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
- Date date = new Date(System.currentTimeMillis());
- System.out.println(formatter.format(date));
- rootinput();
- }
- if (input.equals("flip"))
- {
- if (Math.random() < 0.5){
- System.out.println("Heads");
- }else{
- System.out.println("Tails");
- }
- }
- if (input.equals("clear"))
- {
- 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();
- 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();
- 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();
- rootinput();
- }
- if (input.equals("login"))
- {
- userBase();
- }
- if (input.equals("whoami"))
- {
- System.out.println("You are logged in with: " + user);
- rootinput();
- }
- else
- {
- System.out.println("Command: " + input + " was not found!");
- rootmainMenu();
- }
- }
- public static void rootmainMenu() {
- Scanner reader = new Scanner(System.in);
- System.out.println(Colors.RED + "Kuebjii's Console" + Colors.RESET);
- System.out.println(Colors.RED + "Please enter your comamand below" + Colors.RESET);
- System.out.println();
- rootinput();
- }
- public static void main(String[] args) throws InterruptedException {
- Scanner reader = new Scanner(System.in);
- System.out.print(Colors.GREEN + "> " + Colors.RESET);
- String input = reader.findInLine("start");
- if (input.equals("start")) {
- System.out.println(Colors.GREEN + "Booting Console" + Colors.RESET);
- Thread.sleep(500);
- System.out.println(Colors.GREEN + "Console Loaded" + Colors.RESET);
- Thread.sleep(500);
- System.out.println(Colors.GREEN + "Showing Console Now!" + Colors.RESET);
- Thread.sleep(50);
- userBase();
- } else {
- System.out.println("System.Start Error: Entered unknown command");
- }
- }
- public static void userBase ()
- {
- Scanner reader = new Scanner(System.in);
- Users Grup = new Users("grup" , 3);
- Users Root = new Users("root" , -1);
- Users Guest = new Users("guest", 1);
- System.out.println("List of users:");
- System.out.println("Name: " + Grup.UserSummary());
- System.out.println("Name: " + Root.UserSummary());
- System.out.println("Name: " + Guest.UserSummary());
- System.out.println("Which user would you like to login to?");
- String loginUser = reader.nextLine();
- if (loginUser.equals("grup"))
- {
- System.out.println(Colors.CYAN + "That user is password protected");
- System.out.println(Colors.CYAN + "Please enter the password" + Colors.RESET);
- String password = reader.nextLine();
- if (password.equals("password"))
- {
- grupmainMenu();
- }
- else {
- System.out.println(Colors.RED + "That is incorrect, try again later" + Colors.RESET);
- userBase();
- }
- }
- if (loginUser.equals("root"))
- {
- System.out.println(Colors.CYAN + "That user is password protected");
- System.out.println(Colors.CYAN + "Please enter the password" + Colors.RESET);
- String password = reader.nextLine();
- if (password.equals("toor"))
- {
- rootmainMenu();
- }
- else {
- System.out.println(Colors.RED + "That is incorrect, try again later" + Colors.RESET);
- userBase();
- }
- }
- if (loginUser.equals("guest"))
- {
- System.out.println(Colors.CYAN + "You have logged in with " + loginUser);
- GuestmainMenu();
- }
- else {
- System.out.println(Colors.RED + "That user does not exist!");
- userBase();
- }
- }
- /// ######################################################################## SHAPE CALCULATOR ######## DO NOT TOUCH ########################################################
- public static void grupKuebjiiCalculatorMenu() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Welcome to Kuebjii's Calculator");
- System.out.println("Circle");
- System.out.println("Square");
- System.out.println("Rectangle");
- System.out.println("Please type out the number you would like to use");
- String input = reader.nextLine();
- if (input.equals("circle")) {
- grupcircles();
- }
- if (input.equals("square")) {
- grupsquares();
- }
- if (input.equals("rectangle")) {
- gruprectangle();
- }
- if (input.equals("devmode")) {
- grupdevMode();
- }
- if (input.equals("back")) {
- grupmainMenu();
- }
- }
- public static void gruprectangle() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Please enter the length of the rectangle");
- double length = reader.nextDouble();
- System.out.println("Please enter the width of the rectangle");
- double width = reader.nextDouble();
- double perimeter = 2 * (length * width);
- double area = length * width;
- System.out.println("Here is the perimeter of the rectangle: " + perimeter);
- System.out.println("Here is the area of the rectangle: " + area);
- System.out.println();
- KuebjiiCalculatorMenu();
- }
- public static void grupsquares() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Please enter one side of the square");
- double side = reader.nextDouble();
- double perimeter;
- double area;
- perimeter = side + side + side + side;
- area = side * side;
- System.out.println("Here is the perimeter of the square: " + perimeter);
- System.out.println("Here is the area of the square: " + area);
- System.out.println();
- KuebjiiCalculatorMenu();
- }
- public static void grupcircles() {
- System.out.println("What is the radius of the circle?");
- Scanner reader = new Scanner(System.in);
- double radius = reader.nextDouble();
- double circumference;
- double area;
- circumference = 2 * 3.14 * radius;
- area = 3.14 * radius * radius;
- System.out.println("Here is the circumference of the circle" + circumference);
- System.out.println("Here is the area of the circle" + area);
- System.out.println();
- KuebjiiCalculatorMenu();
- }
- public static void grupdevMode() {
- Scanner reader = new Scanner(System.in);
- System.out.println("D E V C O N S O L E");
- System.out.println("1. Circle");
- System.out.println("2. Square");
- System.out.println("3. Rectangle");
- System.out.println("4. Testing Cycle");
- int selector = reader.nextInt();
- if (selector == 1) {
- System.out.println("What is the radius of the circle?");
- double radius = reader.nextDouble();
- double circumference;
- double area;
- circumference = 2 * 3.14 * radius;
- area = 3.14 * radius * radius;
- System.out.println("Radius = " + radius + " Equation for circumference: 2 * 3.14 * " + radius);
- System.out.println("Radius = " + radius + " Equation for area: 3.14 * " + radius + " * " + radius);
- System.out.println("Here is the circumference of the circle: " + circumference);
- System.out.println("Here is the area of the circle: " + area);
- }
- }
- public static void grupnormalCalculator() {
- Scanner reader = new Scanner(System.in);
- System.out.println(Colors.RED + "Welcome to the normal calculator" + Colors.RESET);
- System.out.println(Colors.RED + "Type any equation into the line below" + Colors.RESET);
- System.out.println(Colors.BLUE + "Do you want to add, subtract, mutliply, or divide");
- System.out.print(Colors.GREEN + "> " + Colors.RESET);
- String input = reader.nextLine();
- if (input.equals("add")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to add");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to add");
- double input2 = reader.nextDouble();
- double inputTotal = input1 + input2;
- System.out.println("Your number is: " + inputTotal);
- grupnormalCalculator();
- }
- if (input.equals("subtract")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to subtract");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to subtract");
- double input2 = reader.nextDouble();
- double inputTotal = input1 - input2;
- System.out.println("Your number is: " + inputTotal);
- grupnormalCalculator();
- }
- if (input.equals("multiply")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to multiply");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to multiply");
- double input2 = reader.nextDouble();
- double inputTotal = input1 * input2;
- System.out.println("Your number is: " + inputTotal);
- grupnormalCalculator();
- }
- if (input.equals("divide")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to divide");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to divide");
- double input2 = reader.nextDouble();
- double inputTotal = input1 / input2;
- System.out.println("Your number is: " + inputTotal);
- grupnormalCalculator();
- }
- }
- public static void KuebjiiCalculatorMenu() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Welcome to Kuebjii's Calculator");
- System.out.println("Circle");
- System.out.println("Square");
- System.out.println("Rectangle");
- System.out.println("Please type out the number you would like to use");
- String input = reader.nextLine();
- if (input.equals("circle")) {
- circles();
- }
- if (input.equals("square")) {
- squares();
- }
- if (input.equals("rectangle")) {
- rectangle();
- }
- if (input.equals("devmode")) {
- devMode();
- }
- if (input.equals("back")) {
- GuestmainMenu();
- }
- }
- public static void rectangle() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Please enter the length of the rectangle");
- double length = reader.nextDouble();
- System.out.println("Please enter the width of the rectangle");
- double width = reader.nextDouble();
- double perimeter = 2 * (length * width);
- double area = length * width;
- System.out.println("Here is the perimeter of the rectangle: " + perimeter);
- System.out.println("Here is the area of the rectangle: " + area);
- System.out.println();
- KuebjiiCalculatorMenu();
- }
- public static void squares() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Please enter one side of the square");
- double side = reader.nextDouble();
- double perimeter;
- double area;
- perimeter = side + side + side + side;
- area = side * side;
- System.out.println("Here is the perimeter of the square: " + perimeter);
- System.out.println("Here is the area of the square: " + area);
- System.out.println();
- KuebjiiCalculatorMenu();
- }
- public static void circles() {
- System.out.println("What is the radius of the circle?");
- Scanner reader = new Scanner(System.in);
- double radius = reader.nextDouble();
- double circumference;
- double area;
- circumference = 2 * 3.14 * radius;
- area = 3.14 * radius * radius;
- System.out.println("Here is the circumference of the circle" + circumference);
- System.out.println("Here is the area of the circle" + area);
- System.out.println();
- KuebjiiCalculatorMenu();
- }
- public static void devMode() {
- Scanner reader = new Scanner(System.in);
- System.out.println("D E V C O N S O L E");
- System.out.println("1. Circle");
- System.out.println("2. Square");
- System.out.println("3. Rectangle");
- System.out.println("4. Testing Cycle");
- int selector = reader.nextInt();
- if (selector == 1) {
- System.out.println("What is the radius of the circle?");
- double radius = reader.nextDouble();
- double circumference;
- double area;
- circumference = 2 * 3.14 * radius;
- area = 3.14 * radius * radius;
- System.out.println("Radius = " + radius + " Equation for circumference: 2 * 3.14 * " + radius);
- System.out.println("Radius = " + radius + " Equation for area: 3.14 * " + radius + " * " + radius);
- System.out.println("Here is the circumference of the circle: " + circumference);
- System.out.println("Here is the area of the circle: " + area);
- }
- }
- public static void normalCalculator() {
- Scanner reader = new Scanner(System.in);
- System.out.println(Colors.RED + "Welcome to the normal calculator" + Colors.RESET);
- System.out.println(Colors.RED + "Type any equation into the line below" + Colors.RESET);
- System.out.println(Colors.BLUE + "Do you want to add, subtract, mutliply, or divide");
- System.out.print(Colors.GREEN + "> " + Colors.RESET);
- String input = reader.nextLine();
- if (input.equals("add")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to add");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to add");
- double input2 = reader.nextDouble();
- double inputTotal = input1 + input2;
- System.out.println("Your number is: " + inputTotal);
- normalCalculator();
- }
- if (input.equals("subtract")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to subtract");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to subtract");
- double input2 = reader.nextDouble();
- double inputTotal = input1 - input2;
- System.out.println("Your number is: " + inputTotal);
- normalCalculator();
- }
- if (input.equals("multiply")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to multiply");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to multiply");
- double input2 = reader.nextDouble();
- double inputTotal = input1 * input2;
- System.out.println("Your number is: " + inputTotal);
- normalCalculator();
- }
- if (input.equals("divide")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to divide");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to divide");
- double input2 = reader.nextDouble();
- double inputTotal = input1 / input2;
- System.out.println("Your number is: " + inputTotal);
- normalCalculator();
- }
- }
- public static void rootKuebjiiCalculatorMenu() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Welcome to Kuebjii's Calculator");
- System.out.println("Circle");
- System.out.println("Square");
- System.out.println("Rectangle");
- System.out.println("Please type out the number you would like to use");
- String input = reader.nextLine();
- if (input.equals("circle")) {
- rootcircles();
- }
- if (input.equals("square")) {
- rootsquares();
- }
- if (input.equals("rectangle")) {
- rootrectangle();
- }
- if (input.equals("devmode")) {
- rootdevMode();
- }
- if (input.equals("back")) {
- rootmainMenu();
- }
- }
- public static void rootrectangle() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Please enter the length of the rectangle");
- double length = reader.nextDouble();
- System.out.println("Please enter the width of the rectangle");
- double width = reader.nextDouble();
- double perimeter = 2 * (length * width);
- double area = length * width;
- System.out.println("Here is the perimeter of the rectangle: " + perimeter);
- System.out.println("Here is the area of the rectangle: " + area);
- System.out.println();
- rootKuebjiiCalculatorMenu();
- }
- public static void rootsquares() {
- Scanner reader = new Scanner(System.in);
- System.out.println("Please enter one side of the square");
- double side = reader.nextDouble();
- double perimeter;
- double area;
- perimeter = side + side + side + side;
- area = side * side;
- System.out.println("Here is the perimeter of the square: " + perimeter);
- System.out.println("Here is the area of the square: " + area);
- System.out.println();
- rootKuebjiiCalculatorMenu();
- }
- public static void rootcircles() {
- System.out.println("What is the radius of the circle?");
- Scanner reader = new Scanner(System.in);
- double radius = reader.nextDouble();
- double circumference;
- double area;
- circumference = 2 * 3.14 * radius;
- area = 3.14 * radius * radius;
- System.out.println("Here is the circumference of the circle" + circumference);
- System.out.println("Here is the area of the circle" + area);
- System.out.println();
- rootKuebjiiCalculatorMenu();
- }
- public static void rootdevMode() {
- Scanner reader = new Scanner(System.in);
- System.out.println("D E V C O N S O L E");
- System.out.println("1. Circle");
- System.out.println("2. Square");
- System.out.println("3. Rectangle");
- System.out.println("4. Testing Cycle");
- int selector = reader.nextInt();
- if (selector == 1) {
- System.out.println("What is the radius of the circle?");
- double radius = reader.nextDouble();
- double circumference;
- double area;
- circumference = 2 * 3.14 * radius;
- area = 3.14 * radius * radius;
- System.out.println("Radius = " + radius + " Equation for circumference: 2 * 3.14 * " + radius);
- System.out.println("Radius = " + radius + " Equation for area: 3.14 * " + radius + " * " + radius);
- System.out.println("Here is the circumference of the circle: " + circumference);
- System.out.println("Here is the area of the circle: " + area);
- }
- }
- public static void rootnormalCalculator() {
- Scanner reader = new Scanner(System.in);
- System.out.println(Colors.RED + "Welcome to the normal calculator" + Colors.RESET);
- System.out.println(Colors.RED + "Type any equation into the line below" + Colors.RESET);
- System.out.println(Colors.BLUE + "Do you want to add, subtract, mutliply, or divide");
- System.out.print(Colors.GREEN + "> " + Colors.RESET);
- String input = reader.nextLine();
- if (input.equals("add")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to add");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to add");
- double input2 = reader.nextDouble();
- double inputTotal = input1 + input2;
- System.out.println("Your number is: " + inputTotal);
- rootnormalCalculator();
- }
- if (input.equals("subtract")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to subtract");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to subtract");
- double input2 = reader.nextDouble();
- double inputTotal = input1 - input2;
- System.out.println("Your number is: " + inputTotal);
- rootnormalCalculator();
- }
- if (input.equals("multiply")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to multiply");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to multiply");
- double input2 = reader.nextDouble();
- double inputTotal = input1 * input2;
- System.out.println("Your number is: " + inputTotal);
- rootnormalCalculator();
- }
- if (input.equals("divide")) {
- System.out.println(Colors.BLUE + "Now type the first number you want to divide");
- double input1 = reader.nextDouble();
- System.out.println(Colors.BLUE + "Now type the second number you wan to divide");
- double input2 = reader.nextDouble();
- double inputTotal = input1 / input2;
- System.out.println("Your number is: " + inputTotal);
- rootnormalCalculator();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement