150 Topics
|
|
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 … |
|
>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 … |
|
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 … |
|
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; … |
|
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) … |
|
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 … |
|
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 … |
|
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 … |
|
**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 … |
|
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 … |
|
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 … |
|
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( … |
|
**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( … |
|
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 … |
|
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 / … |
|
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 … |
|
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 … |
|
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 . |
|
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"> … |
|
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; … |
|
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 … |
|
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 … |
|
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. … |
|
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, … |
|
|
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 … |
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. … |
|
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; … |
|
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 … |
|
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 … |
The End.