Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-09-2008
Member
 
Join Date: May 2008
Posts: 32
Calculators in C++

I placed the sources of 2 calculators made by me in C++
with each iteration while, or preconditioned, the other will continue to do (hence the postconditioned) and for.
For simplicity the first one written is better, but for quality of the code, the second is more reliable. Even if it is still Spartan, I made in 10 minutes.

This is the second calculator
Code:
# include   void main () (float difference, division, product, the sum, i, a, b, n, choice, cont; do (/ / parenthesis do court << "Choose an action to make \ n"; court << "1-Addition 2-Stealing 3-Multiplication 4-Division 5-Exit \ n"; cin>> choice; court << "\ nChoose the number of operandi"; cin>> n; if (choice == 1) ( for (cont = sum = 0; cont   >; sum + = a;) court << "The sum and '" <   >; difference-= a;) court << "The difference and '" <   >; product *= a;) court << "The product and '" <   >; court <   > b; product *= b;) = a division / product; court << "The product and '" <
Reply With Quote
  #2  
Old 08-09-2008
Member
 
Join Date: Feb 2008
Posts: 1,848
It is only recently that I did java and C++. I have not ever seen (although very similar, given that the java is a derivative), but it seems to me that in the second calculator, there is lacking some line of code .. or mistake?

However with a little patience, the first you can easily transform from "Spartan" to "finished".
Reply With Quote
  #3  
Old 08-09-2008
Member
 
Join Date: May 2008
Posts: 32
Quote:
Originally Posted by MindSpace View Post
It is only recently that I did java and C++. I have not ever seen (although very similar, given that the java is a derivative), but it seems to me that in the second calculator, there is lacking some line of code .. or mistake?
Mmmm......is not incomplete

Quote:
Originally Posted by MindSpace View Post
However with a little patience, the first you can easily transform from "Spartan" to "finished".
Will not happen ever. Spartan mean that lack the type operations breast, cosine, tangent, root, powers etc.... I just made to test the cycle do while associated with.
Reply With Quote
  #4  
Old 08-09-2008
Member
 
Join Date: Apr 2008
Posts: 1,948
Eh, i have never tried this programming in C++. Certain aspects of CMQ x resembles the Pascal.

congratulations
Reply With Quote
  #5  
Old 08-09-2008
Member
 
Join Date: May 2008
Posts: 32
Yeah, most of them are all equal. I also know the pascal. But to be more than nice is more complicated and has lot more features. But it is very easy to learn knowing C++.
Reply With Quote
  #6  
Old 24-09-2008
kelly123
 
Posts: n/a
I don't know for sure what kind of calculator you are using but if it is a TI version this will work in your program it should ask for your inputed numbers then save them...

Example:

1. Prompt x, y
2. x+y→e
3. disp e

disp e makes it display e to the screen. the → makes it store the answer to the variable e...it should be the same for most calculators most of these functions are under the catalog section.

Last edited by Yogesh : 24-09-2008 at 01:53 PM. Reason: External links removed.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Calculators in C++"
Thread Thread Starter Forum Replies Last Post
How to add calculators for the Linux desktop Edwards Operating Systems 5 20-01-2010 06:47 AM


All times are GMT +5.5. The time now is 12:00 AM.