VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 13:02:14 07/03/01 Tue
Author: Wayne
Subject: Re: c++ builder 5 calculator
In reply to: desmond dekker 's message, "c++ builder 5 calculator" on 13:57:46 03/20/01 Tue

>wayne, i found your website looking for some c++
>builder examples. i have to make a calculator using
>c++ builder 5. I wanted to see if you can give me some
>tips on how to do it, i saw the tutorial you have on
>delphi, it helped me out, but i still have some
>questions. i know about loops, arrays, etc. the basics
>of any programming language, but have never worked
>with object oriented languages, such as builder. if
>you have any tips you could provide i would greatly
>appreciate it.
>thanks
>dd

Hi Desmond,

I'm glad my Delphi Calculator has helped you a little bit. You will be surprised how similar it is to using C++ Builder, because they both use the same basic VCL (Visual Component Library).

Basically, you should use buttons on the main form. Each button have numerous event handlers; these occur when an even on the button occurs. For example, when you click on a button, the OnClick event occurs.

Therefore, in a calculator, the user is going to press these buttons a lot, to add, subtract, multiply etc. Each time a button is pressed the OnClick event is called, and you place your code there. My Delphi tutorial should present the main ideas of this.

In the case of a calculator, just think of a real calculator in your hand. When you enter a number, what happens in the calculator? It's stored in a variable, which can then be worked on with other variables and arithmetic procedures. If you follow my tutorial, but change the syntax of the language, it will work fine.

As for thinking in pure OOP, a calculator is not a very good modal. A good instance of an OOP modal would be an airport say, where there are 'airplanes', 'pilots', 'airports', 'runways', 'passengers' and so on, each which are objects that can perform routines.

Anyway, good luck!

Write back if you need any more advice.

Wayne Broadley
Webmaster

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


Post a message:
This forum requires an account to post.
[ Create Account ]
[ Login ]
[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.