|
查看: 1640|回复: 4
|
用C++->Windows Application 做一个Calculater出来...
[复制链接]
|
|
|
Q1. (SIMPLE CALCULATOR) Create a Dialog Box with the following layout:
A Dialog Box showing the calculation result view pop up when user press the button.

我的老师叫我们做,可是我都没idea..不知道要怎样下手。。 请大哥们帮帮我。。 我想学window application.. 之前有学过 C, C#, XNAGS, C++之类的。。我想知道怎样Get Input, build button in windows application.. |
|
|
|
|
|
|
|
|
|
|
发表于 28-9-2009 01:47 PM
|
显示全部楼层
原帖由 liccowee 于 27-9-2009 09:18 AM 发表 
我的 [老师] 叫我们做,可是 [我都没idea] ..不知道要怎样下手。。
上面我已经标示出你的问题所在。
do{
if(老师什么都没教,而你不懂,那是老师的责任,你应该去问老师怎么做,毕竟老师是有领薪水的)
{
你不明白 = true;
}
else if(老师有教而你不懂,那是你自己的错,你应该去再向老师请教,挨老师批是你该付出的代价,毕竟老师在教时你没听课,或者有听课却在不懂的时候没有向老师发问)
{
你不明白 = true;
}
}while(你不明白);
如果你还是不明白,那你将会在以上的loop里面轮回不得超生,明白了你就可以break loop了。
至于你该从哪里开始?再看看这段文字:“ (SIMPLE CALCULATOR) Create a Dialog Box with the following layout:”。
万丈高楼从地起,你连第一步都没跨出去,后面的计划谈得再多也枉然。就从那个GUI开始吧(毕竟你的programming背景如此辉煌多彩,没理由你连最基本的一个GUI也没办法做出来吧?),然后去了解那些components,例如你在Edit Box里面输入的数值储存在哪里?如何获得那些数值?如何把那些数值转换成你需要的格式?如何对应Button的event?诸如此类。 |
|
|
|
|
|
|
|
|
|
|
发表于 28-9-2009 03:15 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 28-9-2009 03:37 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 19-1-2010 09:55 PM
|
显示全部楼层
let me try help u...
first, create 3 textbox, 4 button name it as txt1,txt2,txt3,add,minus,multiply,divide
open form load,
keyin-->
int x,y;
int total;
txt1.text = x;
txt2.text = y;
txt3.text = total;
then
open add button type command :
x + y = total;
open minus button type command :
x - y = total;
open multiply button type command :
x * y = total;
open divide button type command :
x / y = total;
i dunno whether correct or not...u can hv a try |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|