欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    c语言详解第五版第四章程序设计项目答案Word文档格式.docx

    • 资源ID:5185174       资源大小:18.87KB        全文页数:22页
    • 资源格式: DOCX        下载积分:3金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    c语言详解第五版第四章程序设计项目答案Word文档格式.docx

    1、system(pausereturn(0);void instruct_purchase(void)printf(This program figure a total bill.The tax rate is $%.2f.n,tax_rate);The discount of total purchase which is more than 100 dollars is $%.2f.n,discount_1);The discount of total purchase which is less than 100 dollars is $%.2f.n,discount_2);Please

    2、 press or button after typing in each number.nnndouble total(double total_purchase,char a)double discount_total,total_payment,tax;if(a=t) if(total_purchase100) discount_total=total_purchase*discount_1; tax=total_purchase*tax_rate; total_payment=total_purchase+tax-discount_total; else discount_total=

    3、total_purchase*discount_2;else tax=total_purchase*tax_rate; total_payment=total_purchase+tax;return(total_payment);3.罗盘的度数换算为罗盘的方位。void direction(double angle_degree);double angle_degree; printf(Please enter the angleof the total station. scanf(angle_degree);The angle of the total station is %.2f?.n

    4、nn,angle_degree); direction(angle_degree); system( return(0);void direction(double angle_degree)double angle; if (angle_degree=0) printf(The direction is east(E).nnif(0angle_degree&angle_degree90)The direction is north(N) %.2f east(E).nnif (angle_degree=90)The direction is north(N).if(90180) angle=1

    5、80-angle_degree;The direction is north(N) %.2f west(W).nn,angle);if(angle_degree=180)The direction is west(W).nnif(180270) angle=angle_degree-180;The direction is south(S) %.2f west(W).nnif(angle_degree=270)The direction is south(S).nnif(270fa);color(fa);void color(char fa)switch(fa)case O: case oTh

    6、e color suggest the content is ammonia gas.nn break;case BbThe color suggest the content is CO.nnYyThe color suggest the content is hydrogen.nnGgThe color suggest the content is oxygen.nndefault:There is not the container.5对地震的理氏数进行描述。void Richter_scale(double a);double a;Please enter the Richter sc

    7、ale of the earthquake.Richter_scale(a);void Richter_scale(double a) if(a0&a5.0)破?坏很小?或者?没?有D.nelse if(a=7.5)大部?分被There is not this magnititude of earthquake.n(2)switch函数编写char Richter_scale(double a);void sf(char b);char b;b=Richter_scale(a);sf(b);char Richter_scale(double a) char c;if(a c=A; return

    8、(c); CDE=0)Fvoid sf(char b)switch(b)D。break;。屋Y和无T该?地震e等级?6.判断一个点在哪个象限void quadrant(double a,double b);double a,b;Please enter the coordinate of the dot.%lf %lfa,&b);quadrant(a,b);void quadrant(double a,double b)if(a=0&b!(%.2f,%.2f) is on the y axis.n,a,b);if(a!=0&b=0)(%.2f,%.2f) is on the x axis.nb

    9、0)(%.2f,%.2f) is in quadrant.nb(%.2f,%.2f) is in the quadrant .nif(a%d %d %dyear,&month,&day);e=leap(year);order(year,month,day,e);int leap(int year)int a,b,c,d;a=year%4;b=year%100;c=year%400; if(a=0&b=0)|c=0) d=1; d=0;return(d);void order(int year,int month,int day,int e)int dayth;if(e=1) if(month=

    10、1) dayth=day;This day is the %d day of %d year.n,dayth,year); if(month=2) dayth=31+day; if(month=3) dayth=31+29+day; if(month=4) dayth=31+29+31+day; if(month=5) dayth=31+29+31+30+day; if(month=6) dayth=31+29+31+30+31+day; if(month=7) dayth=31+29+31+30+31+30+day; if(month=8) dayth=31+29+31+30+31+30+3

    11、1+day; if(month=9) dayth=31+29+31+30+31+30+31+31+day; if(month=10) dayth=31+29+31+30+31+30+31+31+30+day; if(month=11) dayth=31+29+31+30+31+30+31+31+30+31+day; if(month=12) dayth=31+29+31+30+31+30+31+31+30+31+30+day; dayth=31+28+day; dayth=31+28+31+day; dayth=31+28+31+30+day; dayth=31+28+31+30+31+day

    12、; dayth=31+28+31+30+31+30+day; dayth=31+28+31+30+31+30+31+day; dayth=31+28+31+30+31+30+31+31+day; dayth=31+28+31+30+31+30+31+31+30+day; dayth=31+28+31+30+31+30+31+31+30+31+day; dayth=31+28+31+30+31+30+31+31+30+31+30+day;9.居民用电#define R_price 0.052#define C_price 0.045#define I_price_P 0.065#define I

    13、_price_NP 0.028void type_consumption(char type,double e_consumption);void R_consumption(double e_consumption);void C_consumption(double e_consumption);void I_consumption(double e_consumption);double e_consumption; char type;The alphabet R means reside,C means commercial,I means industry.Please enter the application type (R,C or I).type);Please enter the consumption of electricity.e_consumption);type_consumption(type,e_consumption);return 0;void type_consumption(char type,double e_consumption)if(type=RR_consumption(e_consumption);else if (type=C_consumption(e_c


    注意事项

    本文(c语言详解第五版第四章程序设计项目答案Word文档格式.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开