C15108课后测验

合集下载

(最新整理)东南大学08级C++(下)上机试卷和答案解析

(最新整理)东南大学08级C++(下)上机试卷和答案解析

(完整)东南大学08级C++(下)上机试卷和答案解析编辑整理:尊敬的读者朋友们:这里是精品文档编辑中心,本文档内容是由我和我的同事精心编辑整理后发布的,发布之前我们对文中内容进行仔细校对,但是难免会有疏漏的地方,但是任然希望((完整)东南大学08级C++(下)上机试卷和答案解析)的内容能够给您的工作和学习带来便利。

同时也真诚的希望收到您的建议和反馈,这将是我们进步的源泉,前进的动力。

本文可编辑可修改,如果觉得对您有帮助请收藏以便随时查阅,最后祝您生活愉快业绩进步,以下为(完整)东南大学08级C++(下)上机试卷和答案解析的全部内容。

东南大学08级C++(下)上机试卷D和答案解析(考试时间80分钟卷面成绩100分)学号姓名机位号说明:首先在Z盘建立一个以自己的学号命名的文件夹,用于存放上交的*。

CPP文件,考试结束前根据机房要求,将这个文件夹传送到网络服务器上,注意:提交时只保留文件夹中的CPP文件。

一、改错题(50分)【要求】调试程序,修改其中的语法错误及少量逻辑错误。

只能修改、不能增加或删除整条语句,但可增加少量说明语句和编译预处理指令。

【注意】源程序以“学号f1。

cpp”命名,存入自己学号文件夹。

【题目】以下程序实现动态生成数据成员,析构函数用来释放动态分配的内存,复制构造函数和复制赋值操作操作符实现深复制.【含错误的源程序】#include 〈iostream>#include 〈cstring〉using namespace std;class student{char *pName;public:student( );student( char *pname, int len );//错误1student( student &s );~student( );student & operator = ( student &s );} //错误2 student::student( ){cout >> ”Constructor”;//错误3pName = NULL;cout << "默认" << endl;}student::student( char *pname ){cout 〈< "Constructor";pName = new char[strlen(pname)+1];if ( pName ) strcpy( pName, pname );cout 〈〈 pName << endl;}student::student( student s ) //错误4{cout<<"Copy Constructor";if( s。

统计学第五版第八章课后习题答案

统计学第五版第八章课后习题答案

由Excel制表得:
由图可知:
已知:α= 0、05,n1 = n2=12
=31、75 =28、67 =10、20 =6、06 t=1、72 t∈(-1、72,1、72)接受,否则拒绝。 t=(31 、75-28、67)/(8、08* 0、41)=0、93 0、 93∈(-1、72,1、72)
决策:在α= 0、05得水平上接受 。
已知包重服从正态分布,试检验该日打包机工作就是否正常 ( α
=0、) 。 解:
如图所示:
本题采用单样本t检验。
:μ=100 :μ≠100基
本统计量:
α=0、05,N=9, =99、978,
S=1、2122, =0、4041 检验结果: t=-0、005,自由度f=8, 双侧检验P=0、996,单侧检验P=0、498
:μ≥700
:μ<700
∵α=0、05∴
=-1、645
计算检验统计量: =(680-700)/(60/6)=-2
决策: ∵Z值落入拒绝域,
∴在α=0、05得显著水平上拒绝 ,接受 。
结论: 有证据表明这批灯泡得使用寿命低于700小时,为不合格产品。
8、3 某地区小麦得一般生产水平为亩产250公斤,其标准差为30 公斤。现用一种化肥进行试验,从25个小区抽样,平均产量为270
决策:在 α= 0、05得水平上拒绝 。
结论: 服用阿司匹林可以降低心脏病发生率。
8、14 某工厂制造螺栓,规定螺栓口径为7、0cm,方差为0、03cm。 今从一批螺栓中抽取80个测量其口径,得平均值为6、97cm,方差为 0、0375cm。假定螺栓口径为正态分布,问这批螺栓就是否达到规 定得要求 (a=0、05)?
双侧检验

80c51单片机习题与解答

80c51单片机习题与解答
POPSP;(30H) →SP,(SP)=50H;(SP)-1→SP, (SP)=4FH
则:DPH=(),DPL=(),SP=()
答:DPH=3CH , DPL=5FH , SP=4FH
3-17:假定,SP=60H,A=30H,B=70H,执行下列指令:
PUSHAPUSHB
后,SP的内容为(),61H单元的内容为(),62H单元的内容为()。
答:程序、数据
3-10:在寄存器间接寻址方式中,其“间接”体现在指令中寄存器的内容不是操作数,而是操作数的()。
答:地址
3-11:下列程序段的功能是什么?
PUSHA
PUSHB
POPA
POPB
答:交换A、B的内容
3-12:已知程序执行前有A=02H,SP=52H,(51H)=FFH,(52H)=FFH。下述程序执行后:
000AHRET;2个机器周期
*向大地址转移:rel=目标地址-[源地址+02H]
*向小地址转移:rel=FFH+01H+{目标地址-[源地址+02H]}
答:
偏移量DL2=FFH+01H+[0004H-(0006H+02H)]=0FCH
偏移量DL1=FFH+01H+[0002H-(0008H+02H)]=0F8H
2-15:判断下列说法是否正确(对应新教材P24 12)
A、程序计数器PC不能为用户编程时直接使用,因为它没有地址。(不开放,无地址)
B、内部RAM的位寻址区,只能供位寻址使用,而不能供字节寻址使用。(也是20~2F的16个字节寻址区)
C、8031共有21个特殊功能寄存器,它们的位都是可以用软件设置的,因此,是可以进行位寻址的。(11个可字节寻址)

C语言程序设计(郑莉)课后习题答案

C语言程序设计(郑莉)课后习题答案

C++语言程序设计(清华大学郑莉)课后习题答案第一章概述1-1 简述计算机程序设计语言的发展历程。

解:迄今为止计算机程序设计语言的发展经历了机器语言、汇编语言、高级语言等阶段,C++语言是一种面向对象的编程语言,也属于高级语言。

1-2 面向对象的编程语言有哪些特点?解:面向对象的编程语言与以往各种编程语言有根本的不同,它设计的出发点就是为了能更直接的描述客观世界中存在的事物以及它们之间的关系。

面向对象的编程语言将客观事物看作具有属性和行为的对象,通过抽象找出同一类对象的共同属性(静态特征)和行为(动态特征),形成类。

通过类的继承与多态可以很方便地实现代码重用,大大缩短了软件开发周期,并使得软件风格统一。

因此,面向对象的编程语言使程序能够比较直接地反问题域的本来面目,软件开发人员能够利用人类认识事物所采用的一般思维方法来进行软件开发。

C++语言是目前应用最广的面向对象的编程语言。

1-3 什么是结构化程序设计方法?这种方法有哪些优点和缺点?解:结构化程序设计的思路是:自顶向下、逐步求精;其程序结构是按功能划分为若干个基本模块;各模块之间的关系尽可能简单,在功能上相对独立;每一模块内部均是由顺序、选择和循环三种基本结构组成;其模块化实现的具体方法是使用子程序。

结构化程序设计由于采用了模块分解与功能抽象,自顶向下、分而治之的方法,从而有效地将一个较复杂的程序系统设计任务分解成许多易于控制和处理的子任务,便于开发和维护。

虽然结构化程序设计方法具有很多的优点,但它仍是一种面向过程的程序设计方法,它把数据和处理数据的过程分离为相互独立的实体。

当数据结构改变时,所有相关的处理过程都要进行相应的修改,每一种相对于老问题的新方法都要带来额外的开销,程序的可重用性差。

由于图形用户界面的应用,程序运行由顺序运行演变为事件驱动,使得软件使用起来越来越方便,但开发起来却越来越困难,对这种软件的功能很难用过程来描述和实现,使用面向过程的方法来开发和维护都将非常困难。

大学C C++语言程序设计课后习题答案1-8(电子工业出版社 阳小华 马淑萍主编)

大学C C++语言程序设计课后习题答案1-8(电子工业出版社 阳小华 马淑萍主编)

习题答案习题1(参考答案)1.程序与算法的概念及二者的区别是什么?程序:为了实现特定目标或解决特定问题而用计算机语言偏写的指令序列,它由算法和数据结构组成。

算法:(Algorithm)是在有限步骤内求解某一问题所使用的一组定义明确的规则。

通俗地讲,就是计算机解题的步骤。

算法与程序的区别:计算机程序是算法的一个实例,同一个算法可以用不同的计算机语言来表达。

2.简述程序设计语言发展的过程程序设计语言经过最初的机器代码到今天接近自然语言的表达,经过了四代的演变。

一般认为机器语言是第一代,符号语言即汇编语言为第二代,面向过程的高级语言为第三代,面对象的编程语言为第四代。

3.简述高级程序设计语言中面向过程与面向对象的概念。

“面向过程”是一种以过程为中心的编程思想。

首先分析出解决问题所需要的步骤,然后用函数把这些步骤一步一步地实现,使用的时候依次调用函数即可。

一般的面向过程是从上往下步步求精,所以面向过程最重要的是模块化的思想方法。

“面向对象”是一种以事物为中心的编程思想。

面向对象的方法主要是将事物对象化,对象包括属性与行为。

面向过程与面向对象的区别:在面向过程的程序设计中,程序员把精力放在计算机具体执行操作的过程上,编程关注的是如何使用函数去实现既定的功能;而在面向对象的程序设计中,技术人员将注意力集中在对象上,把对象看做程序运行时的基本成分。

编程关注的是如何把相关的功能(包括函数和数据)有组织地捆绑到一个对象身上。

4.C语言程序的特点是什么?(1)C语言非常紧凑、简洁,使用方便、灵活,有32个关键字,有9种流程控制语句。

(2)C语言运算符丰富,共有45个标准运算符,具有很强的表达式功能,同一功能表达式往往可以采用多种形式来实现。

(3)数据类型丰富。

C语言的数据类型有整型、实型、字符型、数组类型、结构类型、共用类型和指针类型,而且还可以用它们来组成更复杂的数据结构,加之C语言提供了功能强大的控制结构,因而使用C语言能非常方便地进行结构化和模块化程序设计,适合于大型程序的编写、调试。

北海2024年10版小学五年级下册第8次英语全练全测(含答案)

北海2024年10版小学五年级下册第8次英语全练全测(含答案)

北海2024年10版小学五年级下册英语全练全测(含答案)考试时间:90分钟(总分:100)B卷考试人:_________题号一二三四五总分得分一、综合题(共计100题)1、听力题:A __________ is a geological feature that can attract tourists.2、听力题:A ______ is an area of land that drains into a river.3、What color is a ripe banana?A. GreenB. YellowC. RedD. Brown4、填空题:A sunflower is a type of _______ that grows tall.5、填空题:My family loves to ______ (旅行) during holidays.6、听力题:The main use of chlorine in water treatment is to kill ______.7、What color do you get when you mix red and white?A. PinkB. PurpleC. OrangeD. Brown8、填空题:The __________ (花匠) knows how to care for plants.9、填空题:The __________ was a major event in the history of the United States. (独立战争)10、听力题:The puppy is very ___. (adorable)11、填空题:I like to ride my ______ to school.12、What is the capital of Slovakia?A. PragueB. BratislavaC. BudapestD. Warsaw答案:B13、What do you call the main character in a book?A. AntagonistB. ProtagonistC. HeroD. Villain14、听力题:A ______ is a change that results in new substances being formed.15、填空题:In ancient Egypt, hieroglyphics were used for __________. (记录)16、Which planet is known for its rings?A. EarthB. MarsC. SaturnD. Neptune答案:C17、What do we call the study of the human body?A. BiologyB. AnatomyC. PhysiologyD. Psychology答案: B. Anatomy18、听力填空题:My favorite type of food is __________ because it makes me feel __________.19、What is the name of the smallest planet in our solar system?A. MercuryB. VenusC. MarsD. Pluto20、听力题:The ____ is a small mammal that loves to climb trees.21、What is the main ingredient in pasta?A. RiceB. WheatC. CornD. Oats答案:B22、What do you call a small, flying insect that is often a pest?A. MothB. FlyC. SpiderD. Beetle答案:B23、听力题:The gas released during photosynthesis is _____.24、听力题:A ______ is a substance that speeds up a chemical reaction.25、听力题:The chemical symbol for arsenic is ______.26、听力题:Hydrogen is commonly found in ______ compounds.27、填空题:A tree has _____ (叶子) that help it make food.28、填空题:There are many ________ (树木) in the forest.29、选择题:What do we call the place where we go to swim?A. PoolB. OceanC. LakeD. River30、选择题:What do you call a person who studies plants?A. BotanistB. BiologistC. EcologistD. Horticulturist31、填空题:The ancient Romans used __________ (拉丁语) as their language.32、填空题:I enjoy spending time with my ______ during holidays.33、填空题:Playing with _________ (玩具乐器) helps me learn about music.34、听力题:I can ______ (paint) a lovely picture.35、听力题:The chemical symbol for cesium is ______.36、听力题:The smallest unit of an element is called an _______.37、听力题:A ______ is a large, flat area of land at a high elevation.38、Which month has Halloween?A. OctoberB. DecemberC. NovemberD. September答案: A39、选择题:What is the name of the famous statue in New York Harbor?A. Christ the RedeemerB. Eiffel TowerC. Statue of LibertyD. Big Ben40、What do we call a person who studies animals?A. BotanistB. ZoologistC. BiologistD. Ecologist答案: B41、填空题:The _______ (狼) howls at the moon.42、填空题:The wallaby is a smaller ______ (袋鼠).43、填空题:The ferret is a playful _______ (动物).44、听力题:The ______ is a skilled musician.45、What is the capital city of Fiji?A. SuvaB. NadiC. LautokaD. Labasa46、填空题:Penguins live in ______ (寒冷) places and waddle when they walk.47、听力题:Coastal erosion is influenced by the action of ______.48、填空题:The ________ has thorns on its stems.49、填空题:The _____ (肥料) helps plants grow better.50、听力题:In a single displacement reaction, one element replaces another in a _____.51、What is the primary color of grass?A. BlueB. YellowC. GreenD. Red52、What do you call the study of living things?A. BiologyB. ChemistryC. PhysicsD. Geography答案: A53、What is the name of the famous American author known for his works on the Great Depression?A. John SteinbeckB. F. Scott FitzgeraldC. Ernest HemingwayD. Mark Twain答案: A. John Steinbeck54、听力题:My brother is a ________.55、听力题:The Earth's layers interact in various ______ ways.56、听力题:The _____ is the temperature of space.57、听力题:I enjoy ________ in the garden.58、填空题:I saw a ________ flying in the air.59、听力题:I can ___ (paint) a sunset.60、Which instrument has keys and is played by pressing?a. Guitarb. Drumsc. Pianod. Flute答案:c61、填空题:The ________ was a critical juncture in the history of gender equality.62、填空题:The _____ (盆栽) on my windowsill makes my room look bright.The __________ is essential for maintaining balanced ecosystems.64、听力题:My sister is learning to play the ____ (trumpet).65、听力题:The teacher is very ________.66、选择题:What do we call the part of a tree that grows above the ground?A. RootsB. StemC. LeavesD. Canopy67、听力题:The fruit is ___. (fresh)68、听力题:I want to _____ (go/stay) at home.69、填空题:My uncle is a __________ (国际关系专家).70、听力题:A saturated solution contains the maximum amount of dissolved ______.71、填空题:The __________ (维京人) explored many parts of Europe.72、填空题:历史上,________ (wars) 往往导致社会的巨变。

C语言程序设计项目化教程(周雅静第3版) 训练及综合练习答案 项目2 训练及作业参考答案

C语言程序设计项目化教程(周雅静第3版) 训练及综合练习答案 项目2 训练及作业参考答案

项目2输入学生成绩转化为等级任务1输入学生成绩,判断其合法性★实践训练☆初级训练1 .若a=b=c=O,则++a&&++b&&++c后,a,b,c的值为多少(a=1,b=1,c=1)?分析:因为先执行++,再执行逻辑运算符,所以a=1,b=1,c=1.2 .若a=b=c=O,则a++&&++b&&++c后,a,b,c的值为多少(a=1,b=0,C=O)?分析:因为是a++,所以要先执行逻辑运算,而此时a=0,即为假,然后再执行a=a+1;同时由于对“&&”来说,左则为假,则不执行右侧。

所以,最后的结果是a=1,b=0,c=0o3 .若有整型变量叫必2,瓦(:,€1均为1,执行(m=a›b)&&(n;c>d)后,m,n的值为多少(m,n的值为0,1 )分析:因为a=b=c=d=m=n=1,所以a〉b是假,m=0,而对“&&”运算符来说,左侧为假,则不执行右侧,所以m,n的值为0,1。

4 .若t是整型变量,则执行t=T&&-1;t的值为多少(t的值为1 )?分析:因为C语言中,是以非。

代表“真”,所以T代表“真”,因则t的值为U5 .若a=b=c=1,则++a∣I++b&&++c后,a,b,c的值为多少(a=2,b=1,C=I )?分析:a=1,++a后a=2,是非零,对运符符来说,左侧为其,则不执行右侧,所以最后a=2,b=1,c=1。

6 .若a=b=c=1,则++a&&++b&&++c后,a,b,c的值为多少?分析:对“&&”来说,左侧为真,还是要执行右则,所以最后a=2,b=2,c=2°7 .以下程序的运行结果是(2 )。

8 .请阅读以下程序:该程序的运行结果是()。

9 .试编程:求一个数的绝对值。

C实验指导书-(课后题答案!!!)

C实验指导书-(课后题答案!!!)
【小结: 】多分析阅读别人写的程序,多自己动手编写一些小程序,多上机调试运行程 序,做到这 3 个“多”字,学习好 C 程序设计就不难了。
4
实验二
数据类型、运算符和表达式
一、 实验目的
1、掌握 C 语言数据类型,熟悉如何定义一个整型、字符型和实型的变量,以及对它 们赋值的方法; 2、掌握不同的数据类型之间赋值的规律; 3、学会使用 C 的有关算术运算符,以及包含这些运算符的表达式,特别是自加和自 减运算符的使用; 4、进一步熟悉 C 程序的编辑、编译、连接和运行的过程。
二、
相关知识点
VC 集成开发环境; C 语言的编辑、编译、连接和运行过程; C 语言的调试方法和工具; C 语言的基本组成特点。 术语:“控制台应用程序”是一个在 DOS 窗口中运行的基于字符的程序。由于这种 模式的应用程序比 Windows 程序简单,我们先选择利用 Visual C++来建立这样一个 应用,这样使得我们可以将精力先投入到学习使用 C 或者 C++编程语言,而不需要 把过多的精力投入到学习复杂的 Windows 编程中去。
(2)在 VC++编辑环境下编辑源程序。 (3)编译直到程序没有错误。 (4)从键盘输入 10 20↙,运行结果如何? (5)从键盘输入 10,20↙,运行结果如何?
3
(6)任意输入 2 个整数,之间用“空格” ,或者“回车键” ,或者“Tab 键”分隔,分析 结果如何?
五、
扩展内容
Eg1-5: 编写一个 C 程序:输入 a, b, c 三个值,输出其中最大者。 Eg1-6: 编写一个 C 程序:计算 8!
实验步骤:
(1)启动 Visual C++开发环境 (2)创建一个工程 a. 单击 File 菜单中的 New 选项,显示出新建对话框 b. 选择 Win32 Console Application。 c. 选择项目所在路径及输入项目的名称 d. 在建立一个什么类型的控制台应用程序中,选中“一个空工程” ,按“完成” 按钮,至此,已经建立好工程相关的文件。

C16067课后测验

C16067课后测验

一、单项选择题1. 2013年6月的“钱荒”事件体现了什么风险?()A. 利率风险B. 汇率风险C. 股票价格风险D. 商品价格风险您的答案:A题目分数:10此题得分:10.02. 隐含波动率是根据期权定价公式从期权价格倒算出来的波动率,反映了()。

A. 以往数据的变化情况B. 市场对未来的预期C. 波动率变化对期权价格的影响D. 标的资产真实的波动情况您的答案:B题目分数:10此题得分:10.03. 当期权标的资产价格变化较大时,仅使用Delta度量标的资产价格变化对期权价格的影响会产生较大的估计误差,此时需要引入另一个希腊字母()。

A. VegaB. VommaC. GammaD. Theta您的答案:C题目分数:10此题得分:10.0二、多项选择题4. 分散化投资对于风险管理的意义在于()。

A. 只要两种资产收益率的相关系数不为1,分散投资于两种资产就能降低风险B. 对于由相互独立的多种资产组成的投资组合,只要组合中的资产个数足够多,就可以完全消除该投资组合的非系统性风险C. 对于由相互独立的多种资产组成的投资组合,只要组合中的资产个数足够多,就可以完全消除该投资组合的系统性风险D. 当各资产间的相关系数为负时,风险分散效果较差您的答案:A,B,D,C题目分数:10此题得分:0.05. 用于管理期权组合市场风险的主要指标包括()。

A. DeltaB. GammaC. VegaD. ThetaE. Rho您的答案:C,D,A,E,B题目分数:10此题得分:10.0三、判断题6. 美元汇率的变动会影响大宗商品的价格。

()您的答案:正确题目分数:10此题得分:10.07. 由于系统性风险是外部、无法预计和控制的因素造成的风险,所以在出现系统性风险时投资者无法采取任何措施降低风险。

()您的答案:错误题目分数:10此题得分:10.08. 风险对冲是指通过投资或购买与被对冲资产收益波动负相关的某种资产或衍生产品,来冲销被对冲资产潜在损失的一种策略。

证券从业协会远程培训系统C15108课后测验

证券从业协会远程培训系统C15108课后测验

【导语】证券从业协会远程培训系统C15108课后测验,以下由⽆忧考整理发布。

⼀、单项选择题 1.()⽅法的缺点是⼯程量巨⼤、⽽且没有考量新增项⽬的价值。

A.PE B.NAV C.PEG D.PS 描述:DCF的价值 您的答案:B 2.股票的绝对估值⽅法主要是()。

A.现⾦流贴现模型 B.实物期权定价法 C.资产评估法 D.经济增加值法 描述:绝对估值法 您的答案:A 3.()指标可以排除不同国家在税收、财务杠杆、会计政策⽅⾯不⼀致,尤其适合⾼资本开⽀的公司。

A.EBITDA B.EV C.DCF D.PE 描述:传统估值理论概述您的答案:B 4.根据价值核⼼原则()和增长是推动价值创造的两⼤⼒量。

A.市值规模 B.波动率 C.财务杠杆 D.投⼊资本回报率 描述:传统估值理论概述您的答案:D ⼆、多项选择题 5.传统的估值⽅法包括()。

A.绝对估值法 B.相对估值法 C.经济增加值法 D.技术价值评估法 描述:传统估值理论概述您的答案:B 6.《价值:公司⾦融的四⼤基⽯》介绍的公司⾦融四⼤基⽯有()。

A.价值核⼼原则 B.价值守恒原则 C.期望值跑步机原则 D.所有者原则 描述:传统估值理论概述您的答案:A,B,C,D 7.下列属于股票相对估值⽅法的是()。

A.PE估值⽅法 B.PB估值法 C.PS估值法 D.PEG 描述:相对估值法您的答案:A,C,D,B 三、判断题 8.市净率和市盈率之间存在着PE=PB/roe的关系。

() 描述:绝对估值法和相对估值法的关联您的答案:正确 9.价值守恒原则认为,只有改善现⾦流才可以创造价值。

() 描述:现⾦流折现法您的答案:正确。

MCS51单片机课后作业解答资料讲解

MCS51单片机课后作业解答资料讲解

M CS51单片机课后作业解答MCS51单片机作业解答第二章 MCS-51单片机的结构和原理(1) MCS-51单片机芯片包含哪些主要功能部件?答:CPU、4KBROM、128B RAM、4个8位I/O口、2个定时计数器、串行I/O口、中断系统、时钟电路、位处理器、总线结构。

(2)MCS-51单片机的 /EA端有何用途?答:当/EA =0 只访问片外程序区;当/EA=1时,先访问片内程序区,当PC 超过片内程序容量时,自动转向外部程序区。

(3)MCS-51单片机有哪些信号需要芯片引脚以第二功能的方式提供?答:RXD、TXD、/INT0、/INT1、T0、T1、/WR、/RD(4)MCS-51单片机的4个I/O口在使用上各有什么功能和特点?答:P1口通用输入输出;P0口数据总线、地址总线低8位、通用输入输出P2口地址总线高8位、通用输入输出P3第2功能信号、通用输入输出。

(5)单片机的存储器分哪几个空间? 试述各空间的作用。

答:程序存储器:内部ROM、外部ROM数据存储器:内部基本RAM、专用寄存器区、外部RAM(6)简述片内RAM中包含哪些可位寻址单元?答:20H~2FH共16个可寻址单元(7)什么叫堆栈? 堆栈指针SP的作用是什么? 在程序设计中为何要对SP重新赋值?答:只允许数据单端输入输出的一段存储空间。

SP的作用是用来存放堆栈栈顶的地址。

因为SP的初值是07H,后继的是寄存器区和位寻址区,为了便于编程工作,要修改SP.(8)程序状态字寄存器PSW 的作用是什么?简述各位的作用。

答:PSW用来存放程序执行状态的信息,CY—加减运算的进位、借位AC—辅助进位标志,加减运算的低4位进位、借位(9)位地址65H 与字节地址65H 如何区别? 位地址65H具体在片内RAM中什么位置? 答:位地址65H中是一位0/1的数据,字节地址65H是8位0/1的数据。

位地址65H在片内RAM中2CH单元第5位。

第四章80C51的程序设计习题及答案

第四章80C51的程序设计习题及答案

第四章80C51的程序设计习题及答案第四章80C51的程序设计习题及答案1、80C51单⽚机汇编语⾔有何特点?答:80C51单⽚机汇编语⾔的源程序结构紧凑、灵活,汇编成的⽬标程序效率⾼,具有占存储空间少、运⾏速度快、实时性强等优点。

但它的是⾯向机器的语⾔,所以它缺乏通⽤性,编程复杂繁琐,但应⽤相当⼴泛。

2、利⽤80C51单⽚机汇编语⾔进⾏程序设计的步骤如何?答:在进⾏程序设计时,⾸先需要对单⽚机应⽤系统预先完成的任务进⼊深⼊的分析,明确系统的设计任务、功能要求、技术指标。

然后,要对系统的硬件资源和⼈⼯作环境进⾏分析和熟悉。

经过分析、研究和明确规定后,利⽤数学⽅法或数学模型来对其进⾏描述,从⽽把⼀个实际问题转化成由计算机进⾏处理的问题。

进⽽,对各种算法进⾏分析⽐较,并进⾏合理的优化。

3、常⽤的程序结构有哪⼏种?特点如何?答:常⽤的程序结构有以下⼏种:(1)顺序程序结构顺序结构是按照逻辑操作顺序,从某⼀条指令开始逐条顺序进⾏,直到某⼀条指令为⽌;⽐如数据传送与交换、查表程序和查表程序的设计等;在顺序结构中没有分⽀,也没有⼦程序,但它是组成复杂程序的基础和主⼲;(2)分⽀程序结构它的主要特点是程序执⾏流程中必然包含有条件判断指令,符合条件要求的和不符条件合要求的有不同的处理程序;(3)循环程序结构它在本质上只是分⽀程序中的⼀个特殊形式,它由循环初始化、循环体、循环控制和结束部分构成;在循环次数已知情况下,采⽤计数循环程序,其特点是必须在初始部分设定计数的初始值,循环控制部分依据计数器的值决定循环次数;根据控制循环结束的条件,决定是否继续循环程序的执⾏。

(4)⼦程序它的主要特点是,在执⾏过程中需要由其它的程序来调⽤,执⾏完后⼜需要把执⾏流程返回到调⽤该⼦程序的主程序。

4、⼦程序调⽤时,参数的传递⽅法有哪⼏种?答:在80C51单⽚机中,⼦程序调⽤时,参数的传递⽅法由三种:1、利⽤累加器或寄存器;2、利⽤存储器;3、利⽤堆栈。

【精品】C++习题参考答案-吴乃陵版

【精品】C++习题参考答案-吴乃陵版

1.2 假定有下列变量: int a=3,b=5,c=0; float x=2.5,y=8.2,z=1.4; char ch1=’a’,ch2=’5’,ch3=’0’,ch4; 求下列表达式的值,以及运算后表达式所涉及的各变量的值。 x+(int)y%a x=z*b++,b=b*x,b++ ch4=ch3-ch2+ch1 int(y/z)+(int)y/(int)z !(a>b)&&c&&(x*=y)&&b++ ch3||(b+=a*c)||c++ z=(a<<2)/(b>>1) 答:x+(int)y%a 表达式值为:4.5,运算后 x、y、a 的值不变,仍分别为 2.5、8.2、3。 提示:运算时取出 y 变量的数值强制转化为整型数放入寄存器参加运算,但内存中 y 本身的数值不变化。只 有赋值运算和自增、自减运算才改变变量本身的值 x=z*b++,b=b*x,b++ 表达式值为:42,运算后 x 为 7.0,b 为 43。 提示:逗号表达式,依次运算,表达式的值是最后一次运算的值。后++是变量先参加运算然后变量自身加 1, 所以第 1 步 x 等于 1.4*5,即 7.0,然后 b 增为 6;第 2 步 b 赋值为 42;第 3 步,表达式的值是上一步后 b 的 值 42,但随后 b 的值自增 1,成为 43。 ch4=ch3-ch2+ch1 表达式值为:’\\’,字符外斜杠。运算后 ch1、ch2、ch3 值不变。 提示:字符型的变量实质是范围很小的整型量。 int(y/z)+(int)y/(int)z 表达式值为:13。y 和 z 自身的值不变。 提示:int(y/z)是完成实数除法后,商强制转化为整型,(int)y/(int)z 则是数值先转换,完成的是整除。 !(a>b)&&c&&(x*=y)&&b++ 表达式值为:0。运算后 x 仍为 2.5,b 仍为 5 提示:只要出现一个 false 右边的不再做,因为 c 为 0,即 false,所以其右的所有运算不再做。 ch3||(b+=a*c)||c++ 表达式值为:1。运算后 b 为 5,c 为 0,均不变。 提示:只要出现一个 true,右边不再做。ch3 的值为 48。 z=(a<<2)/(b>>1) 表达式值为:6。运算后 a 与 b 的值不变仍为 3 和 5。 提示:a 的数值为(00000011)2,左移 2 位为(00001100)2 即 12,相当整数 2 两次,而 b 的数值为(00000101)2, 右移 1 位为(00000010)2,即 2,相当于整除 2。 1.3 判断下列哪些是常量,哪些是变量。 "China" const int n=10; int m=5; int array[5]={1,2,3,4,5}; char s[]="Hello"; 答:"China" 文字常量 const int n=10; 常变量 int m=5; 变量 'a' 文字常量 char ch='a' 变量 int array[5]={1,2,3,4,5}; 变量 char s[]="Hello"; 变量

VCP510最新题库288题6.26_考过

VCP510最新题库288题6.26_考过

Click the Exhibit button.An administrator has deployed a new virtual machine on an ESXi 5.x host. Users are complaining of poor performance on the application running on the virtual machine. Performance tools display the results shown in the exhibit.Which two tasks might improve the user experience? (Choose two.)A. Add a vCPU to the virtual machineB. Remove CPU affinity on the advanced CPU setting of the virtual machineC. Migrate the virtual machine to another ESXi hostD. Remove the limit on the CPU settings of the virtual machineAnswer: A,DQUESTION NO: 2An administrator notices that when a virtual machine is placed into a resource pool, a warning indicates that the virtual machine will receive a very large percentage of the total shares for memory.Which action can be taken to resolve this problem?A. Increase the memory resource allocation to the resource pool.B. Increase the share value for the resource pool.C. Change the shares setting from custom to high, medium, or low for the virtual machine.D. Decrease the memory allocation for the virtual machine.Answer: CAn administrator views the Fault Tolerance pane of the Summary tab of a virtual machine and finds that the current status is Not Protected.What are two vSphere Fault Tolerance states that would cause the virtual machine to not be protected? (Choose two.)A. Stopped - Fault Tolerance has been stopped on the secondary virtual machine.B. Need Secondary VM - The primary virtual machine is running without a secondary virtual machine and is not protectedC. Need Primary VM - The secondary virtual machine is running, and a new primary virtual machine cannot be generated.D. Disabled - Fault Tolerance is disabled.Answer: B,DQUESTION NO: 4Which two conditions prevent the application of a host profile to an ESXi 5.x host? (Choose two.)A. The host has multiple profiles attached.B. The host has not been placed into maintenance mode.C. The host is running virtual machines.D. The host is an ESXi host.Answer: B,CQUESTION NO: 5An administrator is editing the IP allocation policy for a vApp.Which three options are available? (Choose three.)A. AutomaticB. RoamingC. TransientD. DHCPE. FixedAnswer: C,D,EQUESTION NO: 6ACME Junkmail Incorporated has been utilizing templates in their environment. They are running a 10-node ESXi 5.x Cluster and DRS has not been configured. Several virtual machines have been deployed from this template and successfully powered on, but a newly deployed virtual machine will not power on. There appear to be adequate CPU and Memory resources available on the host.Which three things can be done to allow more virtual machines to be deployed into the cluster from this template? (Choose three.)A. Select a different datastore for the virtual machineB. Move the swap file to a different locationC. Deploy the virtual machine to a different host using the same datastoreD. Enable DRS on the cluster to balance the virtual machine load out across hostsE. Increase the virtual machine memory reservationAnswer: A,B,EQUESTION NO: 7What are three valid objects to place in a vApp? (Choose three.)A. FoldersB. HostsC. Resource poolsD. vAppsE. Virtual machinesAnswer: C,D,EQUESTION NO: 8Which three Storage I/O Control conditions might trigger the Non-VI workload detected on the datastore alarm? (Choose three.)A. The datastore is connected to an ESX/ESXi 4.0 host that does not support Storage I/O Control.B. The datastore is on an array that is performing system tasks such as replication.C. The datastore is utilizing active/passive multipathing or NMP (Native Multi-Pathing).D. The datastore is storing virtual machines with one or more snapshots.E. The datastore is connected to an ESX/ESXi 4.0 host that is not managed by vCenter.Answer: A,B,EQUESTION NO: 9An administrator has just finished deploying a vApp for a web service.What three options are available to the administrator for IP allocation within the vApp? (Choose three.)A. TransientB. FixedC. DHCPD. BridgedE. NATAnswer: A,B,CQUESTION NO: 10An administrator is working to implement Storage Profiles in their environment.Which two ways can storage capabilities be generated? (Choose two.)A. They are generated by Datastore Clusters as LUNs are added to the cluster.B. They are automatically determined by the Storage Profile when it is created.C. They can be retrieved from the array through the VMware APIs for Storage Awareness (VASA).D. They can be manually generated by the administrator.Answer: C,DQUESTION NO: 11Which VMware solution uses the security of a vSphere implementation and provides linked-clone technology to virtual desktops?A. VMware ACEB. VMware ViewC. VMware WorkstationD. VMware ThinAppAnswer: BQUESTION NO: 12Which two conditions will prevent a virtual machine from being successfully migrated using Storage vMotion? (Choose two.)A. The virtual machine has an RDM.B. The virtual machine has Fault Tolerance enabled.C. The virtual machine is running on a vSphere 5.x Standard host.D. The virtual machine has a disk stored on an NFS datastore.Answer: B,CQUESTION NO: 13Under which two conditions can vStorage APIs for Array Integration (VAAI) provide a performance benefit? (Choose two.)A. When a virtual disk has VMDK files stored on an NFS datastore.B. When a virtual disk is created using the New Virtual Machine wizard.C. When cloning a virtual machine with snapshots.D. When a virtual disk is deleted.Answer: A,DQUESTION NO: 14An administrator is enabling Enhanced vMotion Compatibility (EVC) in a DRS cluster. The administrator wants only hosts with the newest Intel processors added to the cluster.Which setting satisfies this requirement?A. The baseline with the most CPUs listedB. The baseline with the fewest CPUs listedC. Any baseline that contains Future Intel processorsD. Create a new baseline and add only the latest processor familyAnswer: DQUESTION NO: 15Which two conditions must exist on all hosts in the cluster if Enhanced vMotion Compatibility (EVC) is used? (Choose two.)A. The cluster must be enabled for DRS.B. All hosts in the cluster must be running ESX/ESXi 3.5 Update 2 or later.C. All hosts in the cluster must have hardware virtualization support enabled.D. The cluster must be enabled for HA.Answer: B,CQUESTION NO: 16Users are experiencing performance issues when updating their database hosted on a virtual machine. The administrator determines that disk I/O is high across one of the HBAs on the ESXi host containing thevirtual machine.What is the action will most likely correct the issue without significantly impacting other users or datastores?A. Manually configure the disk multipathing policy to Round Robin for the datastoreB. Migrate the virtual machine to an NFS datastore using Storage vMotionC. Use Storage vMotion to migrate the virtual machine to a new VMFS5 datastoreD. Map additional LUNs to the ESXi host and extend the datastoresAnswer: AQUESTION NO: 17An administrator takes a vSphere snapshot of a virtual machine and applies an OS update. After confirming the update the administrator cannot enable Fault Tolerance on the virtual machine and suspects there are snapshots that have not been consolidated.Which two operations can the administrator perform to verify consolidation is needed? (Choose two.)A. Expose the Needs Consolidation column in the virtual machines tab of the host.B. Browse the datastore containing the vmdk files and look for files with the "-delta.vmdk" extension.C. Expose the Needs Consolidation column in the virtual machine summary tab.D. Select and run the vSphere Cluster HealthCheck from the right-click menu of the cluster object. Answer: A,BQUESTION NO: 18An administrator has created a virtual machine that will be accessed from a public kiosk. Management has requested that the virtual machine be reset to a known state once a week or on demand if requested. Which method is the simplest way to meet this requirement?A. Configure the storage array to be vSphere aware and script routine array snapshot restores of the datastore.B. Implement a 3rd party imaging server and PXE boot the virtual machine off a static image.C. Set the VMDKs of the virtual machine to be Independent-Nonpersistent and schedule restarts of the virtual machine.D. Create Nonpersistent disks for the virtual machine and set the guest OS to reboot once a week. Answer: CQUESTION NO: 19What are three true statements about quiescing virtual machine snapshots? (Choose three.)A. vSphere snapshot quiescing only occurs on Windows guest OSes.B. The quiescing operation is automatic with any snapshot.C. The quiescing operation varies by guest OS.D. Quiescing should occur before array-based snapshots to ensure consistency.E. VMware Tools is required for quiescing to be successful.Answer: C,D,EQUESTION NO: 20An administrator has deployed vCenter Data Recovery and wants the largest possible de-duplication store. Which three storage options can be used? (Choose three.)A. Two CIFS sharesB. Two RDMs on a FCP arrayC. One NFS mount on the ESXi host and one RDMs on an iSCSI arrayD. One CIFS share and one FCP RDME. Two NFS mounts on the ESXi hostAnswer: B,C,EQUESTION NO: 21An administrator has recently upgraded their Update Manager infrastructure to vSphere 5.x. Several hosts and virtual machines have not been upgraded yet.Which vSphere component when upgraded will have the least impact to the existing environment?A. Virtual Machine HardwareB. ESX HostsC. VMFS datastoresD. VMware ToolsAnswer: DQUESTION NO: 22An administrator is using Update Manager 5.x to update virtual appliances in a vSphere environment. The environment is using the vCenter Server Virtual Appliance (vCSA).What would cause the remediation to fail?A. Updating of the appliance can only be done if the vCenter Server Virtual Appliance (vCSA) has been put into Maintenance Mode.B. Remediation must be configured on the Appliance Administration page before use.C. Remediation of the vCenter Server Virtual Appliance (vCSA) with Update Manager is not supported.D. Remediation requires the hosts to be connected to vCenter using an IPv4 address.Answer: DQUESTION NO: 23An administrator is working to update the hosts and virtual machines in a vSphere 5.x deployment using Update Manager Baselines.Other than host patches, which three items require a separate procedure or process to update? (Choose three.)A. Operating system patchesB. Virtual Appliance updatesC. Virtual Machine Virtual Hardware upgradesD. VMware Tools on machines without VMware Tools already installedE. Application patches within the virtual machineAnswer: A,D,EQUESTION NO: 24An administrator selects the Profile Compliance tab of an vSphere cluster, then selects Check Compliance Now.Which features requirements are not checked by this?A. vMotionB. Fault ToleranceC. DRSD. Host ProfilesAnswer: DQUESTION NO: 25An administrator is troubleshooting an ESXi 5.x host and needs to export diagnostic information. The host is currently managed by a vCenter Server instance.Which two ways can the information be gathered using the vSphere Client? (Choose two.)A. Select Home. Under Administration, click System Logs and click the Export System Logs button. Select the affected ESXi host. Select Select All. Select a location and click Finish.B. In the vSphere Client, select the affected ESXi host. Right-click the host and select Export Diagnostic Data. Select a location and click OK.C. Log in to the ESXi host locally, Select Export System Logs.D. In the vSphere Client, select the affected ESXi host. Select File, Export and Export System Logs. Select Select All. Select a location and click Finish.Answer: A,DQUESTION NO: 26An ESXi 5.x host displays a warning icon in the vSphere console and its summary page lists a configuration issue "SSH for the host has been enabled." What are two ways to clear this warning? (Choose two.)A. Using the Security Profile pane of the Configuration tab in the vSphere ClientB. Using the Direct Console User Interface (DCUI)C. Using the Advanced Settings pane of the Configuration tab in the vSphere ClientD. Using the Networking pane of the Configuration tab in the vSphere ClientAnswer: A,BQUESTION NO: 27vCenter reports a connectivity problem with a ESXi 5.x host that is not a member of a cluster. An administrator attempts to connect directly to the host using the vSphere Client but fails with the message "An unknown connection error occurred." Virtual machines running on the host appear to be running and report no problem.What two methods would likely resolve the issue without affecting the virtual machines? (Choose two.)A. Enter the service mgmt-vmware restart command from either SSH or local CLIB. Select Restart Management Agents in the Direct Console User Interface (DCUI)C. Select Reboot Host in the Direct Console User Interface (DCUI)D. Enter the services.sh restart command from either SSH or the local CLIAnswer: B,DQUESTION NO: 28Click the Exhibit button.ACME Catering Services is using esxtop to troubleshoot a performance problem with one of their ESXi5.x hosts. Host disconnections from vCenter Server as well as sluggish performance when performing tasks on the host have been observed.Based on the output in the exhibit, how many vCPU's have been assigned to FileServer01?A. 1B. 2C. 4D. 8Answer: DQUESTION NO: 29An administrator notices that log files kept on an ESXi 5.x host are being rotated very quickly, inhibiting the troubleshooting of an issue.Which two configuration changes will resolve the issue? (Choose two.)A. Configure syslog to send the logs a syslog serverB. Increase the number of logs keptC. Increase the logging levelD. Increase the size of the partition where log files are storedAnswer: A,BQUESTION NO: 30A series of Auto Deploy ESXi 5.x hosts which utilize vSphere Standard Switches are unable to boot. In prior testing, all of the hosts were able to boot successfully.Which two conditions might cause this issue? (Choose two.)A. The Hosts are unable to connect to the SAN.B. The TFTP server is down.C. The DNS server is down.D. The DHCP server is down.Answer: B,DQUESTION NO: 31An administrator wants to monitor the health status of an ESXi 5.x host. However, when the administrator clicks the Hardware Status tab the following error is displayed.This program cannot display the webpageWhat might cause this problem?A. The VMware VirtualCenter Management Webservices Service is not started.B. The required plug-in is not enabled.C. The VMware ESXi Management Webservices Service is not startedD. The name of the vCenter Server system could not be resolved.Answer: AQUESTION NO: 32An iSCSI array is being added to a vSphere 5.x implementation. An administrator wants to verify that all IP storage VMkernel interfaces are configured for jumbo frames.What are two methods to verify this configuration? (Choose two.)A. Run the esxcli network ip interface list commandB. Run the esxcfg-vswif -l commandC. Ensure that the Enable Jumbo Frames box is checked in the VMkernel interface properties in the vSphere clientD. Ensure that the MTU size is set correctly in the VMkernel interface properties in the vSphere client Answer: A,DQUESTION NO: 33An administrator has configured a vSphere Distributed Switch to send all network traffic to a collector virtual machine for analysis. However, after checking the collector virtual machine several hours later the administrator finds that no data has been collected. vSphere 5.x has been deployed in the datacenter. Which two items below could be causing this issue? (Choose two.)A. The source virtual machine does not have Promiscuous Mode enabled.B. The source and target virtual machines are not both be on the same vSphere Distributed Switch.C. The port group or distributed does not have Promiscuous Mode enabled.D. The port group or distributed port does not have NetFlow enabled.Answer: B,DQUESTION NO: 34A vSphere 5 implementation consists of a fully automated DRS cluster with two ESXi 5.x hosts with the following vSphere Standard Switch configuration.1. Switch A. three vmnics, one port group named sFTP-PG2. Switch B. two vmnic, one port group named Web-PG3. All vmnics are trunked to the same physical switch.DRS has been configured with an anti-affinity rule for all virtual machines in the Web-PG so that no more than half of the virtual machines run on any given host. The virtual machines on WebPG are experiencing significant network latency. The network team has determined that a performance bottleneck is occurring at the ESXi host level.Which solution will require the least amount of administrative work and the least amount of service interruption?A. Migrate Web-PG to Switch A and sFTP-PG to Switch B on each hostB. Move a vmnic from Switch A to Switch B on each hostC. Convert the three Switch Bs to a single vSphere Distributed SwitchD. Use vMotion to redistribute some of the VMs in Web-PG to a different ESXi hostAnswer: BQUESTION NO: 35A user attempts a remote SSH connection to a newly-installed ESXi 5.x host to execute some commands. The SSH connection attempt fails, though the user is able to receive a ICMP ping back from the host. What must the administrator do to enable SSH? (Choose two.)A. Enable root logon on the ESXi server.B. Open the SSH port on the ESXi firewall.C. Start the SSH service on the ESXi server.D. Create a local user on the ESXi server.Answer: B,CQUESTION NO: 36An administrator is setting up vMotion in a vSphere environment. A migration is run to test the configuration, but fails.What could the administrator do to resolve the issue?A. Ensure the VMkernel port group is configured for Management Traffic.B. Enable VMkernel port group for the vSphere cluster.C. Ensure the vMotion enabled adaptors configured for the same subnet.D. Use a vDS instead of a standard switch.Answer: CQUESTION NO: 37An administrator is unable to connect a vSphere Client to an ESXi 5.x host.Which option can be selected from the direct console to restore connectivity without disrupting running virtual machines?A. Restore the Standard Switch from the ESXi host.B. Restart the Management Agents from the vSphere client.C. Restart the Management Agent from the ESXi hostD. Disable the Management Network from the vSphere client.Answer: CQUESTION NO: 38An administrator receives a complaint that a virtual machine is performing poorly. The user attributes the issue to poor storage performance.If the storage array is the bottleneck, which two counters would be higher than normal? (Choose two.)A. Average ESXi VMKernel latency per command, in millisecondsB. Average ESXi highest latency, in millisecondsC. Average virtual machine operating system latency per command, in millisecondsD. Number of SCSI reservation conflicts per secondAnswer: B,CQUESTION NO: 39An administrator must decommission a datastore.Before unmounting the datastore, which three requirements must be fullfilled? (Choose three.)A. No virtual machines reside on the datastore.B. The datastore is not used for vSphere HA heartbeat.C. No registered virtual machines reside on the datastore.D. The datastore must not have any extents.E. The datastore must not be part of a datastore cluster.Answer: B,C,EQUESTION NO: 40An administrator is informed that there will be a storage maintenance window and that failovers may occur.What is the expected length of time that a Windows 2008 virtual machine storage I/O will pause during a path failover?A. 0 to 30 secondsB. 90 to 120 secondsC. 60 to 90 secondsD. 30 to 60 secondsAnswer: DQUESTION NO: 41A company wants to increase disk capacity for their vSphere environment.Management mandates that.1. vMotion must work in this environment.2. The existing LAN infrastructure must be used.Which storage option best meets the company objectives?A. iSCSIB. Fibre ChannelC. SATAD. NFSAnswer: DQUESTION NO: 42Which resource management technique can be used to relieve a network bottleneck caused by a virtual machine with occasional high outbound network activity?A. Convert the switch from a vSphere Standard Switch to a vSphere Distributed Switch.B. Create a new portgroup for the virtual machine and enable traffic shaping.C. Apply traffic shaping to the other virtual machines in the same port group.D. Apply traffic shaping to the virtual machine with high activity.Answer: BQUESTION NO: 43An administrator has determined that storage performance to a group of virtual machines is reduced during peak activity. The virtual machines are located in a VMFS datastore called Production1 on an active-active storage array. The ESXi 5.x host running the virtual machines is configured with an MRUmultipathing policy.Which two actions can be taken to improve the storage performance of these virtual machines? (Choose two.)A. Add virtual storage, create a VMFS datastore called Production2 on the new storage, and then migrate some of the virtual machines from Production1 to Production2.B. Change the storage multipathing policy to Round Robin.C. Add physical storage, create a VMFS datastore called Production2 on the new storage, and then migrate some of the virtual machines from Production1 to Production2.D. Change the storage multipathing policy to Fixed with default settings.Answer: B,CQUESTION NO: 44Which of these factors indicates a high likelihood that the performance of a virtual machine disk is being constrained by disk I/O?A. A large number of commands issuedB. A high device latency valueC. A high disk used valueD. A large number of kilobytes read and writtenAnswer: BQUESTION NO: 45Click the Exhibit button.An administrator is configuring vMotion in their environment. As part of the implementation, an administrator is examining resource mapping for virtual machines.What is a likely cause of the error shown in the exhibit?A. vMotion has been disabled because the are no other hosts in the cluster with vMotion enabled.B. vMotion has not been enabled on the Production port group.C. The administrator has not created a Managent network.D. vMotion has not been enabled on a VMkernel port group.Answer: CQUESTION NO: 46Which two circumstances might cause a DRS cluster to become invalid? (Choose two.)A. DRS has been disabled on one or more ESXi hosts.B. An ESXi host has been removed from the cluster.C. A migration on a virtual machine is attempted while the virtual machine is failing over.D. Virtual machines have been powered on from a vSphere Client connected directly to an ESXi host. Answer: B,DQUESTION NO: 47Click the Exhibit button.An administrator has a DRS/HA cluster with five ESXi 5.x hosts. When the administrator tries to start a new Web server virtual machine, an error is displayed saying insufficient resources exist for HA.Based on the HA configuration in the exhibit, which two changes can resolve the issue? (Choose two.)A. Shut down one or more virtual machines on the cluster.B. Set VM Restart Priority to Disabled for the Web server.C. Set Host Isolation response to Shut down.D. Suspend one or more virtual machines in the cluster.Answer: A,DQUESTION NO: 48Click the Exhibit button.An administrator is applying patches to a batch of ESXi 5.x hosts in an under-allocated HA/DRS cluster. An attempt is made to place the host into maintenance mode, but the progress has stalled at 2%. DRS is configured as shown in the exhibit. Of the four choices below, two would effectively resolve this issue. Which two steps could be taken to correct the problem? (Choose two.)A. Enable VMware EVC.B. Set the virtual machines on the host to Fully Automated.C. Shut down the virtual machines on the host.D. Move the virtual machine swap file off the local datastore.Answer: B,CQUESTION NO: 49An administrator is configuring Storage DRS in their environment. The Datastore cluster iscomposed of 4 VMFS3 volumes and 9 VMFS5 volumes. Storage DRS has been enabled, but is showing as disabled on several virtual machine disks in the datastore cluster.Which two conditions would cause this error to occur? (Choose two.)A. The virtual machine is stored on a VMFS 3 volume.B. One or more virtual machines have Persistent disks.C. The virtual machine is stored on a NFS datastore.D. The virtual machine is stored on a datastore with a 2mb block size.Answer: A,BQUESTION NO: 50An administrator finds that vMotion and Storage vMotion operations do not succeed on a virtual machine. The virtual machine has been configured with N_Port ID Virtualization. The virtual machine has two data RDMs, one using a RAID5 LUN and one using a RAID0+1 LUN. The mapping file for the RAID5 LUN was created on the same datastore as the virtual machine, and the mapping file for the RAID0+1 LUN was placed in a datastore used for production data virtual disks.Which two statements are true about this configuration? (Choose two.)A. Storage vMotion cannot be used unless both mapping files are placed on the same datastore.B. vMotion cannot be used unless both mapping files are placed on the same datastore.C. vMotion cannot be used with RDMs.D. Storage vMotion cannot be used with NPIV.Answer: B,DQUESTION NO: 51A company has converted several physical machines to virtual machines but are seeing significant performance issues on the converted machines. The host is configured with sufficient memory and storage does not appear to be a bottleneck.Which metric can be checked to determine if CPU contention exists on an ESXi 5.x host?A. %RUNB. %WAITC. %USEDD. %RDYAnswer: DQUESTION NO: 52Which three statements regarding Network I/O Control (NIOC) are accurate? (Choose three.)A. NIOC enforces traffic bandwidth limits on the overall vDS set of dvUplinks.B. NIOC limits maximum throughput control on connected virtual machines.C. Load based teaming efficiently uses a vDS set of dvUplinks for network capacity.D. Isolation provides priority to any one traffic flow.E. Relative shares fairly allocates available bandwidth among multiple flows.Answer: A,C,EQUESTION NO: 53Which three requirements must be met in order to use Storage I/O Control? (Choose three.)A. The datastore must contain multiple VMFS extents.B. The datastore must contain a single NFS volume.C. The datastore must not include virtual machines with snapshots.D. The datastore must be managed by a single vCenter Server.E. Array-based automated storage tiering must be explicitly certified.Answer: B,D,EQUESTION NO: 54What number of IOPS should be used with Storage I/O Control to limit disk throughput to roughly 10 MBps if the guest application writes 64KB blocks?。

《C++大学教程第五版》课后习题答案(作者DEITEL)

《C++大学教程第五版》课后习题答案(作者DEITEL)

C++ 大学基础教程课后答案(DEITEL)版3.11GradeBook类定义:#include <string> // program uses C++ standard string classusing std::string;class GradeBook{public :// constructor initializes course name and instructor nameGradeBook( string, string );void setCourseName( string ); // function to set the course namestring getCourseName(); // function to retrieve the course namevoid setInstructorName( string ); // function to set instructor name string getInstructorName(); // function to retrieve instructor namevoid displayMessage(); // display welcome messageand instructor name private :string courseName; // course name for this GradeBookstring instructorName; // instructor name for this GradeBook}; // end class GradeBook类成员函数:#include <iostream>using std::cout;using std::endl;#include "GradeBook.h"// constructor initializes courseName and instructorName// with strings supplied as argumentsGradeBook::GradeBook( string course, string instructor ){setCourseName( course ); // initializes courseNamesetInstructorName( instructor ); // initialiZes instructorName} // end GradeBook constructor// function to set the course namevoid GradeBook::setCourseName( string name ){courseName = name; // store the course name} // end function setCourseName// function to retrieve the course namestring GradeBook::getCourseName(){return courseName;} // end function getCourseName// function to set the instructor namevoid GradeBook::setInstructorName( string name ){instructorName = name; // store the instructor name} // end function setInstructorName// function to retrieve the instructor namestring GradeBook::getInstructorName(){return instructorName;} // end function getInstructorName// display a welcome message and the instructor's namevoid GradeBook::displayMessage(){// display a welcome message containing the course namecout << "Welcome to the grade book for\n" << getCourseName() << "!"<< endl;// display the instructor's namecout << "This course is presented by: " << getInstructorName() << endl; } // end function displayMessage测试文件:#include <iostream>using std::cout;using std::endl;// include definition of class GradeBook from GradeBook.h#include "GradeBook.h"// function main begins program executionint main(){// create a GradeBook object; pass a course name and instructor name GradeBook gradeBook("CS101 Introduction to C++ Programming" , "Professor Smith" );// display initial value of instructorName of GradeBook objectcout << "gradeBook instructor name is: "<< gradeBook.getInstructorName() << "\n\n" ;// modify the instructorName using set functiongradeBook.setInstructorName( "Assistant Professor Bates" );// display new value of instructorNamecout << "new gradeBook instructor name is: "<< gradeBook.getInstructorName() << "\n\n" ;// display welcome message and instructor's namegradeBook.displayMessage();return 0; // indicate successful termination} // end main类定义:class Account{public :Account( int ); // constructor initializes balancevoid credit( int ); // add an amount to the account balancevoid debit( int ); // subtract an amount from the account balanceint getBalance(); // return the account balanceprivate :int balance; // data member that stores the balance}; // end class Account类成员函数:#include <iostream>using std::cout;using std::endl;#include "Account.h" // include definition of class Account// Account constructor initializes data member balanceAccount::Account( int initialBalance ){balance = 0; // assume that the balance begins at 0// if initialBalance is greater than 0, set this value as the// balance of the Account; otherwise, balance remains 0if ( initialBalance > 0 )balance = initialBalance;// if initialBalance is negative, print error messageif ( initialBalance < 0 )cout << "Error: Initial balance cannot be negative.\n" << endl; } // end Account constructor// credit (add) an amount to the account balancevoid Account::credit( int amount ){balance = balance + amount; // add amount to balance} // end function credit// debit (subtract) an amount from the account balancevoid Account::debit( int amount ){if ( amount > balance ) // debit amount exceeds balancec out << "Debit amount exceeded account balance.\n" << endl;if ( amount <= balance ) // debit amount does not exceed balancebalance = balance - amount;} // end function debit// return the account balanceint Account::getBalance(){return balance; // gives the value of balance to the calling function } // end function getBalance测试函数:#include <iostream>using std::cout;using std::cin;using std::endl;// include definition of class Account from Account.h#include "Account.h"// function main begins program executionint main(){Account account1( 50 ); // create Account objectAccount account2( 25 ); // create Account object// display initial balance of each objectcout << "account1 balance: $" << account1.getBalance() << endl;cout << "account2 balance: $" << account2.getBalance() << endl;int withdrawalAmount; // stores withdrawal amount read from usercout << "\nEnter withdrawal amount for account1: " ; // promptcin >> withdrawalAmount; // obtain user inputcout << "\nattempting to subtract " << withdrawalAmount<< " from account1 balance\n\n" ;account1.debit( withdrawalAmount ); // try to subtract from account1// display balancescout << "account1 balance: $" << account1.getBalance() << endl;cout << "account2 balance: $" << account2.getBalance() << endl;cout << "\nEnter withdrawal amount for account2: " ; // promptcin >> withdrawalAmount; // obtain user inputcout << "\nattempting to subtract " << withdrawalAmount<< " from account2 balance\n\n" ;account2.debit( withdrawalAmount ); // try to subtract from account2// display balancescout << "account1 balance: $" << account1.getBalance() << endl;cout << "account2 balance: $" << account2.getBalance() << endl;return 0; // indicate successful termination} // end main3.12类定义:#include <string> // program uses C++ standard string classusing std::string;// Invoice class definitionclass Invoice{public :// constructor initializes the four data membersInvoice( string, string, int , int );// set and get functions for the four data membersvoid setPartNumber( string ); // part numberstring getPartNumber();void setPartDescription( string ); // part descriptionstring getPartDescription();void setQuantity( int ); // quantityint getQuantity();void setPricePerItem( int ); // price per itemint getPricePerItem();// calculates invoice amount by multiplying quantity x price per item int getInvoiceAmount();private :string partNumber; // the number of the part being soldstring partDescription; // description of the part being soldint quantity; // how many of the items are being soldint pricePerItem; // price per item}; // end class Invoice类成员函数:#include <iostream>using std::cout;using std::endl;// include definition of class Invoice from Invoice.h#include "Invoice.h"// Invoice constructor initializes the class's four data membersInvoice::Invoice( string number, string description, int count, int price ){setPartNumber( number ); // store partNumbersetPartDescription( description ); // store partDescriptionsetQuantity( count ); // validate and store quantitysetPricePerItem( price ); // validate and store pricePerItem} // end Invoice constructor// set part numbervoid Invoice::setPartNumber( string number ){partNumber = number; // no validation needed} // end function setPartNumber// get part numberstring Invoice::getPartNumber(){return partNumber;} // end function getPartNumber// set part descriptionvoid Invoice::setPartDescription( string description ){partDescription = description; // no validation needed} // end function setPartDescription// get part descriptionstring Invoice::getPartDescription(){return partDescription;} // end function getPartDescription// set quantity; if not positive, set to 0void Invoice::setQuantity( int count ){if ( count > 0 ) // if quantity is positivequantity = count; // set quantity to countif ( count <= 0 ) // if quantity is not positive{quantity = 0; // set quantity to 0cout << "\nquantity cannot be negative. quantity set to 0.\n" ; } // end if} // end function setQuantity// get quantityint Invoice::getQuantity(){return quantity;} // end function getQuantity// set price per item; if not positive, set to 0void Invoice::setPricePerItem( int price ){if ( price > 0 ) // if price is positivepricePerItem = price; // set pricePerItem to priceif ( price <= 0 ) // if price is not positive{pricePerItem = 0; // set pricePerItem to 0cout << "\npricePerItem cannot be negative. "<< "pricePerItem set to 0.\n" ;} // end if} // end function setPricePerItem// get price per itemint Invoice::getPricePerItem(){return pricePerItem;} // end function getPricePerItem// calulates invoice amount by multiplying quantity x price per itemint Invoice::getInvoiceAmount(){return getQuantity() * getPricePerItem();} // end function getInvoiceAmount测试函数:#include <iostream>using std::cout;using std::cin;using std::endl;// include definition of class Invoice from Invoice.h#include "Invoice.h"// function main begins program executionint main(){// create an Invoice objectInvoice invoice( "12345" , "Hammer", 100, 5 );// display the invoice data members and calculate the amountcout << "Part number: " << invoice.getPartNumber() << endl;cout << "Part description: " << invoice.getPartDescription() << endl; cout << "Quantity: " << invoice.getQuantity() << endl;cout << "Price per item: $" << invoice.getPricePerItem() << endl;cout << "Invoice amount: $" << invoice.getInvoiceAmount() << endl;// modify the invoice data membersinvoice.setPartNumber( "123456" );invoice.setPartDescription( "Saw" );invoice.setQuantity( -5 ); //negative quantity,so quantity set to 0 invoice.setPricePerItem( 10 );cout << "\nInvoice data members modified.\n\n" ;// display the modified invoice data membersand calculate new amount cout << "Part number: " << invoice.getPartNumber() << endl;cout << "Part description: " << invoice.getPartDescription() << endl; cout << "Quantity: " << invoice.getQuantity() << endl;cout << "Price per item: $" << invoice.getPricePerItem() << endl;cout << "Invoice amount: $" << invoice.getInvoiceAmount() << endl;return 0; // indicate successful termination} // end main3.13类定义:#include <string> // program uses C++ standard string classusing std::string;// Employee class definitionclass Employee{public :Employee( string, string, int ); // constructor sets data members void setFirstName( string ); // set first namestring getFirstName(); // return first namevoid setLastName( string ); // set last namestring getLastName(); // return last namevoid setMonthlySalary( int ); // set weekly salaryint getMonthlySalary(); // return weekly salaryprivate :string firstName; // Employee's first namestring lastName; // Employee's last nameint monthlySalary; // Employee's salary per month}; // end class Employee类成员函数:#include <iostream>using std::cout;#include "Employee.h" // Employee class definition// Employee constructor initializes the three data membersEmployee::Employee( string first, string last, int salary ){setFirstName( first ); // store first namesetLastName( last ); // store last namesetMonthlySalary( salary ); // validate and store monthly salary} // end Employee constructor// set first namevoid Employee::setFirstName( string name ){firstName = name; // no validation needed} // end function setFirstName// return first namestring Employee::getFirstName(){return firstName;} // end function getFirstName// set last namevoid Employee::setLastName( string name ){lastName = name; // no validation needed} // end function setLastName// return last namestring Employee::getLastName(){return lastName;} // end function getLastName// set monthly salary; if not positive, set to 0.0void Employee::setMonthlySalary( int salary ){if ( salary > 0 ) // if salary is positivemonthlySalary = salary; // set monthlySalary to salaryif ( salary <= 0 ) // if salary is not positivemonthlySalary = 0; // set monthlySalary to 0.0} // end function setMonthlySalary// return monthly salaryint Employee::getMonthlySalary(){return monthlySalary;} // end function getMonthlySalary测试函数:#include <iostream>using std::cout;using std::endl;#include "Employee.h" // include definition of class Employee// function main begins program executionint main(){// create two Employee objectsEmployee employee1( "Lisa" , "Roberts" , 4500 );Employee employee2( "Mark" , "Stein" , 4000 );// display each Employee's yearly salarycout << "Employees' yearly salaries: " << endl;// retrieve and display employee1's monthly salary multiplied by 12int monthlySalary1 = employee1.getMonthlySalary();cout << employee1.getFirstName() << " " << employee1.getLastName() << ": $" << monthlySalary1 * 12 << endl;// retrieve and display employee2's monthly salary multiplied by 12int monthlySalary2 = employee2.getMonthlySalary();cout << employee2.getFirstName() << " " << employee2.getLastName() << ": $" << monthlySalary2 * 12 << endl;// give each Employee a 10% raiseemployee1.setMonthlySalary( monthlySalary1 * 1.1 );employee2.setMonthlySalary( monthlySalary2 * 1.1 );// display each Employee's yearly salary againcout << "\nEmployees' yearly salaries after 10% raise: " << endl;// retrieve and display employee1's monthly salary multiplied by 12 monthlySalary1 = employee1.getMonthlySalary();cout << employee1.getFirstName() << " " << employee1.getLastName() << ": $" << monthlySalary1 * 12 << endl;monthlySalary2 = employee2.getMonthlySalary();cout << employee2.getFirstName() << " " << employee2.getLastName() << ": $" << monthlySalary2 * 12 << endl;return 0; // indicate successful termination} // end main3.14类定义:class Date{public :Date( int , int , int ); // constructor initializes data membersvoid setMonth( int ); // set monthint getMonth(); // return monthvoid setDay( int ); // set dayint getDay(); // return dayvoid setYear( int ); // set yearint getYear(); // return yearvoid displayDate(); // displays date in mm/dd/yyyy formatprivate :int month; // the month of the dateint day; // the day of the dateint year; // the year of the date}; // end class Date类成员函数:#include <iostream>using std::cout;using std::endl;#include "Date.h" // include definition of class Date from Date.h// Date constructor that initializes the three data members;// assume values provided are correct (really should validate)Date::Date( int m, int d, int y ){setMonth( m );setDay( d );setYear( y );} // end Date constructor// set monthvoid Date::setMonth( int m ){month = m;if ( month < 1 )month = 1;if ( month > 12 )month = 1;} // end function setMonth// return monthint Date::getMonth(){return month;} // end function getMonth// set dayvoid Date::setDay( int d ){day = d;} // end function setDay// return dayint Date::getDay(){return day;} // end function getDay// set yearvoid Date::setYear( int y ){year = y;} // end function setYear// return yearint Date::getYear(){return year;} // end function getYear// print Date in the format mm/dd/yyyyvoid Date::displayDate(){cout << month << '/' << day << '/' << year << endl;} // end function displayDate测试函数:#include <iostream>using std::cout;using std::endl;#include "Date.h" // include definition of class Date from Date.h // function main begins program executionint main(){Date date( 5, 6, 1981 ); // create a Date object for May 6, 1981 // display the values of the three Date data memberscout << "Month: " << date.getMonth() << endl;cout << "Day: " << date.getDay() << endl;cout << "Year: " << date.getYear() << endl;cout << "\nOriginal date:" << endl;date.displayDate(); // output the Date as 5/6/1981// modify the Datedate.setMonth( 13 ); // invalid monthdate.setDay( 1 );date.setYear( 2005 );cout << "\nNew date:" << endl;date.displayDate(); // output the modified date (1/1/2005)return 0; // indicate successful termination} // end main3.15类定义:#ifndef COMPLEX_H#define COMPLEX_Hclass Complex{public :Complex( double = 0.0, double = 0.0 ); // default constructor Complex add( const Complex & ); // function add Complex subtract( const Complex & ); // function subtractvoid printComplex(); // print complex number formatvoid setComplexNumber( double , double ); // set complex number private :double realPart;double imaginaryPart;}; // end class Complex#endif类成员函数:#include <iostream>using std::cout;#include "Complex.h"Complex::Complex( double real, double imaginary ){setComplexNumber( real, imaginary );} // end Complex constructorComplex Complex::add( const Complex &right ){return Complex(realPart + right.realPart, imaginaryPart + right.imaginaryPart ); } // end function addComplex Complex::subtract( const Complex &right ){return Complex(realPart - right.realPart, imaginaryPart - right.imaginaryPart ); } // end function subtractvoid Complex::printComplex(){cout << '(' << realPart << ", " << imaginaryPart << ')' ;} // end function printComplexvoid Complex::setComplexNumber( double rp, double ip ){realPart = rp;imaginaryPart = ip;} // end function setComplexNumber测试函数:#include <iostream>using std::cout;using std::endl;#include "Complex.h"int main(){Complex a( 1, 7 ), b( 9, 2 ), c; // create three Complex objectsa.printComplex(); // output object acout << " + " ;b.printComplex(); // output object bcout << " = " ;c = a.add( b ); // invoke add function and assign to object cc.printComplex(); // output object ccout << '\n' ;a.setComplexNumber( 10, 1 ); // reset realPart andb.setComplexNumber( 11, 5 ); // and imaginaryParta.printComplex(); // output object acout << " - " ;b.printComplex(); // output object bcout << " = " ;c = a.subtract( b ); // invoke add function and assign to object cc.printComplex(); // output object ccout << endl;return 0;} // end main3.16类定义:#ifndef RATIONAL_H#define RATIONAL_Hclass Rational{public :Rational( int = 0, int = 1 ); // default constructorRational addition( const Rational & ); // function addition Rational subtraction( const Rational & ); // function subtraction Rational multiplication( const Rational & ); // function multi. Rational division( const Rational & ); // function divisionvoid printRational (); // print rational formatvoid printRationalAsDouble(); // print rational as double format private :int numerator; // integer numeratorint denominator; // integer denominatorvoid reduction(); // utility function}; // end class Rational#endif类成员函数:#include <iostream>using std::cout;#include "Rational.h" // include definition of class Rational Rational::Rational( int n, int d ){numerator = n; // sets numeratordenominator = d; // sets denominatorreduction(); // store the fraction in reduced form} // end Rational constructorRational Rational::addition( const Rational &a ){Rational t; // creates Rational objectt.numerator = a.numerator * denominator;t.numerator += a.denominator * numerator;t.denominator = a.denominator * denominator;t.reduction(); // store the fraction in reduced formreturn t;} // end function additionRational Rational::subtraction( const Rational &s ){Rational t; // creates Rational objectt.numerator = s.denominator * numerator;t.numerator -= denominator * s.numerator;t.denominator = s.denominator * denominator;t.reduction(); // store the fraction in reduced formreturn t;} // end function subtractionRational Rational::multiplication( const Rational &m ) {Rational t; // creates Rational objectt.numerator = m.numerator * numerator;t.denominator = m.denominator * denominator;t.reduction(); // store the fraction in reduced formreturn t;} // end function multiplicationRational Rational::division( const Rational &v ){Rational t; // creates Rational objectt.numerator = v.denominator * numerator;t.denominator = denominator * v.numerator;t.reduction(); // store the fraction in reduced formreturn t;} // end function divisionvoid Rational::printRational (){if ( denominator == 0 ) // validates denominatorcout << "\nDIVIDE BY ZERO ERROR!!!" << '\n' ;else if ( numerator == 0 ) // validates numeratorcout << 0;elsecout << numerator << '/' << denominator;} // end function printRationalvoid Rational::printRationalAsDouble(){cout << static_cast < double >( numerator ) / denominator; } // end function printRationalAsDoublevoid Rational::reduction(){int largest;largest = numerator > denominator ? numerator : denominator;int gcd = 0; // greatest common divisorfor ( int loop = 2; loop <= largest; loop++ )if ( numerator % loop == 0 && denominator % loop == 0 ) gcd = loop;if (gcd != 0){numerator /= gcd;denominator /= gcd;} // end if} // end function reduction测试函数:#include <iostream>using std::cout;using std::endl;#include "Rational.h" // include definition of class Rationalint main(){Rational c( 2, 6 ), d( 7, 8 ), x; // creates three rational objects c.printRational(); // prints rational object ccout << " + " ;d.printRational(); // prints rational object dx = c.addition( d ); // adds object c and d; sets the value to x cout << " = " ;x.printRational(); // prints rational object xcout << '\n' ;x.printRational(); // prints rational object xcout << " = " ;x.printRationalAsDouble(); // prints rational object x as double cout << "\n\n" ;c.printRational(); // prints rational object ccout << " - " ;d.printRational(); // prints rational object dx = c.subtraction( d ); // subtracts object c and dcout << " = " ;x.printRational(); // prints rational object xcout << '\n' ;x.printRational(); // prints rational object xcout << " = " ;x.printRationalAsDouble(); // prints rational object x as double cout << "\n\n" ;c.printRational(); // prints rational object ccout << " x " ;d.printRational(); // prints rational object dx = c.multiplication( d ); // multiplies object c and dcout << " = " ;x.printRational(); // prints rational object xcout << '\n' ;x.printRational(); // prints rational object xcout << " = " ;x.printRationalAsDouble(); // prints rational object x as double cout << "\n\n" ;c.printRational(); // prints rational object ccout << " / " ;d.printRational(); // prints rational object dx = c.division( d ); // divides object c and dcout << " = " ;x.printRational(); // prints rational object xcout << '\n' ;x.printRational(); // prints rational object xcout << " = " ;x.printRationalAsDouble(); // prints rational object x as double cout << endl;return 0;} // end main3.17类定义:#ifndef TIME_H#define TIME_Hclass Time{public :public :Time( int = 0, int = 0, int = 0 ); // default constructor// set functionsvoid setTime( int , int , int ); // set hour, minute, second void setHour( int ); // set hour (after validation) voidsetMinute( int ); // set minute (after validation)void setSecond( int ); // set second (after validation)// get functionsint getHour(); // return hourint getMinute(); // return minuteint getSecond(); // return secondvoid tick(); // increment one secondvoid printUniversal(); // output time in universal-time format void printStandard(); // output time in standard-time format private :int hour; // 0 - 23 (24-hour clock format)int minute; // 0 - 59int second; // 0 - 59}; // end class Time#endif类成员函数:#include <iostream>using std::cout;#include <iomanip>using std::setfill;using std::setw;#include "Time.h" // include definition of class Time from Time.h // Time constructor initializes each data member to zero;// ensures that Time objects start in a consistent stateTime::Time( int hr, int min, int sec ){setTime( hr, min, sec ); // validate and set time} // end Time constructor// set new Time value using universal time; ensure that// the data remains consistent by setting invalid values to zerovoid Time::setTime( int h, int m, int s ){setHour( h ); // set private field hoursetMinute( m ); // set private field minutesetSecond( s ); // set private field second} // end function setTime// set hour valuevoid Time::setHour( int h ){hour = ( h >= 0 && h < 24 ) ? h : 0; // validate hour} // end function setHour// set minute valuevoid Time::setMinute( int m ){minute = ( m >= 0 && m < 60 ) ? m : 0; // validate minute } // end function setMinute// set second valuevoid Time::setSecond( int s ){second = ( s >= 0 && s < 60 ) ? s : 0; // validate second } // end function setSecond// return hour valueint Time::getHour(){return hour;} // end function getHour// return minute valueint Time::getMinute(){return minute;。

新人教版选修5高二化学练习卷:1.2 有机化合物的结构特点

新人教版选修5高二化学练习卷:1.2  有机化合物的结构特点

有机化合物的结构特点1.下列结构式从成键情况看不合理的是()2.甲、乙两种有机物的球棍模型如下:下列有关两者的描述中正确的是()A.甲、乙为同一物质B.甲、乙互为同分异构体C.甲、乙一氯取代物的数目不同D.甲、乙分子中含有的共价键数目不同3.下列物质的一氯取代物的同分异构体数目相同的是()A.①②B.③④C.②③D.②④4.篮烷的结构如图所示。

下列说法中正确的是()A.篮烷的分子式为C12H20B.篮烷分子中存在2个六元环C.蓝烷分子中存在3个五元环D.篮烷的一氯代物共有4种同分异构体5.下列各图均能表示甲烷的分子结构,哪一种更能反映其真实存在状况()A.Ⅰ B.ⅠC.Ⅰ D.Ⅰ6.下列分子式或结构简式只能表示一种物质的是()A.CH2O B.C2H4O2C.C2H6O D.C3H7OH7.下列关于二氟二氯甲烷(CCl2F2)的说法正确的是()A.只有一种结构B.有两种同分异构体C.分子中有非极性键D.分子中有极性键和非极性键8.下列结构中,从成键情况看不合理的是()9.从煤焦油中分离出的芳香烃——萘()是一种重要的化工原料,萘环上一个氢原子被丁基(—C4H9)所取代的同分异构体(不考虑立体异构)有()A.2种B.4种C.8种D.16种10.某烃的一种同分异构体只能生成一种一氯代物,该烃的分子式可以是()A.C3H8B.C4H10C.C5H12D.C6H1411.有A、B两种烃,所含碳元素的质量分数相同,下列关于A和B的叙述中正确的是()A.二者不可能互为同系物B.二者一定互为同分异构体C.二者最简式相同D.各1 mol的A和B分别完全燃烧生成CO2的质量一定相等12.下图是维生素A的分子结构,维生素A中的含氧官能团是____________(填名称),维生素A的分子式是____________,1 mol维生素A最多能与__________mol Br2发生加成反应。

13.白藜芦醇的结构简式为:根据要求回答下列问题:(1)白藜芦醇的分子式为_________________________________。

九江2024年08版小学第十次英语第5单元真题

九江2024年08版小学第十次英语第5单元真题

九江2024年08版小学英语第5单元真题考试时间:60分钟(总分:100)考试人:_________题号一二三总分得分评级介绍:九江2024年08版小学英语第十次真题,第五单元主要考查词汇与简单句型,难度适中,重点在日常对话和情景理解,适合巩固学生基础知识。

一、(选择题)总分:30分(1分/题)1、What do you call an animal that eats plants?A, CarnivoreB, OmnivoreC, HerbivoreD, Scavenger2、What shape has three sides?A, SquareB, TriangleC, CircleD, Rectangle3、What is the main purpose of a seed?中文解释:种子的主要目的是什么?A, To make foodB, To grow new plantsC, To attract animals4、Which one is a type of shoe?A, SandalsB, HatC, ScarfD, Gloves5、What do we call a dish made of pasta and sauce?A, PizzaB, SpaghettiC, SaladD, Sandwich6、Which of the following means "花" in English? A, TreeB, LeafC, FlowerD, Grass7、给下列句子选择合适的应答语。

8、What does "植物文化传播" mean in English? A, Plant cultural disseminationB, Agricultural disseminationC, Environmental disseminationD, Ecological dissemination9、She has a pet rabbit. 她有一只宠物兔子。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

一、单项选择题
1. 股票的绝对估值方法主要是()。

A. 现金流贴现模型
B. 实物期权定价法
C. 资产评估法
D. 经济增加值法
描述:绝对估值法
您的答案:A
题目分数:10
此题得分:10.0
2. ()指标可以排除不同国家在税收、财务杠杆、会计政策方面
不一致,尤其适合高资本开支的公司。

A. EBITDA
B. EV
C. DCF
D. PE
描述:传统估值理论概述
您的答案:B
题目分数:10
此题得分:10.0
3. 根据价值核心原则()和增长是推动价值创造的两大力量。

A. 市值规模
B. 波动率
C. 财务杠杆
D. 投入资本回报率
描述:传统估值理论概述
您的答案:D
题目分数:10
此题得分:10.0
4. ()认为,一家公司对现有所有者是一个价值,对于其他潜在
所有者又是另外一个原则。

A. 价值核心原则
B. 价值守恒原则
C. 最佳所有者原则
D. 期望值跑步机原则
描述:公司金融的四大基石
您的答案:C
题目分数:10
此题得分:10.0
二、多项选择题
5. 对于传统的现金流折现模型来说,难以进行估值的公司包括
()。

A. 大宗商品类公司
B. 周期性公司
C. 金融服务类公司
D. 依赖无形资产的公司以及经营多元化的公司
描述:现金流折现法
您的答案:A,C,B
题目分数:10
此题得分:0.0
6. 传统的估值方法包括()。

A. 绝对估值法
B. 相对估值法
C. 经济增加值法
D. 技术价值评估法
描述:传统估值理论概述
您的答案:B,A
题目分数:10
此题得分:10.0
7. 下列属于股票相对估值方法的是()。

A. PE估值方法
B. PB 估值法
C. PS估值法
D. PEG
描述:相对估值法
您的答案:A,B,C,D
题目分数:10
此题得分:10.0
三、判断题
8. 市净率和市盈率之间存在着PE=PB/roe的关系。

()
描述:绝对估值法和相对估值法的关联
您的答案:正确
题目分数:10
此题得分:10.0
9. 价值守恒原则认为,只有改善现金流才可以创造价值。

()
描述:现金流折现法
您的答案:正确
题目分数:10
此题得分:10.0
10. DCF是实践应用中用来寻找股票估值的工具。

()
描述:传统估值理论概述
您的答案:错误
题目分数:10
此题得分:10.0
试卷总得分:90.0。

相关文档
最新文档