Java - Two Number Calculator (add, subtract, multiply, divide)

https://replit.com/@FourTreys/MessyClearcutPaintprogram#index.js

Guessing Game

This is a game where you guess a number until you get it correct with the computer telling you if you are too high or too low!!

from random import randint number = randint(1, 100) Tries = "10" print(number) print("Welcome to the Guessing Game!!") tries = 10 guess = int(input("Please enter an integer between 1 to 100")) while guess != number: if guess > number: guess = int(input("Your guess was too high, try again!!")) print(str(tries) + " Tries left") tries -= 1 if tries == 0: print("You lost! The actual number was!", number, "If you want, you can try again!") break elif guess < number: guess = int(input("Your guess was too low, try again!!")) print(str(tries) + " Tries left") tries -= 1 if tries == 0: print("You lost! The actual number was!", number, "If you want, you can try again!") break if guess == number: print("Your guess was correct!!!!")

Summation Calculator

This code can add all integers, between 2 distinct integers, including negative integers, in increments of your choice, no matter which order the distinct integers are places in.

import math print("Welcome to the summation calculator") a = int(input("Please enter first number")) b = int(input("Please enter second number")) c = int(input("Please enter what increments to skip count by")) if a > b and c >= a: print("Sorry, your increment is not valid") elif b > a and c >= b: print("Sorry, your increment is not valid") elif a == b: print("Sorry, your values are equal") elif a > b: d = int(sum(range(b, a, c))) print(d) elif b > a: g = int(sum(range(a, b, c))) print(g)

2 Number Calculator

This code will allow you to use many operations with 2 numbers, not just the 4 basic operations!

print("Please insert two numbers and what you want to do with them") a = float(input("Please enter Number a here")) b = float(input("Please enter Number b here")) Operation = input("Please enter operation here. Please use the words Addition, Subtraction, Division, Multiplication, " "Square Root of a, Square Root of b, a choose b, b choose a,\n a to the power of b, and b to the" "power of a. If you don't want 2 numbers, please enter a random number in that slot. Thank you.") if Operation == "Addition": print(a+b) elif Operation == "Subtraction": print(a-b) elif Operation == "Division": print(a/b) elif Operation == "Multiplication": print(a*b) elif Operation == "a choose b": c = math.comb(int(a), int(b)) print(c) elif Operation == "b choose a": d = math.comb(int(b), int(a)) print(d) elif Operation == "a to the power of b": g = pow(int(a), int(b)) print(g) elif Operation == "b to the power of a": h = math.comb(int(b), int(a)) print(h) elif Operation == "Square root of a": j = math.sqrt(int(a)) print(j) elif Operation == "Square root of b": k = math.sqrt(int(b)) print(k) else: print("The operation given is not valid. Please try again.")

Regular Polygon and Circle Area Calculator

This will allow you to find the approximate area of several regular polygons and circles.

import math a = float(input("Please enter what regular polygon you want to find the area of. Options area a circle, equilateral " "triangle, square, pentagon, hexagon, octagon")) b = float(input("Please enter side length or radius of your polygon")) if a == "circle": print(3.1415 * b * b) elif a == "triangle": print(b * b * 0.433) elif a == "square": print(b * b) elif a == "pentagon": print(1.72 * b * b) elif a == "hexagon": print(2.598 * b * b) elif a == "octagon": print(4.828 * b * b) else: print("Sorry, either your polygon or length/radius is wrong")

Triangle Checker

This code will allow you to find if your triangle is equilateral, isosceles, scalene, acute, obtuse, or/and right!

Angle_A = float(input("Please enter value for angle 1 of a triangle")) Angle_B = float(input("Please enter value for angle 2 of b triangle")) Angle_C = float(input("Please enter value for angle 3 of c triangle")) if Angle_A + Angle_B + Angle_C != 180: print("Sorry, the angles you entered are not valid, please try again.") elif Angle_A > 90 or Angle_B > 90 or Angle_C > 90: print("Your triangle is Obtuse") elif Angle_A == 90 or Angle_B == 90 or Angle_C == 90: print("Your triangle is a Right triangle") elif Angle_A < 90 and Angle_B < 90 and Angle_C < 90: print("Your triangle is acute") elif Angle_A == Angle_B or Angle_B == Angle_C or Angle_A == Angle_C: print("Your triangle is isosceles") elif Angle_A != Angle_B != Angle_C: print("Your triangle is scalene") elif Angle_A == Angle_B == Angle_C: print("Your triangle is equilateral")

Microsoft Computer Layout Design HTML and CSS

Using classes, grids, and relative positioning, this is a design of a Microsoft Layout. Images are random images are not correspondent with the exercise (filler images).

Final project

Coordinate Project run


#In this project I am creating a grid of zeros in which there lies a 1 in a random point# #The user will need to input the correct coordinates if they want their score to increase# #This program however will not use a traditional graphing system and the y value will begin at the top and go down# #Example# #00000# #00100# #00000# #00000# #correct coordinates: 2,1# import random print() def coordinate_game(): cords=[["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0"]] x=random.randint(0,9) y=random.randint(0,9) cords[x][y]="1" for i in cords: print (i) b = input("what are the coordinates of the number 1: ") score=0 if (b == str(str(y)+","+str(x))): print("correct") score=score+1 print("score+1") else: print("incorrect") print("score+0") print(str(str(y)+","+str(x))) c=input("would you like to continue: ") if c == "yes": print("good job SCORE: "+str(score)) coordinate_game() else: print("end of game SCORE: "+str(score)) coordinate_game()

Calculator Layout Design HTML CSS

A HTML and CSS made calculator layout. Uses divs, grids, flexboxes, and combo classes.

Screen Design Layout Created With HTML

An email screen layout (does not work; just a design) created with HTML and CSS

Calculator(With Time Function)

A more professional version of the original python calculator

import time #Asking for the Numbers and Operation print("Hello I am Calculator. Enter 2 numbers and an operation so I can tell the answer.") print("") time.sleep(2) num1 = float(input("Enter First Number: ")) op = (input("Enter Operation: ")) num2 = float(input("Enter Second Number: ")) #Converting Operation to Calculator print("") time.sleep(1.5) print("calculating...") time.sleep(1.5) print("calculating...") time.sleep(1.5) print("calculating...") time.sleep(1.5) print("") print("The answer is:") time.sleep(1.5) if op == "+": print(num1 + num2) elif op == "-": print(num1 - num2) elif op == "/": print(num1 / num2) elif op == "*": print(num1 * num2) else: print("Invalid! Try again!")

Number Guessing Game 2.0!

A better version of the original version

from random import randint number = randint(1,99) userguess = int(input("Guess a number from 1 to 99: ")) guess = 6 #InfiniteGuesses while userguess != number: if userguess < number: print("Guess Higher") userguess = int(input("Guess a number from 1 to 99: ")) guess += 1 if userguess > number: print("Guess Lower") userguess = int(input("Guess a number from 1 to 99: ")) guess += 1 if userguess == number: print("You got it!") if guess == 0: print("Out of guesses! Better luck next time.")
1 2 ... 34