150 Topics

Member Avatar for
Member Avatar for L7Sqr

Hello. This code snippet is a basic calculator. The general concept is that the calculator accepts infix expressions as strings, converts them to reverse polish notation by way of the shunting-yard algorithm and then evaluates the resulting expression. I tried to encapsulate the functionality of each piece so that, in …

Member Avatar for happyuk
2
6K
Member Avatar for darylglenng

>equal button wont work =( /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package calculator; /** * * @author Gatongay Famiglia */ public class NewJFrame extends javax.swing.JFrame { double plusminus; double firstDouble; double secondDouble; double totalDouble; int plusClick; int …

Member Avatar for M4trixSh4d0w
0
316
Member Avatar for aabbccbryanmark

hi folks, im having a problem here on my code can't figure what's wrong.. so here's my code: import java.awt.*; import java.awt.Font.*; import java.awt.Color.*; import java.awt.Button.*; import java.awt.event.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.*; import javax.swing.JOptionPane; public class Calc extends JFrame implements ActionListener { JTextArea txtArea; static final …

Member Avatar for stultuske
0
545
Member Avatar for fazae

import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Calculator extends JFrame{ // Declare GUI components private JTextField jtfFirst; private JTextField jtfSecond; private JTextField jtfResult; private JLabel jlblFirst; private JLabel jlblSecond; private JLabel jlblResult; private JPanel entryPanel; private JPanel buttonPanel; private JButton jbtAdd; …

Member Avatar for fazae
0
229
Member Avatar for JordanSimps

I kind of have an idea what to do, but I can't figure it out. The program needs to be able to get the students name and three test scores, then get the average score (percentage) out of the three scores. After that, you need to convert the score (percentage) …

Member Avatar for vegaseat
0
253
Member Avatar for greatman05

First off, this is a homework assignment. I am in a Software Engineering class and we're learning how to work with MFC. We're editing a basic calculator app. I don't know how to implement the backspace button (delete a single character from the edit box when the Backspace button is …

Member Avatar for Ancient Dragon
0
316
Member Avatar for RockJake28

I have this code so far #Add two digits def add(a,b): return a+b #Subtract two digits def sub(a,b): return a-b #Multiply two digits def mul(a,b): return a*b #Divide two digits def div(a,b): return a/b #returns an integer that the user enters def getCommand(): cmd = input("Choose: ") return cmd #Execute …

Member Avatar for Lardmeister
1
216
Member Avatar for teckforce

I was wondering the best way to implement a square root button. Below has everything from 0-9, the four functions, and a decimal and clear function. Dim valueOne As Single Dim valueTwo As Single Dim operation As Integer Dim answer As Single Private Sub Button1_Click(ByVal sender As System.Object, ByVal e …

Member Avatar for teckforce
0
247
Member Avatar for markwiering

**Hello everybody!** My program which is able to calculate your age, has been **updated!** See http://www.daniweb.com/software-development/cpp/threads/432997/age-calculator for the old version. The programs asks your **birthdate** and the **current date**. With that information, the program is able to calculate your age. It calculates the years, months and days. This program is …

Member Avatar for innocentmeshi
0
467
Member Avatar for binaryjc

Hello Internet. So the task is to create our own parser for a expression calculator. For Example: Input: 3+2*1-6/3 Output: 3 Input: 3++2 Output: Invalid Expression Input: -5+2 Output: -3 Input: 5--2 Output: 7 The code [Here](http://www.technical-recipes.com/2011/a-mathematical-expression-parser-in-java/) solves a part of the problem except that it has a fixed input …

Member Avatar for Taywin
0
5K
Member Avatar for GokuLSSJ4

hello people I just started to learn C++ 3 days ago, I am just 13 yrs old I have made this basic maths utility tool or you can call it a calculator but it tells everything, multiplication, division, addition, subtraction at once. // if you could help me with it …

Member Avatar for GokuLSSJ4
0
330
Member Avatar for Sumal

I wanted to convert this segment of code into something slightly different package expression; import java.util.*; public class Expression{ /* * Strings used for storing expression. */ String s, x; /* * Term evaluator for number literals. */ double term(){ double ans = 0; StringBuffer temp = new StringBuffer(); while( …

Member Avatar for JamesCherrill
0
210
Member Avatar for Sumal

**Can some one please help me with this ?** import java.util.*; public class Expression{ /* * Strings used for storing expression. */ String s, x; /* * Term evaluator for number literals. */ double term(){ double ans = 0; StringBuffer temp = new StringBuffer(); while( s.length() > 0 && Character.isDigit( …

Member Avatar for NormR1
0
309
Member Avatar for xikhari.some1behindu

I am currently working in a Statistics Calculator which should display mean, standard deviation, median and mode. I have the graphical interface ![Sin_título](/attachments/large/4/Sin_título.png "Sin_título") This one has a text box where you get to write the list and by clicking the button it stores the fist value and goes to …

Member Avatar for xikhari.some1behindu
0
235
Member Avatar for conanzz

I`ve done all the work and the numbers appear in the textbox, but when I press equl it does not give the result! Protected Sub EqlBtn_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EqlBtn.Click If txtentr.Text.Length > 0 Then Select Case Vals Case 1 ' txtentr.Text = Store / …

Member Avatar for conanzz
0
193
Member Avatar for Bowdown28

Hello, I am new to using windows form application in c++ and i am having a problem with making my program work. I have three textBars and one button. The first textBar is for the user to input a double. When the button is pressed i want it to perform …

Member Avatar for Ancient Dragon
0
337
Member Avatar for sofy

not sure if this is the right place to ask, but i need some help for my problem here. i want to find inverse, upper triangular and determinant for a matrix. but i'm not sure why it doesn't work like what i want. for now, i just want try to …

0
109
Member Avatar for sonash

how to retain previous value of textbox and input new value in same textbox.please help me .i am tyring to make a calculator programm in php only withh all buttons etc .

Member Avatar for sonash
0
203
Member Avatar for yearby

So I'm having some problems with my code here. and I'm not sure whats wrong. Im following a textbook on how to do it and this is basically the same format that they have for a random number function. Any feedback is appreciated. <html> <head> <title> Grades </title> <script type="text/javscript"> …

Member Avatar for dcdruck
0
5K
Member Avatar for lloydy76

Hi there, im new to c# and have been trying to create a calculator without a switch statement, using the operator 'op' as a variable, but i cannot get it to work, here is my current code: [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; …

Member Avatar for samsylvestertty
0
5K
Member Avatar for godinu

Hello, I need something quite similar to the script that eventually loads in the main area here: http://www.discmakers.com/livequote/ -- I'm looking for a way to allow the user to input type of jewel case, packaging, quantities, etc. I like the way this example has drop-down menus for the user to …

Member Avatar for godinu
0
217
Member Avatar for kishpopboy

hi! im currently creating a payroll system for my project and part of it is a time calculator. but my problem sir is that i don't know how to deduct lates on there daily hour .. its goes this way sir, it has a textbox that has their schedule that …

Member Avatar for adam_k
0
491
Member Avatar for intelnf09

I am not sure if I am doing this correctly since it has been awhile since I last used Daniweb. I need some help with the code that I have submitted and am getting the following two errors. I am new to java and not sure of what to do. …

Member Avatar for NormR1
0
1K
Member Avatar for 1234qwerty

Hey, i have to finished a cacluator, all my code seems to be working apart from the equals button and i do not understand why..i've tried several different things such as a case too but nothing seems to work to get the equals button working..please help!! This is my code, …

Member Avatar for TwijoO
0
161
Member Avatar for Erwin_Rosyid

I'm coding a calculator with display and controlls in separate forms. I've hit a block on several bugs but the most promenient one is: - The calculator couldn't process more than ONE operator (2+2=OK but 2+2+2=4=NOT OK) - sqrt function is quite broken [Sollution and related files (VC# 2010)](http://www.mediafire.com/?fpwt38lohw98n4o) It's …

Member Avatar for Erwin_Rosyid
0
114
Member Avatar for tauqeer ahmed
Member Avatar for Evesy

I'm making a standard form calculator (e.g. 7 x 10^5) and I need help thinking of the best method to use. I basically need the program to take the number/input (say 70000) and then see what multiple of 10 it divides by to give a number between 1 and 9. …

Member Avatar for thines01
0
130
Member Avatar for yuyumerry

i got problem when i clicl the checkbox 0r radiobutton..when i compile there is no error..and also how can i put the background image at my gui??hope you guys can help me.. import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.text.*; import java.text.DecimalFormat; import javax.swing.border.*; import java.awt.GridLayout; import java.awt.FlowLayout; import java.awt.BorderLayout; …

Member Avatar for yuyumerry
0
359
Member Avatar for mkaynutty

So basically this is suppose to be a grade calculator and the program works, I now just have to put it into a do-while loop so it can work for more than one student. My professor wants it to say Y for another student and N to quit at the …

Member Avatar for doma18
0
190
Member Avatar for cameronchuck

Hi! I am trying to write calculator in c++ that takes an infix expression, converts it to postfix, and calculates. I have the code that will do this written, but when I try to turn it into a class it gives my a Segmentation Fault. Here is my code... [CODE=c++]//calc.h …

Member Avatar for histrungalot
0
3K

The End.