Questions tagged [calculator]
Questions about calculators, or calculator programming. For TI-BASIC calculator programming, use the ti-basic tag.
4,342
questions
-3
votes
1
answer
36
views
What type of mistake here is? [closed]
I need to make a calculator which raises a number to the 9th power. Intellij IDEA says a mistake in 20th line, but I can't understand what is I am doing wrong. Pls help.
public class Solution {
...
-2
votes
0
answers
25
views
How does my program use different function and why are some variables uninitialized?
my program should be a bitwise-operator calculator where I should use numbers with the "short" datatype.
I also have a heather data with some escape commands that I use.
The problem is that ...
1
vote
1
answer
41
views
Android Studio Java infix to postfix calculations decimal point gives crash
I was trying to make a calculator for my university homework. to calculate the results I use infix to postfix convention. but this code doesn't take only decimal point (.) as a result, it crashes ...
-1
votes
0
answers
19
views
Javascript calculator not displaying multiple numbers
Please my javascript calculator is only returning a single value and after clicking another number to append it simply replaces the value there so no double digits just singles to be replaced.
Help ...
0
votes
0
answers
11
views
Displaying operands, operator and result on JTextField in a calculator
I built a basic calculator that can perform simple arithmetics but I'm facing a challenge that when I wanted my calculator to compute for example 1 + 1, it won't display both operands before giving ...
0
votes
1
answer
20
views
Unity rotation calculation
//RAYCAST
RaycastHit hit = new RaycastHit();
if(Physics.Raycast(impact.position, bloom, out hit, 1000f, canBeShot))
{
GameObject newBulletHole = Instantiate(bulletHolePrefab, hit....
1
vote
4
answers
115
views
Creating a very basic calculator in C++
I'm extremely new to C++, I was following a tutorial and wanted to go a bit off what the course said, I attempted to make a basic calculator that instead of just being able to add could subtract, ...
0
votes
2
answers
65
views
count if there are dates in array that match condition
I'm a noob that is playing with calculators for fun. As a learning experience, I decided to make a maternity leave pay calculator for my country but I'm stuck at the working days calculations. For ...
0
votes
1
answer
43
views
JavaScript Calculator equal button returns "undefined"
I'm working on a simple JavaScript calculator. Everything seems fine and other buttons works as expected except for the equal button which returns an "undefined" when it is clicked. On ...
0
votes
1
answer
26
views
how to have numbers output with commas
I am trying to create a simple mortgage calculator and I want to have the numbers print with commas when the outputted number is larger than 3 digits. I would appreciate any help or suggestions. Im ...
-4
votes
0
answers
23
views
3D Scientific calculator using GUI in Java [closed]
I've been given a project on Scientific calculator using GUI in Java
I still can find scientific calculator source code online but I need it including 3D effects using GUI and being a beginner ....i ...
1
vote
3
answers
44
views
How can I make a calculator ask the user if they want to perform another calculation in Java?
I have tried to do this using a do while loop however the variable isn't found. My goal is to basically perform the code all over again when the user wants to. Can anybody help?
import java.util....
1
vote
1
answer
23
views
Add value of selected radio button to user input sum
I have created a basic calculator that adds 24% to the number that the user types in.
I am trying to add in a second step where the user selects a radio button and this also gets added on to the total ...
-1
votes
0
answers
8
views
Calculator Exponents: what is the difference between the displays?
6.00000000E-7 or 6E-7.
I don't think there is a difference, but my calculator chose the former, rather than the latter, to display. So if equal, why the eight zeros before the exponent? Or are they ...
0
votes
0
answers
36
views
IF statement not working as expected in Tkinter
I am using Tkinter to build a simple calculator. I want to make sure that if a new number is pressed after an answer was displayed, the number doesn't get concatenated with the previous answer. I have ...
0
votes
0
answers
21
views
Evaluating Strings as Mathematical Expressions in Java [duplicate]
As a student project, I have been developing a simple calculator program using Swing. Currently, it only includes the ability to input digits and operators into a string which is stored in a ...
0
votes
0
answers
30
views
React Calculator can't find an algorithm to make calculations with different consecutive symbols [duplicate]
I have figured out an 'algorithm' to make consecutive calculations with the same symbol i.e. 2 + 3 + 5 = ... or 1 * 2 * 4 = ... However I'm stuck and can't change it to work with different symbols, ...
0
votes
0
answers
43
views
Calculator Operations
I'm making a calculator on JavaScript... but I'm not able to think of any way to get a number, store it then after the operator is pressed get another number store it ....for n number of times
and ...
-2
votes
0
answers
26
views
Function that calculate adding two float numbers in Javascript? [duplicate]
When making the following operation in JavaScript:
1.2 + 0.1
It returns 1.29999999999996 .
and this is my solution guys:
// Use this function
// This is a sum function that works for all add ...
0
votes
2
answers
25
views
How to extrude and execute the contents between brackets?
I need to execute an expression according to Order of Operations, and I can't figure out how to resolve the side-by-side brackets.
I am receiving an expression as a string ->
"(add (multiply 4 ...
0
votes
1
answer
17
views
Why does my code not log each button of the calculator elements?
The code below is intended to loop through each button and log it to the console.
I'm ultimatelty trying to create a calculator, but first I have to be able to get
identity of each button, however, I ...
4
votes
2
answers
229
views
Resize div box in angular from the opposite corner
• I just want to resize a square from the left not the right
• Here is the code I used:
My Stackblitz Code
• My desired result:
• Thanks for your help.
0
votes
1
answer
36
views
Why does my Vanilla JS Calculator's number change at the 17th digit?
It's a basic calculator made by the youtube channel Web Dev Simplified.
He did a youtube tutorial on it, which I followed along and basically made the same thing.
Both his example calculator and mine ...
0
votes
0
answers
14
views
Why does Char scanf gets skipped when it's between two Float scanf? [duplicate]
So I'm trying to make like a calculator in C for beginners and I want it to be formatted by asking the first number, the operator, and the second number respectively. However, it only works by asking ...
0
votes
0
answers
36
views
Problem is when I click the green color clear button number field text is not clear how to solve it? [duplicate]
Problem is when I click the green color clear button number field text is not clear how to solve it?
from tkinter import *
from datetime import date
root = Tk()
root.title("AGE-CALCULATOR")...
-1
votes
1
answer
60
views
Calculate an answer from a string equation in c++ [duplicate]
I would like to convert a string equation such as 10+20 or even use of numerous operators such as 10+20*5 into an answer such as 110 from a string equation.
I have currently tried looping through each ...
0
votes
0
answers
106
views
Convert nanocore to core CPU?
im confuse to convert nanocore to core of CPU
my formula is:
nanocore / 1000000000 = CORE (1000000000 is 1 billion)
if my linux os have 10 core.
I want to calculator percentage cpu usage. This formula ...
1
vote
0
answers
35
views
Adding values of dynamically created inputs [javascript]
I am creating my first bigger .js project from scratch and I'm completely stuck on one part. I am really new to web-dev and .js is my first programming language that I am learning. I want to create a ...
0
votes
0
answers
7
views
Converting an infix notation into postfix by passing Array of string C#
static string[] infixToPostfix(string[] exp)
{
Stack<string> result = new Stack<string>();
Stack<string> stack = new Stack<string>();
stack.Push("#");
...
0
votes
0
answers
12
views
PHP calculator can't recognize my 2nd constant (code attempted to call invalid constant)
I've gotten so far with the code so far but everytime i try using the PHP's in combination with the html it doesnt work.. Is there a simple fix for this or have I made a mistake in the script?
The ...
0
votes
1
answer
84
views
Swiftui Calculator Continuous calculation
I want to practice the real ios calculator in my app and can calculate continuously
When I tap add button, I want to can be calculated.But now my value can't really be calculated automatically when I ...
-3
votes
2
answers
50
views
Getting NameError exception after terminate the calculator application [closed]
Typing the '#' symbol terminates the calculator application and the '$' symbol resets the output value. But after typing the '#' symbol, I have got NameError exception for the output value.
while True:...
0
votes
0
answers
13
views
Can I repeat just one section of code in a ti-84 plus calc?
I'm trying to create a script in my TI-84 plus calculator that will solve any fine the value of Y if x=(any number). The name of the script it solves and I'm using the equation X²+5X-4. The way the ...
1
vote
1
answer
38
views
How to prevent a calculator operator from modifying the result when multiple operators are pressed in a row? JavaScript
Creating a calculator with JavaScript, however if a user were to accidentally push an operator twice in a row, it would modify the result again based on the current values of a and b. This is ...
-1
votes
0
answers
16
views
result calculated in an online application not like in another calculators [duplicate]
I want some help please ;
my value calculated it's not like on the online calculator or in in the calculator of my phone ,
for example
My instruction of result is :
e_calculated = float((h * distance *...
0
votes
1
answer
35
views
How to choose an operator when making a simple calculator in C++?
I'm making a simple calculator in C++, but I'm having trouble choosing an operator, I wonder who can help me?
I'm using this code:
include <iostream>
using namespace std;
int main()
{
string ...
1
vote
1
answer
56
views
What am I missing? Calculation won't show in the field
I am trying to make an area calculator and I cannot figure out what am I missing.
the area field is not updating when entering numbers in each field.
Any advice please? I wonder if I'm missing ...
0
votes
1
answer
41
views
Perform operations on button values in JavaScript
I'm trying to make a calculator in JS and I'm searching for ways to add, subtract, multiply and divide button values. I've created a function to display the buttons but now I realize that that might ...
0
votes
1
answer
255
views
Save and display calculation history of the python calculator
I need to extend the given calculator program to record the calculations, and recall them as a list using an additional command '?'.
Things to do:
Declare a list to store the previous operations
Save ...
0
votes
0
answers
33
views
I have a "TypeError: 'float' object is not iterable" when I want to convert the second number in the float too
def pl():
num1=float(ent.get())
ent.delete(0, END)
num2=float(ent.get())
result=sum(num1, num2)
ent.insert(END, result)
When I want to sum both of the numbers ...
-3
votes
1
answer
16
views
JS Calculator for smokers
I'm working on a calculator for smokers and I can't figure out why he doesn't want to work. It's so simple and I don't see the mistake.
function spentMonth(){
let price;
let num;
...
0
votes
1
answer
40
views
Prevent Users from Entering Multiple Decimals In Objective-C
I am making an only number input app (still) in which users press a button, I store a value into a string to display in a label.
Works great for the most part, except I cannot figure out how to ...
0
votes
1
answer
44
views
Language C: basic question regarding calculator function in EdX program
Question; I'm brand new to coding and doing the self taught route; not important. But building the calculator in cs50.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int x = ...
0
votes
0
answers
19
views
What is wrong with my Mortgage Calculator CPP
I'm a newbie at programming and so far I've come up with this code for a simple mortgage calculator. I have a feeling my formula is wrong, but whenever I try to test it, it either gives me 90000 or ...
0
votes
0
answers
45
views
Python - Reset button calculator and other issues
Python - Reset button calculator and other issues
This is a python calculator. I developed a part here. but, In this calculator, when the user enters two wrong numbers or one wrong operator, the reset ...
0
votes
2
answers
40
views
Improving Caclculator inside react progrem
I'm trying to add a reset button to the input (Kind of like CE in a calculator) and i'm having trouble with placing it inside the code.
import { useRef } from "react";
import './App.css';
...
1
vote
2
answers
60
views
I just started c++ and made a calculator. What or how can I improve my code/ learn more? [closed]
So I tried making a simple calculator that can input 2 floats and do basic operations (addition, subtraction, division, multiplication). This is the first time I'm writing a code without copying the ...
-3
votes
5
answers
53
views
React Basics Started Today
I started to learn to react today, and I'm trying to build a super simple calculator, but I'm not familiar with the syntax and basics of reacting yet. No matter how much I'm looking and reading, my ...
0
votes
1
answer
48
views
Simple CLI calculator in js (least amount of code, using built-in functions only)
I'm trying to build the following calculator in every language and js raises questions.
This is my calculator in python3 that just works in 2 lines using the built-in eval() function:
#!/usr/bin/env ...
0
votes
2
answers
32
views
Simple Javascript/HTML Multiplcation calculator not working
I'm trying to get this calculator to work on my website. But the answer is not populating after I enter numbers into the fields and hit the Calculate button. I'm new to javascript and I feel like the ...