4,624 questions
0
votes
2
answers
90
views
Terminal does not return output, instead restarts code
I'm new to Python and I am building a simple interactive calculator as a project. When I run the code in the terminal, it takes all the inputs but does not return the final output. The code restarts ...
0
votes
1
answer
113
views
C Calculator program not performing operations correctly [duplicate]
I am a bare bones beginner, so there definitely could be something obvious I'm missing, but for some reason this code keeps outputting the first variable instead of the sum, subtraction, etc.
#include ...
2
votes
1
answer
54
views
'type': unknown override specifier missing type specifier - int assumed. Note: C++ does not support default-int
#ifndef TOKENTYPES_H
#define TOKENTYPES_H
#include <string>
enum class TokenType : int { NUMBER, OPERATOR, FUNCTION, PARENTHESIS };
struct Token {
std::string value;
TokenType type;
};...
0
votes
0
answers
91
views
Calculator app ignores new input when using Enter key after selecting from history
EDIT
I found my problème I'm so dumb ... was because I use a
<ListItem key={index} button onClick={() => (entry)}> and on that the key 'Enter' was trigger too ... My bad
I'm having a problem ...
-1
votes
1
answer
58
views
how to perform mathematical operations with sheet elements
I have Three lists, list1 contains the first value, List2 contains the second value, and the third contains characters. How do I make mathematical operations based on the signs stored there work with ...
0
votes
0
answers
167
views
Syntax error at programming HP Prime Pro G2
I have this new calculator (HP Prime Pro G2) and I am trying to program some script, but I am having some trouble with it. I have two problems:
I am trying to define some LOCAL variables. However, ...
0
votes
1
answer
48
views
An error in JS code about a Calculator that show me "ERROR" result
I am working on a simple calculator using HTML, CSS, and JavaScript. The calculator displays numbers and operators correctly, but when I press the "=" button to evaluate the expression, I ...
-1
votes
2
answers
83
views
I keep getting this "unrecognized operation" whenever i need to use the "?"
I'm writing a program in Python for a calculator, and I'm trying to implement a history system. However, when I need to access the history, I use the symbol to access it, but it keeps telling me that ...
-1
votes
1
answer
39
views
why infinite loop isn't working on this calculator project in hcf section?
whenever i use hcf in this calculator code infinite loop won't work but in other operations like +-*/% infinite loops works fine.how do i solve it?which should i write to allow infinte loop working ...
-1
votes
1
answer
39
views
How to write this code so that it takes into account selected option in dropdown list?
image file - Price calculator
Hi. I am new to coding and started to write the code for my air conditioning price calculator. The code is currently looking like this:
var input1 = document....
-3
votes
1
answer
55
views
" java.lang.ClassCastException: android.widget.Button[] cannot be cast to android.widget.Button" i find this issue in runtime in android kotlin
java.lang.ClassCastException: android.widget.Button[] cannot be cast to android.widget.Button at &...
1
vote
0
answers
91
views
Is there a way to program a function into a TI-84 which takes an inline parameter, calculates a return, and substitutes that the result in that line?
I want to create a program in my TI-84 that allows me to quickly generate unit complex-numbers given an angle x (that is, generate cos(x) + isin(x)), essentially so I can do 2 dimensional vector math ...
0
votes
0
answers
170
views
How to create pickup Distance Calculation miles pricing in WordPress
I am trying to pick up Distance Calculation miles pricing in WordPress but I have not succeeded yet. any help would be appreciated.
Here is my code. but I don't know what is wrong with my code.
HTML ...
1
vote
0
answers
61
views
How to Handle Nested Square Roots and Expressions in a Scientific Calculator App?
I'm developing an Android app called "Scientific Calculator" with Jetpack Compose, and I've successfully implemented the square root operation for simple cases like √4 and √4*2. However, I'm ...
1
vote
2
answers
102
views
Finding the total numbers between values in TI nspire spreadsheets
I am using TI-nspire spreadsheets
I want to find the number of values that are greater than 5 and less than 10
the numbers are stored in a column called "data" and also in cells A1 to A5
the ...
0
votes
1
answer
119
views
HP Prime Draw Image with Python
I would like to play a video (with python) on my HP Prime G2. I know this sounds stupid but please.
So, I already converted the video to a list of pixels but I realise that drawing the pixels one by ...
0
votes
0
answers
34
views
How can display the result of my HTML/JS code? [duplicate]
I wanted to create Js calculator,so I got a problem with displaying the results of my code on textarea.
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8"&...
0
votes
1
answer
109
views
AWS Route Calculator API/ Here Maps
I am using AWS Location Services Route Calculator to determine travel time and travel distance of several origin destination pairs. The code is working but it is not reflecting travel delay due to ...
0
votes
3
answers
85
views
Textbox in calculator not updating when button clicked
This code is working fine to develop the GUI but whenever I click a button on GUI, nothing happens, no changes occur to textbox. I checked if the functions are being called by using print statements ...
1
vote
2
answers
135
views
simple calculator program exiting unexpectedly after input (C, MinGW)
'm trying to write a basic calculator program in C using MinGW. However, the program exits unexpectedly after I enter the operator (+, -, *, or /). I've checked for common errors like missing return 0;...
0
votes
3
answers
97
views
Cannot get the clear button to work within my calculator
I've just gotten into programming and I tried to figure out how to create a calculator using tkinter and I couldn't for the life of me get the clear button to work. Every other button works, but the ...
1
vote
1
answer
104
views
Why GCP calculator asked me to specify region when using GLOBAL cloud balancer?
I have this architecture:
One backend with two MIGs with different regions, asia-southeast and europe-central.
When I want to calculate Cloud Load Balancer in GCP, it asked me to specify the REGION ...
1
vote
1
answer
48
views
I don't know how it works to execute events when clicking buttons on a calculator from a code I found
I found this calculator code on Github and wanted to know how it works to execute events when clicking buttons.
The "button_click" method appears in the code, but I don't understand how it ...
1
vote
1
answer
124
views
How can i add a negative number to the displayArray?
I am trying to create a calculator and unable to calculate negative numbers because my current logic splits displayValue which is a string using regular expressions(Regex) to separate numbers and ...
-1
votes
1
answer
62
views
Code for calculating large numbers. Please rate if there are any unnatural parts [closed]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int compare(char* num1, char* num2) {
int length1 = strlen(num1);
int length2 = strlen(num2);
if (length1 <...
1
vote
1
answer
68
views
The result of my assembly language code is 0 and there's an error on division
I tried to make calculator using assembly language, here is my code:
.model small
.stack 100h
.data
greeting db 'WELCOME TO YOUR CALCULATOR', 0Dh, 0Ah, '$'
menu db '1 - ADDITION', 0Dh, 0Ah, '...
1
vote
2
answers
61
views
Create a variable price calculator where more hours = more discount | Google Sheets
I want to be able to enter a single variable of 'hours' and return a result of 'price' where more hours = higher discount
Here is my sheet with the % discount:hours = price
https://docs.google.com/...
1
vote
1
answer
44
views
error in displaying result and executing the chosen arithmetic operation
.model small
.stack 100h
.data
greeting db 'WELCOME TO YOUR CALCULATOR', 0Dh, 0Ah, '$'
menu db '1 - ADDITION', 0Dh, 0Ah, '2 - SUBTRACTION', 0Dh, 0Ah, '3 - MULTIPLICATION', 0Dh, 0Ah, '4 - ...
1
vote
2
answers
72
views
How can i make my code rerun after Ending?
switch(choice) {
case 1:
double sum = 0;
for (int i = 1; i <= 5; i++) {
System.out.println("Enter " + i + "th number: ...
0
votes
1
answer
59
views
Click event doesn't happen until I click the button 2-3 times
I am writing a calculator for ADHD medication dosages. However, when I press "Convert!" I have to click it several times for the placeholder text to appear. What's going on? Nothing I try ...
1
vote
1
answer
54
views
How to add math function without eval to basic calculator
Per the Odin Project's instructions, I need to make my basic calculator operate via math functions rather than using eval(). https://www.theodinproject.com/lessons/foundations-calculator
I've only ...
0
votes
1
answer
108
views
making a simple calculator but the input is in one line (newbie)
package kotauto;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.concurrent.TimeUnit;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;...
-1
votes
1
answer
69
views
Assembly Intel 8086 64-bits operands calculator
Please I need the full program of a calculator that calculates the sum, the subtraction, the multiplication, and the division of 2 operands 64 bits each.
Because the registers in 8086 microprocessor ...
0
votes
0
answers
58
views
How to count the number of students from each course from the mysql database?
So, I want to make a calculator that will calculate this formula:
Result = No. of Attendance / (No. of Students * No. of School Days)
but I want the No. of students to be counted automatically by ...
-1
votes
1
answer
59
views
keyboard event argument despite being 'Enter', is not 'Enter' [duplicate]
While trying to expand the interface of my JS calculator project, I decided to add a keyboard interface so that you can write directly in the input box with your keyboard. I also decided to have an ...
0
votes
1
answer
47
views
Incorrect macro calculations with Bing API key: Correct distance from 36088 to 10117, but incorrect back calculation
I have a problem with my macros that use a Bing API key to calculate the distance between the postal codes 36088 and 10117. The calculation from 36088 to 10117 (436.809 km) is correct, but the ...
0
votes
0
answers
52
views
Why does the horizontal scrollbar move the labels to the leftside?
I've encountered a problem in my code with CTkScrollableFrame and labels.
I am working on a calculator application using custom tkinter. The calculator is divided into 2 frames - display and buttons. ...
0
votes
1
answer
50
views
how to add scrollbar to expression label on my calculator or to make the expression become small as my expression expands on calculator
I'm new at python and currently learning GUI tkinter in python, I am very much inspired by the code of a tic-tac-toe game and thought that what if I could make calculator out of it, so I tried and ...
-1
votes
1
answer
83
views
How do I find formula used in html calculator
I have searched and unable to find formula for this calculator.
https://www.saltyunderground.com/support/berghia-calculator.html
Open source page and locate formula then use to create custom ...
1
vote
3
answers
129
views
The first column of my table seems to be pushing the other 2 columns to the right and i cant change it
I want all the columns to be together towards the left side of the table, but nothing i do is able to change the gap between the first column and the second(and third) columns. How do i fix this?
<...
0
votes
1
answer
96
views
X is not defined but x has been defined
I am writing a program for the ti-84 using python. It is designed to get a differential equation from the user, process it, and draw a slope point field for that equation.
The part that is giving me ...
-3
votes
1
answer
62
views
Java Calculator Not Working - Need Help Troubleshooting ( Computer Science Beginner ) [closed]
I've written a simple calculator in Java that takes user input for two numbers and an operator. It's supposed to perform the corresponding mathematical operation and output the result. However, my ...
0
votes
1
answer
144
views
How can I round numbers with three or more digits after the decimal point accurately?
I am in the process of developing a cart system, and encountered some challenges with rounding certain amounts during calculations. Below are the details of my cart.
itemPrice = 0.99;
itemQuantity = ...
-1
votes
2
answers
732
views
I'm getting an unknown error in my c++ project? Cant figure out whats wrong
My goal is to make a calculator in c++. I'm using Visual Studio Code. The calculator will include calculation order (First parantheses, then * and /, then + and -). In the terminal you write an ...
1
vote
1
answer
450
views
Triple input redirection symbol in bash script [duplicate]
I saw a code like this that could be run on the bash prompt: bc fibonacci.bc <<< "fibonacci(1)"
A function fibonacci(n)is defined in the file fibonacci.bc. The syntax of the ...
0
votes
1
answer
118
views
Calculate an expression in java which is accurate upto 19 digits
I have an expression in string for example
formula="333333333333333333+222222222222222222"
I am trying to calculate the value of the expression to be accurate upto 18 digits.
to calculate I ...
0
votes
0
answers
24
views
Why am I not able to access the meanings API? [duplicate]
I am trying to access the "meaning" from this API link, but every time it does not return anything? API link:https://api.dictionaryapi.dev/api/v2/entries/en/hello
<div class="word-...
0
votes
2
answers
285
views
How to add, subtract, multiply and divide two or more negative numbers on a Javascript calculator
I am new to Javascript and built a basic calculator. I want to add a function that allows me to input negative numbers using a toggle feature. However, when I try to use it, it only makes the first ...
0
votes
1
answer
57
views
how to store number to calculate in tkinter
I've been trying to create a calculator using tkinter but I got a problem in storing numbers so that I can calculate using operators.I tried to store the value in number but when I press the = key the ...
1
vote
2
answers
204
views
Shunting Yard Algorithm Based Scientific Calculator [closed]
I'm developing a scientific calculator in android studio using java. I have used Streatergy Design Pattern for handling operations as well as Shunting Yard Algorithm for the calculate function where ...