C 语言编程-重访底层语言(夯实基础1.2什么是计算Machine语言Machine。我想把这个问题存成c 语言,根据物理学的知识,我知道下面的换算公式:例3.2计算 -0利息,存款年利率/。
# include # include # includeusingnamespacestd;classinterestacculator { public:intm _ mode;//inmonthoryeardoublem _ Principal可以按年或月计算;doublem _ Rate//rate in %;unsignedintm _ Periodsinterest calculator(double principal,
intmode,unsignedintperiods){ m _ principal principal;m _ rate/100.0;m _ modemodem _ Periodsperiods} ~ interest caculator(){ } doubleCaculate(){ m _ totalIncomem _ Principal * powl((1 m _ Rate),
2、请用c 语言编写一个输入本金,存期(年程序相当简单。我就不给你写了,试着自己写。# include # includeintmain(){ doublem,sumintyearscanf(%lf,