Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Share Your Creations
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Share Your Creations Show your developed application to Basic4ppc community. Please include source code if possible.

Simple Calculator

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-01-2007, 01:07 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 623
Awards Showcase
Beta Tester 
Total Awards: 1
Default Simple Calculator

Well here it is, my attempt at a simple calculator.
Hope it's OK.

I've kept is simple and tried to keep the code to a minimum.
As normal it doesn't quite display the same on the desktop as it does on the device. The text on the buttons is larger on the desktop.

Regards,
RandomCoder
Attached Files
File Type: sbp PPC Calc.sbp (6.2 KB, 89 views)
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #2 (permalink)  
Old 11-01-2007, 04:48 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Simple is often better than complex (or overload).

But everyone should be aware: this attempt doesn't support the simpliest mathematical rules (calculate * or / before + or -).
2 + 3 * 4 results in 20 instead of the correct 14.

If I were in the jury of the competition, I would give zero points...

But I'm sure really can do it better...
Reply With Quote
  #3 (permalink)  
Old 11-01-2007, 05:06 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,734
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Non-scientific calculators do not obey these rules.
You can check for example the windows calculator in standard mode.
Reply With Quote
  #4 (permalink)  
Old 11-01-2007, 05:54 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

The basical calculator doesnt do the operation in the "matematical" order, but in the input order...
So does RandomCoder's, I give full points to it...
The rules stated "a working calculator" ( maybe not to the letter...), and this one is one!!
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #5 (permalink)  
Old 11-01-2007, 07:44 PM
taximania's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by RandomCoder View Post
Well here it is, my attempt at a simple calculator.
Hope it's OK.
I'm well impressed by it

The troubles with my last attempt at coding, and (Endemol), has sort of held/put me off coding, hence, I didn't even attempt a go at a calculator. I still can't believe I've got the code for a good app but it's

Nice one Random
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk
Reply With Quote
  #6 (permalink)  
Old 11-01-2007, 08:21 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Erel View Post
Non-scientific calculators do not obey these rules.
Ok, but I think we all are really basic4ppc scientifics. So the calculator should behave like one...
Reply With Quote
  #7 (permalink)  
Old 11-01-2007, 08:38 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I have to say that I dindt get around to code my calculator....Thougth I had some cool ideas, like skinneable, lcd display look, omong others...

I guess that waht you are trying to say is that we all expected a more "professional" aproch to the competition, but I have to say, that most of us code for fun, and only a few for money, and we can count by hand the ones that code for personal profit...

Competiotion is just a way of showing what we have learn, and see how other people deal with the "exact" same problem...

To me, anyone that could finish their calculator in time is a winner, as long as it gives 2+2=4
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #8 (permalink)  
Old 11-01-2007, 09:31 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
I guess that waht you are trying to say is that we all expected a more "professional" aproch to the competition
Yes.

Quote:
Originally Posted by Cableguy View Post
Competiotion is just a way of showing what we have learn, and see how other people deal with the "exact" same problem...
Agreed.

Quote:
Originally Posted by Cableguy View Post
To me, anyone that could finish their calculator in time is a winner, as long as it gives 2+2=4
Right.
But if we call it a competition, I think it should be possible to value an attempt. It was my personal view and as I said, I am sure that RandomCoder could do very, very much better.

If I made someone angry, especially you RandomCoder
specci48
Reply With Quote
  #9 (permalink)  
Old 11-01-2007, 11:09 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 623
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Specci48, my friend you have not angered me or anyone with your comments

I initially wanted to make my calculator work as Erel's example does, in that you write the expression in full and then hit solve and out pops a result.
This is how my Texas Calc does the job, but when I got stuck into writing the code I found that this was a much more complex task than I had first envisaged.

Most of my time is taken up with work, family and life, although I love to learn and attempt new things, therefore I just opted for a very simple (basic) calculator. Most of which was done during meal times at work.
I like the idea of a competition because it allows others (including myself) to see the many different ways there are of approaching a problem. This can only help to improve ones understanding of the language and the 'tricks' of the trade.

Please forgive my poor attempt at the competition but also understand that I only entered for fun and to show that I could also produce something that worked
I have a great deal of respect for everyone on this forum and would love to be able to code half as good as some of them

Regards,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
RPNCalc a simple scientific calculator klaus Share Your Creations 1 11-13-2007 12:26 PM
Simple RPN - Calculator token Share Your Creations 4 10-08-2007 12:40 PM
Resistor Capacitor Calculator Wizarda2z Share Your Creations 0 05-12-2007 06:29 PM
Distance Calculator PatrikL Share Your Creations 7 04-30-2007 05:15 PM
Binomial Calculator dlfallen Share Your Creations 0 04-30-2007 04:51 AM


All times are GMT. The time now is 11:37 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0