How do you build the dot in calculator.

Closed Thread

Join Date: Jul 2005
Posts: 5
Reputation: paladin4service is an unknown quantity at this point 
Solved Threads: 0
paladin4service paladin4service is offline Offline
Newbie Poster

How do you build the dot in calculator.

 
0
  #1
Aug 8th, 2005
I am trying to build a scientific calculator. However, I have two major problems.

1. The decimal to separate the tens from the tenth

2. Modulus which outputs the remainder of the division of two numbers.

Remainder = dividend – quotient * divisor;

I can get the rest, but I am having problems on how to input these into programming. If anyone knows how to use this for Visual C++.net, please help. Also, I am using GUI (Graphics User Interface). I am suppose to build a modulus button.
Quick reply to this message  
Join Date: Jun 2005
Posts: 62
Reputation: freemind is an unknown quantity at this point 
Solved Threads: 1
freemind's Avatar
freemind freemind is offline Offline
Junior Poster in Training

Re: How do you build the dot in calculator.

 
0
  #2
Aug 8th, 2005
I'm reading your post and I can't really get what the problem is, especially with the decimal.. The reminder you can find using the % operator. More information and details you can find here: http://www.intap.net/~drw/cpp/cpp03_04.htm
Quick reply to this message  
Join Date: Jul 2005
Posts: 5
Reputation: paladin4service is an unknown quantity at this point 
Solved Threads: 0
paladin4service paladin4service is offline Offline
Newbie Poster

Re: How do you build the dot in calculator.

 
0
  #3
Aug 9th, 2005
Originally Posted by freemind
I'm reading your post and I can't really get what the problem is, especially with the decimal.. The reminder you can find using the % operator. More information and details you can find here: http://www.intap.net/~drw/cpp/cpp03_04.htm
You know how a calculator has a dot( the period) to create a decimal system. When creating a calculator, how do you make the calculator recognize that the number is a decimal. It has to be more than just a dot coming out, right? The calculations has to recognize that the number is a decimal. I don't know how to put that in C++.

I made the calculator using GUI(Windows application systems). BUt, what do I do to make the decimal come out. LIke 12.25 multiply by 3.74, so that a decimal number comes out.

Also, thanks for the website. So, will C++.net recognize the modulus. So i was thinking like placing

output = op1( input of first number) % op2( input of second number)
textbox1::text-> output.string()

So, should this work. I mean, will it recognize the % as modulus.
Quick reply to this message  
Join Date: Jul 2005
Posts: 1,671
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 261
Lerner Lerner is offline Offline
Posting Virtuoso

Re: How do you build the dot in calculator.

 
0
  #4
Aug 10th, 2005
Many GUI programs don't recognize input as anything but strings. They validate the string input and then convert the string input into a type that is appropriate for calculations, do the calculations, then display the report again as a string. If that's the way your system works, then there are several options including strtod(), atoi(), stringstreams, sprintf(), etc. to perform the conversions once user has provided original input.
Quick reply to this message  
Join Date: Jul 2005
Posts: 5
Reputation: paladin4service is an unknown quantity at this point 
Solved Threads: 0
paladin4service paladin4service is offline Offline
Newbie Poster

Re: How do you build the dot in calculator.

 
0
  #5
Aug 11th, 2005
Thanks for the help! I actually got it by another way.
Quick reply to this message  
Join Date: Aug 2005
Posts: 31
Reputation: mugilan is an unknown quantity at this point 
Solved Threads: 0
mugilan mugilan is offline Offline
Light Poster

Re: How do you build the dot in calculator.

 
0
  #6
Aug 17th, 2005
can anybdy help on this question......write a program that uses a for statement to calculate and print the average of several integers. assume the last value read is the sentinel 9999. a typical input sequence might be.

10.....8......11.....7.....9.......9999
Quick reply to this message  
Join Date: Aug 2005
Posts: 15,152
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1437
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: How do you build the dot in calculator.

 
0
  #7
Aug 17th, 2005
Originally Posted by mugilan
can anybdy help on this question......write a program that uses a for statement to calculate and print the average of several integers. assume the last value read is the sentinel 9999. a typical input sequence might be.

10.....8......11.....7.....9.......9999
why are you hijacking this thread? create your own new thread.
Quick reply to this message  
Closed Thread

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC