juliotv
0
Q:

calculator

//Javascript Calculator

var a = prompt('Number #1')
var b = prompt('Number #2')
var c = a+=b
alert(c)
4
ok I'll stop cheating thank you
5
<b> STOP CHEATTINNNGGGG </b>
1
calc_type = input('Would operation would you like to do (+, -, *, /)?: ')
print('\n')
num1 = int(float('Enter first number: '))
num2 = int(float('Enter second number: '))

if calc_type == '+':
  answer_a = num1 + num2
  print('\n:', num1, '+', num2, '=', answer_a)
elif calc_type == '-':
  answer_s = num1 - num2
  print('\n:', num1, '-', num2, '=', answer_s)
elif calc_type == '*':
  answer_m = num1 * num2
  print('\n:', num1, '+', num2, '=', answer_m)
elif calc_type == '/':
  answer_d = num1 / num2
  print('\n:', num1, '/', num2, '=', answer_d)
else:
  print('\nInvalid Input!')
26
do the math urself
0
class calc:
  def __init__(self,num):
    self.num = num
  def __add__(self,other):
    #inner code
  def __mul__(self, other):
    #inner code
  def __sub__(self, other):
    #inner code
  def __div__(self,other):
    #inner code
  # and so on for features
  
0
stop cheating
0
String uncool = "dude, uncool."; //when you're in class
0
Stop Cheating in class weirdo
-1

Related

New to Communities?

Join the community