Questions tagged [calculator]

Questions about calculators, or calculator programming. For TI-BASIC calculator programming, use the ti-basic tag.

Filter by
Sorted by
Tagged with
0 votes
1 answer
43 views

How can I ask the user for the numbers after asking for the number of numbers to use in a calculation? [duplicate]

I'm new to python, and I'm working on a simple calculator to learn more about it, and I'm not sure how to solve this. I'm trying to make my calculator scalable, so the user can choose how many numbers ...
LeviC's user avatar
  • 1
1 vote
1 answer
53 views

Need to add onblur to update ISA calculator results without clicking calculate

var initialAmount = parseFloat($('#initialAmount').val()); var regularAmount = parseFloat($('#regularAmount').val()); var regularFrequency = $("input[name='regularFrequency']:checked"...
Owen's user avatar
  • 11
0 votes
4 answers
113 views

My calculator doesn't work, it doesn't print the result on the screen

So my problem is that my calculator works normally, it shows the operation that I am writing, but when I click on the " equal ", the result isn't here. I don't know why, because in the code, ...
Aidez svppp's user avatar
-5 votes
0 answers
65 views

JavaScript Calculator issues: If 2 or more operators are entered consecutively

I am building a JavaScript calculator as a project. I can not figure out a situation with the "-" (negative/subtract). If 2 or more operators are entered consecutively, the operation ...
Eric Purtlebaugh's user avatar
0 votes
1 answer
100 views

Why does my `print` work both with and without `str`?

if islem == "+": print("sonuç: "+str(ilksayı+ikincisayı)) elif islem == "-": print("sonuç: "+ str(ilksayı-ikincisayı)) elif islem == "x": ...
metearsizm's user avatar
0 votes
0 answers
40 views

why is my function "handleexpression" not working as expected ? (Calculator app)

when I press the clear button , I am left with the first digit/operator the typed in . like the very first screen: first screen of the calculator (Also I don't understand why it is giving a warning ...
LuciferStix's user avatar
-4 votes
1 answer
49 views

Why is line 8 in my basic calculator not working as intended?

The code I've written is: while Operator != "+" and "-" and "*" and "^" and "/" and "/+" and "v-": Operator = input("...
Someone's user avatar
0 votes
0 answers
41 views

Creating a parser in C for DSL calculator

I tried to fix the error on line 137 of the code. As a result I get an exit code -1. And error: note: expected 'const char * const' but argument is of type 'int' 1917 | CJSON_PUBLIC(cJSON *) ...
6simple-person9's user avatar
0 votes
1 answer
75 views

How to get C input that accepts a float or a character as a value

As i said, i need to be able to accept the characters a b c d e as an input but it also needs to be able to accept any floating point numbers. i’m not sure if this is even possible but if someone ...
D Chang's user avatar
  • 11
-2 votes
2 answers
48 views

im having problems to add a calculator, a function that gets dynamicly the operator

someone can help me with some JS basics? im a rookie, trying to do a calculator, that get the value in the screen, stores it in a variable called previousValue, then the calculator display sets clean ...
DSM's user avatar
  • 1
-5 votes
2 answers
44 views

Can someone help me figure out why I am getting a traceback for the basic calculator code I wrote (python)? [closed]

Every time I am running my code and using %, I am either getting a single digit wrong answer or the code just stops. If I try to execute "quit" with a single digit answer, the print fucntion ...
Shubham's user avatar
0 votes
0 answers
13 views

how do i set up a directory and 4 diffrent files shown in the soft menu?

im trying to program a directory and in that directory, and in that directory the 4 soft menues should be for resistor 1 + resistor2, high time low time, TMR, BLK. So fare ive looked at the ...
Tim's user avatar
  • 23
0 votes
2 answers
41 views

Detecting keypress inside a function not working

I'm trying to make a calculator that calculates slope from two points. I couldn't figure out how to clear text from one text input box, so I have four text input boxes but just one showing at a time. ...
Its_j3rry's user avatar
0 votes
1 answer
70 views

Trigonometry in python calculator

I'm writing a scientific calculator as part of a project, but when I click the "=" sign, 6 functions (coth, acot, sec, sech, asec and acsc) display an error message in the calculation field ...
poteznymati's user avatar
0 votes
1 answer
32 views

Troubles with altair library in python

I'm running the following code: https://towardsdatascience.com/how-to-create-an-interactive-startup-growth-calculator-with-python-d224816f29d5. And I'm trying to make an startup growth calculator. ...
Salvador Macías's user avatar
2 votes
1 answer
30 views

JavaScrip React - Redux calculator issue

First of all I apologise for the code ive provided it is pretty messy but I cannot fix it now. My calculator works for the first time when I type values and after pressing equal sign things start act ...
Ivan Svitlychnyi's user avatar
1 vote
2 answers
131 views

Simple Calculator in Linux

I am trying to create a simple calculator using bash script. The main issue being faced is that it is not asking for a second operand for any arithmetic operation. Also, it is not working for negative ...
Ahmed Dildar's user avatar
1 vote
1 answer
47 views

When i compare the getText function of a JTextField with an equal String, it doesn´t return true [duplicate]

So i have this calculator (on Java) and when i press a button i wanna check if in the JTextField(pantalla) is only "0" so i can replace it with the number instead of concatenate the button i ...
tumorito's user avatar
1 vote
1 answer
55 views

Simple calculator with specific methods and multiple classes - Java

I am trying to make a calculator that uses specific methods and classes. The following methods are given: public class App { private static final Scanner inputScanner = new Scanner(System.in); ...
mellow1245's user avatar
0 votes
0 answers
33 views

Running into a problem when adding following line

I just started with Programming and watched this tutorial to build a Calculator with Java script: Here:(https://www.youtube.com/watch?v=j59qQ7YWLxw&t=1016s&ab_channel=WebDevSimplified) I am ...
peulers number's user avatar
1 vote
2 answers
54 views

I tried to make a simple calculator on Swift, but it keeps saying nil [duplicate]

I need help making a simple calculator. No UI, just typing on the console. I tried everything that I saw on the internet and lots of documentation but still can't fix it. Note: I'm new to all of this ...
oprumo _'s user avatar
0 votes
0 answers
159 views

how to use python programs on TI Nspire CX CAS calculator

I am very new to this. can someone please explain how can I open a tns file containing a python program made using TI Nspire CX CAS Student software v5.4.0.259 into my nspire CX CAS calculator, when i ...
Asim's user avatar
  • 173
0 votes
2 answers
26 views

When changing Raised Button to Elevated Button, creates an error on the button style

class _CalculatorState extends State<Calculator> { Widget calcbutton(String btntxt, Color btncolor, Color txtcolor) { return Container( child: RaisedButton( onPressed: () { ...
acevol's user avatar
  • 1
0 votes
1 answer
63 views

How to calculate two numbers after pressing on equal sign and a few numbers without pressing on equal sign, like this: '12 + 7 - 5 * 3'?

I'm building a calculator in javascript and I have problem with operations. If user input 12 + 7 - 5 * 3, result should be 42. So user should click 12 + 7 and result should come out, then when user ...
Velizar Vesovic's user avatar
-1 votes
1 answer
52 views

TextInput Not Updating When Buttons Are Pressed

I am working on a React Native application to create a calculator. I have a TextInput field where I want to display the input, and I'm trying to use the showSoftInputOnFocus property with editable={...
XM01 - stands with Palestine's user avatar
0 votes
1 answer
105 views

How do I display my calculator result with a thousands separator?

I am very new to Swift. I am making a simple calculator. But the thing is that I cannot create a thousands separator. In the code below, when entering the number in TextField1, I want to enter it ...
Doğanay Fidan's user avatar
0 votes
0 answers
26 views

Diffrence in calculating same number [duplicate]

Today I encountered a bug which happens in computer calculation. in JavaScript I used Math.pow(3,35) which should return the 3^35 or 50031545098999704 which should equivalent to 3^34 * 3 but the ...
Saleh Alikhani's user avatar
-2 votes
1 answer
30 views

How to display input like "0.052" in calculator display? [closed]

I'm building calculator from the odin project. I have problem with addEventListener for buttons elements. I have to handle situation when user input something like 0.53. I don't know what condition i ...
Velizar Vesovic's user avatar
-1 votes
2 answers
59 views

Could you please tell me what's wrong this javascript code

This code is supposed to calculate the sum, substract, multiply, divide at the same time when the user types in x and y but it's showing Nan function perform(x, y) { x = prompt("enter first no. ...
Adithya's user avatar
0 votes
0 answers
20 views

Fetch Data with condition ... React(Nextjs)

I'm using the next.js and i'm doing the fetch data from json. I need to calcolate the number of the "P.A rischio", "P.Abbandonati", "P.Fuori Soglia", "P.A Norma"...
giorgia dc's user avatar
-3 votes
2 answers
52 views

How do I make this iterate again work properly

I wrote this code to make a calculator with python. I wanted it to perform a task and continue doing that task with new inputs until an input is entered to stop. I already got a code from chat GPT but ...
Niki Jr's user avatar
  • 11
0 votes
1 answer
58 views

SLA expiration date calculation in Salesforce

How can I create Apex code that calculates an exact date/time after 72 hours of service from Monday to Friday from 8 am to 6 pm, and Saturdays from 8 am to 1 pm, taking into account holidays and using ...
Michelle Soto's user avatar
1 vote
0 answers
35 views

Why does my Ti-84 CE Plus not have a wait command in the program menu under CNTRL?

I'm trying to add a small delay in a program that I'm writing on my TI-84 CE Plus, and the programming guide that I found from Texas Instruments says that it should be A in the CNTRL menu, but it's ...
Ryan Christiansen's user avatar
-2 votes
1 answer
50 views

How use Object while creating Generic class?

I want to create a generic class of Object. class Calculator<Object> { // addition function for addition of two numbers (Integer , Float) Object addition(Object first, Object ...
Onkar Dighe's user avatar
0 votes
3 answers
90 views

Trying to figure out how to handle math expression including parentheses

so I'm currently trying to write a code that basically knows how to deal with mathematical expressions, it has some other little features such as calculating average, getting min number out of 2, ...
fastQ's user avatar
  • 1
0 votes
1 answer
46 views

Unary negation in my PEMDAS mistakenly multiplying negative numbers by each other

import re import math import tkinter as tk class Calculator: def __init__(self): #FUNCTION 1 INNIT #PEMDAS DICTIONARY TO HANDLE ORDER OF PRECEDENCE VIA KEY-VALUES self.PEMDAS = {'...
Mave360's user avatar
  • 15
-1 votes
1 answer
34 views

Square button(x^2) exception handling error in Calculator android app development

I am currently trying to develop a Calculator android app in android studio using Java. The app works fine until I click the button for Square operation i.e. x^2 button in the app when there is no ...
Abhijit Zende's user avatar
1 vote
1 answer
59 views

Using addEventListener() with React useReducer() returns multiple keypresses

I am making a calculator with React and wanted to add the functionality for the user to input numbers directly from their keyboard. I used window.addEventListner() with useEffect() but when ever I ...
Akshat Sharma's user avatar
1 vote
1 answer
82 views

Calculator doesn't calculate, just adds values. JS

So I decided to make a calculator for practice sake, and now I'm facing the issue in which console doesn't say any errors, it shows digits on screen, but it doesn't calculate them at all, just adds ...
Jask's user avatar
  • 23
0 votes
2 answers
76 views

im making a calculator and facing some unknown issues [closed]

So I decided to make a calculator for practice sake, and now I'm facing the issue in which console doesn't say any errors, it shows digits on screen, but it doesn't calculate them at all, just adds ...
Jask's user avatar
  • 23
0 votes
1 answer
26 views

React Calculator: Handling Consecutive Operators after Multiplication/Division

I'm building a simple calculator application using React, and I'm having trouble handling consecutive operators, particularly after multiplication ('x') or division ('/') operations. For example, when ...
derteple's user avatar
0 votes
0 answers
32 views

user story failing to complete JavaScript Calculator

I am completing the freecodecamp certificate and I am creating a javaScript Calculator. However, I can't pass all test cases. There is just one that I can't find the way to pass it. the user story I'm ...
santiago bolaños's user avatar
0 votes
0 answers
42 views

Method was called on null for calculation method....result required

*edit 2 solved - my issue was with how I was calculating and passing the cost variable. Used a void method for calcBase and retrieved using the proper writing of the of method and updated how I was ...
DG123's user avatar
  • 1
1 vote
2 answers
48 views

Unary negation ignored in user input in my pemdas calculator using python

I'm having issues with my PEMDAS calculator built in python. The issue that I'm encountering is mainly that I can't find a way to make my code recognize the "-" sign at the beginning of the ...
Mave360's user avatar
  • 15
3 votes
3 answers
93 views

Python Dollar Change Calculator not giving correct amounts

I am writing a program for my Python class homework. I have a good baseline, however, it's been 3 days and now this problem is just actually a problem and I am stuck. My professor wants the change to ...
KyleM08's user avatar
  • 49
0 votes
1 answer
26 views

How to solve VueJS calculator working once?

I have finished my calculator using VueJS, HTML and CSS but it works once. I mean, if I set 6x3 it gives me 18 but if I erase the result and I set other numbers, 3 x 2 for example, it does not work ...
Fabrizzio Machado 's user avatar
0 votes
1 answer
61 views

Stringing multiple numbers on a calcuator

I am building a calculator, having got to the final challenge of The Odin Project: Foundations. I had no problem with the course until this project. I am stuck at a very specific part. The ...
souste's user avatar
  • 21
0 votes
0 answers
41 views

WPF Calculator with more than One Operator at a Time not working

The Code is still unfinished but the Main problem I keep getting stuck on are the Operators. I have one Method for all my Operators but I can only use on Operator at a Time. Whenever the second ...
Laszlo Adams's user avatar
0 votes
1 answer
36 views

Why my VueJS Calculator does not show the numbers? [closed]

I was following a tutorial about how to make a calculator app in VueJS but I cannot see the numbers on the screen. This is my code in HTML, CSS and JS. I have already asked it to chatGPT but nothing ...
Fabrizzio Machado 's user avatar
-2 votes
1 answer
64 views

What is wrong with my bill calculator on google colab? [duplicate]

My python bill calculator is not working in colab and I don't know how to fix it. I run it and it asks for the bill total so i type "123.45". Then it askes for what method i want and I type &...
MiniSkoot32's user avatar

1
2 3 4 5
93