【计算机类职业资格】三级数据库技术-505及答案解析.doc

上传人:赵齐羽 文档编号:1321169 上传时间:2019-10-17 格式:DOC 页数:2 大小:30.50KB
下载 相关 举报
【计算机类职业资格】三级数据库技术-505及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】三级数据库技术-505及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、三级数据库技术-505 及答案解析(总分:100.00,做题时间:90 分钟)一、设计与应用题(总题数:1,分数:100.00)1.请编制函数 ReadDat()实现从文件 in.dat 中读取 1000 个十进制整数到数组 xx 中,请编制函数Compute()分别计算出 xx 中数值为奇数的个数 odd,xx 中所有奇数的平均值 ave1,并求出 xx 中数值为偶数的平均值 ave2 以及所有奇数的方差 totfc 的值,最后调用函数 WdteDat()把结果输出到 out.dat 文件中。 注意:方差变量必须采用双精度类型。 计算方差的公式如下: (分数:100.00)_三级数据库技术-

2、505 答案解析(总分:100.00,做题时间:90 分钟)一、设计与应用题(总题数:1,分数:100.00)1.请编制函数 ReadDat()实现从文件 in.dat 中读取 1000 个十进制整数到数组 xx 中,请编制函数Compute()分别计算出 xx 中数值为奇数的个数 odd,xx 中所有奇数的平均值 ave1,并求出 xx 中数值为偶数的平均值 ave2 以及所有奇数的方差 totfc 的值,最后调用函数 WdteDat()把结果输出到 out.dat 文件中。 注意:方差变量必须采用双精度类型。 计算方差的公式如下: (分数:100.00)_正确答案:()解析:int i;

3、for(i=0; i MAX; i+) if(xxi%2) odd+j avel+=xxi; else even+; ave2+=xxi; ave1/=1.0*odd; ave2/=1.0*even; /*根据方差的计算公式计算所有奇数的方差*/ for(i=0; iMAX; i+) if(xxi%2) /如果 xxi是奇数 totfc+=(xxi-ave1)*(xxi-ave1); /把(xxi-ave1)的平方累加到变量 totfc totfc/=1.0*odd; /变量 totfc 除以奇数的个数 odd,得到所有奇数的方差 解析 读取 1000 个数,奇数个数、平均值及方差,偶数个数及平均值。 通过审题可以发现本题仅一个不同点,即本题中要求计算的是奇数的方差,参考答案的第 1520 条语句。另外,本题给出的原程序中已经定义了 odd,因此在答案程序中不需要再次定义该变量。

展开阅读全文
相关资源
猜你喜欢
  • ITU-R S 481-2 FRENCH-1986 Measurement of noise in actual traffic for systems in the fixed-satellite service for telephony using frequency-division multiplex《使用频分多路传输的电话卫星固定业务中系统实际通.pdf ITU-R S 481-2 FRENCH-1986 Measurement of noise in actual traffic for systems in the fixed-satellite service for telephony using frequency-division multiplex《使用频分多路传输的电话卫星固定业务中系统实际通.pdf
  • ITU-R S 481-2 SPANISH-1986 Measurement of noise in actual traffic for systems in the fixed-satellite service for telephony using frequency-division multiplex《使用频分多路传输的电话卫星固定业务中系统实际.pdf ITU-R S 481-2 SPANISH-1986 Measurement of noise in actual traffic for systems in the fixed-satellite service for telephony using frequency-division multiplex《使用频分多路传输的电话卫星固定业务中系统实际.pdf
  • ITU-R S 481-2-1986 Measurement of Noise in Actual Traffic for Systems in the Fixed-Satellite Service for Telephony Using Frequency-Division Multiplex - Section 4C - Earth Station anten.pdf ITU-R S 481-2-1986 Measurement of Noise in Actual Traffic for Systems in the Fixed-Satellite Service for Telephony Using Frequency-Division Multiplex - Section 4C - Earth Station anten.pdf
  • ITU-R S 482-2 FRENCH-1986 Measurement of performance by means of a signal of a uniform spectrum for systems using frequency-division multiplex telephony in the fixed-satellite serv.pdf ITU-R S 482-2 FRENCH-1986 Measurement of performance by means of a signal of a uniform spectrum for systems using frequency-division multiplex telephony in the fixed-satellite serv.pdf
  • ITU-R S 482-2 SPANISH-1986 Measurement of performance by means of a signal of a uniform spectrum for systems using frequency-division multiplex telephony in the fixed-satellite ser.pdf ITU-R S 482-2 SPANISH-1986 Measurement of performance by means of a signal of a uniform spectrum for systems using frequency-division multiplex telephony in the fixed-satellite ser.pdf
  • ITU-R S 482-2-1986 Measurement of Performance by Means of a Signal of a Uniform Spectrum for Systems Using Frequency-Division Multiplex Telephony in the Fixed-Satellite Service - Steri.pdf ITU-R S 482-2-1986 Measurement of Performance by Means of a Signal of a Uniform Spectrum for Systems Using Frequency-Division Multiplex Telephony in the Fixed-Satellite Service - Steri.pdf
  • ITU-R S 483-3 FRENCH-1997 Maximum permissible level of interference in a television channel of a geostationary-satellite network in the fixed-satellite service employing frequency erv.pdf ITU-R S 483-3 FRENCH-1997 Maximum permissible level of interference in a television channel of a geostationary-satellite network in the fixed-satellite service employing frequency erv.pdf
  • ITU-R S 483-3 SPANISH-1997 Maximum permissible level of interference in a television channel of a geostationary-satellite network in the fixed-satellite service employing frequencyser.pdf ITU-R S 483-3 SPANISH-1997 Maximum permissible level of interference in a television channel of a geostationary-satellite network in the fixed-satellite service employing frequencyser.pdf
  • ITU-R S 483-3-1997 Maximum Permissible Level of Interference in a Television Channel of a Geostationary-Satellite Network in the Fixed- Satellite Service Employing Frequency Modula《调.pdf ITU-R S 483-3-1997 Maximum Permissible Level of Interference in a Television Channel of a Geostationary-Satellite Network in the Fixed- Satellite Service Employing Frequency Modula《调.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1