calculator

TI-84 Plus Random Number Generator Algorithm

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 12:17:30
问题 Edit: my main question is that I want to replicate the TI-84 plus RNG algorithm on my computer, so I can write it in a language like Javascript or Lua, to test it faster. I tried using an emulator, but it turned out to be slower than the calculator. Just for the people concerned: There is another question like this, but answer to that question just says how to transfer already-generated numbers over to the computer. I don't want this. I already tried something like it, but I had to leave the

How to store a number in decimal format in avr

陌路散爱 提交于 2019-12-18 09:45:26
问题 I am trying to enter the decimal values using a keypad in ATMega8 Till now I have been able to enter only the integer values The code is given below switch (keyCode) { case (0xee): keyPressed="1"; b=1; a=a*10+b; break; case (0xed): keyPressed="4"; b=4; a=a*10+b; break; case (0xeb): k keyPressed="7"; b=7; a=a*10+b; break; case (0xde): keyPressed="2"; b=2; a=a*10+b; break; case (0xdd): keyPressed="5"; b=5; a=a*10+b; break; case (0xdb): keyPressed="8"; b=8; a=a*10+b; break; case (0xd7):

Eval alternative

。_饼干妹妹 提交于 2019-12-18 07:16:10
问题 This code works as a calculator, but the scratch pad at codeacademy tells me that eval is evil. Is there another way to do the same thing without using eval? var calculate = prompt("Enter problem"); alert(eval(calculate)); 回答1: eval evaluates the string input as JavaScript and coincidentally JavaScript supports calculations and understands 1+1 , which makes it suitable as a calculator. If you don't want to use eval , which is good, you have to parse that string yourself and, finally, do the

Workaround for this calculator parsing error

假如想象 提交于 2019-12-14 03:24:32
问题 Context : I entered a expression 3.24 * 10^10 + 1 into a calculator that I made. My calculator's approach to solve this is - it first looks for pattern number_a^number_b , parses the 2 numbers into double using Double.parseDouble() method, then performs Math.pow(number_a, number_b) and replaces the expression with the result. The calculator, then, similarly looks for pattern number_a * number_b and parses it. So far our expression becomes 3.24E10 + 1 . Now comes the tricky part. When I

Basic Calculator in Python

被刻印的时光 ゝ 提交于 2019-12-14 03:21:38
问题 I'm new to Python. I tried to make a basic calculator, but i can't really find the problem. It returns with 0 exit code, but nothing appears, no input no nothing. Any help with this will greatly be appreciated. Thank You. def add(num1, num2): return num1 + num2 def subtract(num1, num2): return num1 - num2 def div(num1, num2): return num1/num2 def multi(num1,num2): return num1*num2 def main(): operation = input("What do you want to do?(+, -, *, or /):") if (operation != "+" and operation != "-

how do you split up a string in java without arrays?

耗尽温柔 提交于 2019-12-14 03:03:53
问题 i have a homework assignment where i need to create a calculator that accepts the user input in this form [1+2/3*5-4]. im not supposed to use an array to store the values from the string. instead im supposed to take 3 numbers and 2 operators at a time. my question is how do i store the numbers and operators and once i store them and calculate the value get q new number and a new operator from the original string. this is what i have so far not sure if im in the right direction. public class

Trouble with a simple calculator code (Java)

空扰寡人 提交于 2019-12-14 03:00:07
问题 So I've been trying to make a simple calculator program in Java myself and I seem to have encountered a problem. The code doesn't seem to have an error (none showing in Eclipse or in Command Prompt), but when I run it it ends after you input the operation. Here's the example of my code: public class vjezba1 { public static void main(String[] args) { Scanner input=new Scanner(System.in); Scanner text=new Scanner(System.in); String opr; int x; int y; int sum; System.out.println("This is a

Multiple Language Programming on Ti-Calculator

自作多情 提交于 2019-12-14 01:23:48
问题 I am interested into programming with different languages besides Ti-Basic (like Java, C, and Python) on my Ti-84 plus calculator. Does my calculator support this, and if not, are there any calculators on the market that would be able to do this? Thanks in advance! (The idea is that when I don't have access to my computer at home, I could just pull out my pocket calculator and start programming and testing out some algorithms on the go that come in mind.) It doesn't have to be a calculator,

Java Calculator GUI [closed]

不打扰是莪最后的温柔 提交于 2019-12-13 23:55:32
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . so i want to make this calculator i'm beginner so i dont know how to make calculations using = sign. i want to save first number in for example double temp and then save also second number an when i press = i

Making a calculation according to the BODMAS in C# [closed]

不羁的心 提交于 2019-12-13 22:50:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Guys I have a calculation that is built by a user in a text box. In short, he defines the format he wants and the values are passed on later(after some database queries). eg. (X + Y) * 55 or he may also bulid as (X - 100) * 100 Is there any way of computing this with c# ? NOTE : X and Y are retrieved from a