如何使用C ++制作千瓦计算器? [英] how to make an kilowatt calculator using c++?

查看:109
本文介绍了如何使用C ++制作千瓦计算器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我使用Microsoft Visual 2008 C ++编写千瓦计算器程序吗?它总结了设备的用法.

Can anyone help me to make a program of kilowatt calculator using Microsoft Visual 2008 C++? It sums up the usages of appliances.

推荐答案

这只是乘法和和的问题.我想编码不会超过30分钟.
It is just matter of multiplications and sums. No more than 30 minutes of coding, I suppose.


好主意.不要忘记制作一个毫瓦,焦耳和额尔格计算器.英亩到平方米的计算器怎么样?如果没有摄氏和开尔文计算器,您将无法生存.哦,我差点忘了电子伏特计算器.还有一个纳米计算器.公里/秒计算器是必须的,更不用说毫米和厘米计算器了.别忘了问每种情况下的如何使用C ++制作这样的计算器"-开发原理将是如此不同!使用弧度计算器-您可能需要处理超越数字!即使是简单的毫秒或秒计算器,也需要专家的建议.处理60的因子可能是如此狡猾!我什至不敢提及亨利计算器,法拉德计算器或韦伯计算器.不要混淆Farad和microfarad计算器-它们相差如此之大,相差一百万! -他们将是完全不同的事情.不够?仍然没有足够的事情可以停下来思考一下吗?然后询问克和千克计算器;要特别小心盎司和磅-很难找出.您将获得许多有用的说明.

祝你好运,
-SA
Great idea. Don''t forget to make a milliwatt, Joule and Erg calculator. How about acre-to-square-meter calculator? And you simply cannot live without Celsius and Kelvin calculator. Oh, I almost forgot electron-volt calculator. And a nanometer calculator. A kilometer-per-second calculator is a must, not to mention millimeter and centimeter calculators. Don''t forget to ask "how to make such calculator using C++" in each case — the development principles will be so different! Take a radian calculator — you may need to deal with transcendent numbers! Even a simple millisecond or a second calculator will need an advice from experts; dealing with factors of 60 can be so crafty! I''m terrified even to mention a Henry calculator, a Farad calculator or Weber calculator. Don''t mix up Farad and microfarad calculators — they are so different, by a factor of million! — they will be completely different things. Not enough? Still not enough matter to stop here and think a little? Then ask about gram and kilogram calculators; be extra careful with ounces and pounds — there are so hard to figure out. You will get so many useful instructions.

Good luck,
—SA


double totalwatts;
for (int i = 0; i < appliance.count; ++i)
{
    double appwatts = appliance[i].wattsused;
    totalwatts += appwatts;
}
double kilowatts = totalwatts / 1000.0;
cout << "Total power used: " << kilowatts << endl;


会做到吗?


Will that do it?


这篇关于如何使用C ++制作千瓦计算器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆