2018高级语言程序设计考卷B及参考答案

合集下载

2018年12月B级考试真题答案与解析

2018年12月B级考试真题答案与解析

2018年12月高等学校英语应用能力考试(B级)参考答案Part ⅠListening ComprehensionSection A(每题1分)1.A 2.C 3.D 4.B 5.D 6.A 7.BSection B(每题1分)8.B 9.C 10.A 11.D 12.C 13.B 14.ASection C(每题1分)15.D 16.B 17.C 18.B 19.DSection D(每题1分)20. common 21. usually 22. pay in cash 23. on the rise 24. taking the busPart ⅡVocabulary and StructureSection A(每题1分)25.B 26.D 27.A 28.C 29.B 30.C 31.D 32.A 33.B 34.DSection B(每题1分)35. to see 36. be delivered 37. sending 38. equipment 39. cheaperPart ⅢReading ComprehensionTask 1(每题2分)40.C 41.D 42.A 43.B 44.ATask 2(每题2分)45.B 46.D 47.ATask 3(每题1分)48. return 49. the/your packaging 50. easily seen 51. detailed information 52. photos Task 4(每题1分)53.CM 54.KP 55.JI 56.AO 57.QETask 5(每题1分)58. insurance card59. the policy number60. insurance provider’s website61. any changes62. expensive67. 参考译文(7分)我们希望你已发现这个页面上的提示很有用,并且可以在下次所有度假时使用。

2018年10月高等教育自学考试全国统一命题考试C++程序设计试卷(课程代码04737)附答案

2018年10月高等教育自学考试全国统一命题考试C++程序设计试卷(课程代码04737)附答案

2018年10月高等教育自学考试全国统一命题考试C++程序设计试卷(课程代码04737)本试卷共l0页,满分l00分,考试时间l50分钟。

考生答题注意事项:1.本卷所有试题必须在答题卡上作答。

答在试卷上无效,试卷空白处和背面均可作草稿纸。

2.第一部分为选择题。

必须对应试卷上的题号使用2B铅笔将“答题卡”的相应代码涂黑。

3.第二部分为非选择题。

必须注明大、小题号,使用0.5毫米黑色字迹签字笔作答。

4.合理安排答题空间,超出答题区域无效。

第一部分选择题一、单项选择题:本大题共20小题,每小题l分,共20分。

在每小题列出的备选项审只有一项是最符合题目要求的,请将其选出。

2.设X和y均为bool量,则x&&y曲为真的条件是A.它们均为真 B.其中一个为真 C.它们均为假 D.其中一个为假3.拷贝构造函数应该是A.不带参数的构造函数 B.带有一个参数的构造函数C.带有两个参数的构造函数 D.缺省构造函数4.以下说法中正确的是A.C++程序总是从第一个定义的函数开始执行B.C++程序总是从main函数开始执行C. C++中函数必须有返回值D.C++中函数名必须唯一5.下列虚基类的声明中,正确的是A.class virtual B:public A B.class B:virtual public AC.class B:public A virtual D.virtual class B:public A6.下列哪个类型函数不适合声明为内联函数A.函数体语句较多 B.函数体语句较少C.函数执行时间较短 D.函数被频繁调用7.以下类模板定义正确的为A.template<class T> B.template<class T.class int i>C.template<class T,typename T> D.template<class Tl,T2>8.C++中要实现动态联编,调用虚函数时必须使用A.基类指针 B.类名 C.派生类指针 D.对象名9.下列对静态成员的描述中,不正确的是·A.静态成员不属于对象,是类的共享成员B.静态数据成员要在类外定义和初始化C.调用静态成员函数时要通过类或对象激活,所以静态成员函数拥有this指针D.非静态成员函数也可以操作静态数据成员10.下列对派生类的描述中,错误的是A.一个派生类可以作为另一个派生类的基类B.派生类至少有一个基类C.派生类的成员除了它自己的成员外,还包含了它的基类的成员D.派生类中继承的基类成员的访问权限到派生类保持不变11.下列函数原型声明语句中,错误的是A.int f(void); B.void f(hat); C.int f(a); D.void f(double a);12.如果有洒t型变量a,则定义指向变量a的指针P正确的写法是A.int P=&a B.int * P=&a C.int&p=*a D.int*P = a13.假定指针变量P定义为“int冰P=flew int(100);”,要释放P所指向盼动态内存,应使用语句A.delete p; B.delete* p; C.delete&p; D.delete[]p;14.假定A为一个类,则执行“A a[3],b(3);”语句时调用该类构造函数的次数为A.3 B.4 C.5 D.915.C++中定义标准输入输出的痒为A.stdio B.math C。

B - 2018年6月 试卷+答案+解析_PDF密码解除

B - 2018年6月 试卷+答案+解析_PDF密码解除

families. There is no experience needed and we supply the 21 . Just volunteer for a day. It's fun,
rewarding and you can learn some'·122·-' !
I ! . :' , !. ,
Therefore, C) Yes, certai11ly is the correct answer. You should mark CJ on the Answer Sheet
with a single line through the center.
[A] [BJ图[DJ
Now the test will begin.
,,.,,,p reading is for you to check your writing. Now the passage will begin.
us Volwiteers are our heart and. soul.' lease come and heip b叫d homes for 20 low-income
B) She has a high fever.
D) She has got a pain in the stomach.
18. A) This morning.
C) Last night.
B) This afternoon
D) Yesterday.
19. A) Take her blood pressure. B) Give her some medicine.
,. , . , , · dialogues in札A府r., ,ecu;fi 1,ialo匹e,. there is a戏co,;<f,.f!<t. q'H�stion,1,Both the dialogues and

10月全国自考高级语言程序设计(一)试题及答案解析

10月全国自考高级语言程序设计(一)试题及答案解析
14.若用数组名作为函数调用时的实参,则实际上传ห้องสมุดไป่ตู้给形参的是( )
A.数组的第一个元素值B.数组元素的个数
C.数组中全部元素的值D.数组首地址
15.下列错误的是( )
A. char s[]=″China″;B. char s[10]={″China″};
C. char s[10]; s=″China″;D. char s[10]={′C′,′h′,′i′,;′n′,′a′};
}
printf(″\n″);
}
四、程序填充题(本大题共3小题,每小题6分,共18分)
给出下列程序,将横线处缺少的部分补上,使其能正确运行。
36.一个三位整数(100~999),若各位数的立方和等于该数自身,则称其为“水仙花数”(如:153=13+53+33),找出所有的这种数。
main( )
{
int n, a, b, c;/*n、a、b和c分别为三位数自身及其个位、十位和百位*/
for(i=1;i<3;i++)f(i);
}
f(int j)
{ static int a=100;
int k=1;
++k;
printf(″%d\n″, j+a+k);
a-=2;
}
32. #include <stdio. h>
long fun(int n)
{ long s;
if(n<=2)s=2;
else s=n+fun(n-1);
}
五、程序设计题(本大题共3小题,第39小题5分,第40、41小题各6分,共17分)
39.输入某学生的数学(math)、英语(english)和C语言(C)的成绩,输出该学生这三门课的成绩、总成绩(sum)和平均成绩(aver)。

2018高级语言程序设计考卷B及参考答案

2018高级语言程序设计考卷B及参考答案

⋯⋯⋯⋯试卷名装订姓线⋯⋯⋯⋯⋯⋯装订线内不号要学答题,不要填写考生信级息班⋯业⋯专⋯⋯⋯⋯试卷装订线⋯院⋯学⋯⋯武汉理工大学考试试卷(B 卷)2018~2019 学年 1 学期高级语言程序设计 A课程闭卷时间 120分钟,56 学时, 3.5 学分,总分 100 分,占总评成绩 70%年月日题号一二三四五六七八九十合计任课满分30251530100教师得分得分一、单项选择题(本大题共15 小题,每小题 2 分,共30 分)在每小题列出的四个备选项中只有一个是符合题目要求的,请将所选代码填写在下面表格中的对应位置。

错选、多选或未选均无分。

1234567891011121314151.在 C++中,错误的 int类型的常数是A .0B. 037C. 0xaf D. 1E52.已知 int x = 7,y=8,z=5;则表达式 (x*y/z++)的值是A .9B. 9.33C. 11D. 11.203.与 k=n++完全等价的表达式是A .k=n , n=n+1B. n=n+1, k=n C. k=++n D. k+=n+14.设 int a=1,b=2,c=3,d=4,f;,执行语句 f=(a!=b)?c++:d++ ;后 f 的值是A .2B. 3C. 4D. 55.设 int a;, 则语句 for(a=0;a==0;a++);和语句 for(a=0;a=0;a++);执行循环的次数分别是A .0,0B.1, 0C.0,1D. 1,16.若有定义 int a[4]={1, 2,3, 4} ;则 a[a[0]+2 * a[2]-a[3]]等于A .1B. 2C. 3D. 47.定义二维数组并初始化,正确的是A.int a[ ][ ]={1,2,3,4,5,6};B. int a[ ][3]={1,2,3,4,5,6};C. int a[2][ ]={1,2,3,4,5,6};D.int a[2,3]={1,2,3,4,5,6};8.下面有关重载函数的说法中,正确的是A .重载函数名可以不同B .重载函数必须有不同的形参列表C.重载函数形参个数必须不同 D .重载函数必须具有不同的返回值类型9.在 C++中,函数的形式参数是A .局部变量B.全局变量C.静态变量D.外部变量10.设有 int a[3][2]={1,2,3,4,5,6,}, (*p)[3] ; p=a;则 *( p+1) +1 代表的是A. a[0][1]+1 B . &a[1]+1C. a[1][1] D . &a[1][1]11.已知函数 func 的原型是 double func(double *pd , int &ri);变量 x 和 y 的定义是 double x ;int y;则正确的调用语句是A. func(x,&y) ; B . func(&x,y); C. func(&x,&y); D . func(x,y) ;12.设有定义int i=0;执行语句“while ( i++<5 );”后,变量 i 的值为A. 1 B . 5C. 6 D .713.设有定义 int a[20];则与元素a[4]等价的表示为A. a+4B. *a+4C. *(a+4)D. *(a+16)14.设有定义 int i,*p;使 p 指向 i 的赋值语句是A . p=&i ;B . *p=&i ;C. *p=i ;D. p=*&i ;15.设宏定义#define N 3#define Y(n) ((N+1)*n)则执行语句cout<<2*(N+Y(5+1))<<endl;后的输出结果是A. 42B.48C. 54 D .62得分二、程序阅读题(本大题共 5 小题,每小题 5 分,共25 分)请将下面各程序运行后的输出结果填写在下划线处。

(全新整理)10月高级语言程序设计一全国自考试卷及答案解析

(全新整理)10月高级语言程序设计一全国自考试卷及答案解析
全国2018年10月高等教育自学考试
高级语言程序设计(一)试题
课程代码:00342
一、单项选择题(本大题共15小题,每小题2分,共30分)
在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。错选、多选或未选均无分。
1.可以作为自定义标识符的是( )
A.2xB.break
C.m-nD.m_n
2.正确的变量定义是( )
A.unsigned long d=1000;B.float m1=m2=10.0;
C.char c1=’A’,c2=A;D.double x=0.618,x=3.14;
3.表达式的值为0的是( )
A.5/5%5B.5>2
C.!4D.0x7&7
4.设int a=1,b=2;,则执行a=b+2,a++,a+b;后a和b的值分别是( )
34.(1)编写一个计算梯形面积的函数。函数头是:float area(float t,float b,float h)
其中变量t、b和h分别表示梯形的上底、下底和高。
(2)编写主函数从键盘输入梯形的上底、下底和高的值,调用上述函数输出梯形面积
(保留小数点后两位)。
case 3:
case 4:y=_____________;break; /*第三空*/
default :y=1/(x*x+1);
}
printf(〞x=%7.2f,y=%10.6f\n〞,x,y);
}
}
五、程序设计题(本大题共2小题,每小题8分,共16分)
33.从键盘输入100个整数,计算并输出大于等于零的数的平均值(保留小数点后两位)。
则执行语句printf(〞%s%d\n〞,p->name,stu[1].age);后输出结果是( )

2018年b级考试真题试卷及答案

2018年b级考试真题试卷及答案

2018年b级考试真题试卷及答案由于不清楚您所说的“b级考试”具体是指哪种类型的B级考试(例如英语B级考试、计算机B级考试等),以下以高等学校英语应用能力B级考试为例为您提供部分真题示例:一、词汇与语法结构(Vocabulary & Structure)1. - How much ______ this pair of shoes?- Twenty dollars ______ enough.A. is; isB. is; areC. are; isD. are; are.答案:A。

解析:“this pair of shoes”的中心词是“pair”,为单数概念,所以第一空用“is”;“Twenty dollars”表示金钱数量,作主语时视为一个整体,谓语动词用单数形式,所以第二空也用“is”。

2. We must find a way to cut prices ______ reducing our profits too much.A. withoutB. despiteC. withD. for.答案:A。

解析:句意为“我们必须找到一种在不过多减少利润的情况下降低价格的方法”。

“without”表示“没有;不”,符合语境;“despite”表示“尽管”;“with”表示“和;带有”;“for”表示“为了;因为”。

3. She didn't know ______ to express her ideas clearly when she was invited to speak at a meeting.A. whereB. whyC. whatD. how?答案:D。

解析:句意为“当她被邀请在会议上发言时,她不知道如何清晰地表达自己的想法”。

“how”表示“如何”,在这里作方式状语,引导宾语从句。

4. The new model of the car was put into production in 2018, ______ helped to provide another 1400 jobs.A. thatB. whenC. whatD. which.答案:D。

全国计算机b级考试试题及答案

全国计算机b级考试试题及答案

全国计算机b级考试试题及答案【全国计算机B级考试试题及答案】SECTION 1: MULTIPLE CHOICE QUESTIONS1. What is the output of the following code snippet?```pythonx = 5y = 3print(x + y * 2)```A. 8B. 11C. 13D. 16Answer: C. 132. Which of the following is NOT a valid data type in Python?A. intB. floatC. stringD. booleanAnswer: D. boolean3. What is the result of the following code?```pythonmy_list = [1, 2, 3, 4, 5]print(my_list[-3])```A. 1B. 2C. 3D. 4Answer: C. 34. What is the output of the following code snippet? ```pythonfor i in range(3):print(i)```A. 0 1 2B. 1 2 3C. 0 1 2 3D. 1 2 3 4Answer: A. 0 1 2SECTION 2: SHORT ANSWER QUESTIONS1. Define recursion and provide an example.Recursion is a programming concept where a function calls itself directly or indirectly. It allows a problem to be solved by breaking it down into smaller, simpler instances of the same problem.Example:```pythondef factorial(n):if n == 0:return 1else:return n * factorial(n-1)print(factorial(5))```2. Briefly explain Object-Oriented Programming (OOP) and provide one advantage of using OOP.Object-Oriented Programming (OOP) is a programming paradigm that organizes code into objects, which are instances of classes. OOP focuses on the creation and manipulation of objects to solve complex problems.Advantage of using OOP:One advantage of using OOP is code reusability. OOP allows developers to create reusable classes and objects, reducing duplication of code and promoting efficient development practices.SECTION 3: CODING PROBLEMWrite a Python program to calculate the average of a list of numbers.```pythondef calculate_average(numbers):if len(numbers) == 0:return 0else:sum = 0for num in numbers:sum += numaverage = sum / len(numbers)return averagenumbers_list = [5, 10, 15, 20, 25]print(calculate_average(numbers_list))```Answer: The average of the numbers [5, 10, 15, 20, 25] is 15.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
for(p=s1;*p&&*p!=*s;p++); if(*p) *s=*(p-s1+s2); } } int main() { char s[MAX]="AaBbCcDd"; char s1[MAX]="abc"; char s2[MAX]="xyz"; rep(s,s1,s2); cout<<s<<endl; return 0; }
8.下面有关重载函数的说法中,正确的是
A.重载函数名可以不同
B.重载函数必须有不同的形参列表
C.重载函数形参个数必须不同 D.重载函数必须具有不同的返回值类型
9.在 C++中,函数的形式参数是 A.局部变量 B.全局变量
C.静态变量
D.外部变量
专业班级
学院
1
10.设有 int a[3][2]={1,2,3,4,5,6,},(*p)[3]; p=a; 则*(p+1)+1 代表的是
int n = 60; prim(n, 2); cout<<endl; return 0; }
输出:
20. #include <iostream> using namespace std; #define MAX 50 void rep(char *s,char *s1,char *s2) {
char *p; for(;*s;s++) {
12.设有定义 int i=0; 执行语句“ while (i++<5); ”后,变量 i 的值为
A.1
B.5
C.6
D.7
13.设有定义 int a[20]; 则与元素 a[4]等价的表示为
A. a+4
B.*a+4
C.*(a+4)
D.*(a+16)
14.设有定义 int i,*p; 使 p 指向 i 的赋值语句是
D.k+=n+1
4.设 int a=1,b=2,c=3,d=4,f;,执行语句 f=(a!=b)?c++:d++; 后 f 的值是
A.2
B.3
C.4
D.5
5.设 int a;,则语句 for(a=0;a==0;a++);和语句 for(a=0;a=0;a++);执行循环的次数分别

A.0,0
B.1,0
请将下面各程序运行后的输出结果填写在下划线处。
16. #include <iostream> using namespace std; int main( ) { int a[3][3]={1,2,3,4,5,6,7,8,9}; int n,sum=0; for(n=0;n<3;n++) sum=sum+a[n][n]; cout<<sum<<endl; return 0; } 输出:
17. #include <iostream> using namespace std; int main() { int x,y,s=0,k; for (x=1;x<=5;x++) { k=0; for (y=1;y<=x;y++) k=10*k+x; s=s+k; } cout<<s<<endl; return 0; } 输出:
题号 一 二 三 四 五 六 七 八 九 十 合计 任课
满分 30 25 15 30
100 教师
得分
得分
一、单项选择题 (本大题共 15 小题,每小题 2 分,共 30 分)
在每小题列出的四个备选项中只有一个是符合题目要求的,请将所选代码填写在下面表格中
的对应位置。错选、多选或未选均无分。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
姓名Байду номын сангаас
学号
…………试卷装订线 ……………… 装订线内不要答题,不要填写考生信息………………试卷装订线 …………
武汉理工大学考试试卷(B 卷)
2018 ~2019 学年 1 学期 高级语言程序设计 A 课程 闭卷
时间 120 分钟, 56 学时, 3.5 学分,总分 100 分,占总评成绩 70 % 年 月 日
输出:
19.
#include <iostream> using namespace std; void prim(int m, int n) {
if(m>n){ while(m%n != 0) n++; m /= n; prim(m, n); cout<<n<<"*";
} } int main() {
C.0,1
D.1,1
6.若有定义 int a[4]={1,2,3,4};则 a[a[0]+2 * a[2]-a[3]]等于
A.1
B.2
C.3
D.4
7.定义二维数组并初始化,正确的是 A.int a[ ][ ]={1,2,3,4,5,6}; C. int a[2][ ]={1,2,3,4,5,6};
B. int a[ ][3]={1,2,3,4,5,6}; D.int a[2,3]={1,2,3,4,5,6};
A.a[0][1]+1
B.&a[1]+1
C.a[1][1]
D.&a[1][1]
11.已知函数 func 的原型是 double func(double *pd,int &ri);
变量 x 和 y 的定义是 double x; int y; 则正确的调用语句是 A.func(x,&y); B.func(&x,y); C.func(&x,&y); D.func(x,y);
1.在 C++中,错误的 int 类型的常数是
A.0
B.037
C.0xaf
D.1E5
2.已知 int x=7,y=8,z=5; 则表达式(x*y/z++)的值是
A.9
B.9.33
C. 11
D. 11.20
3.与 k=n++完全等价的表达式是 A.k=n,n=n+1 B.n=n+1,k=n C.k=++n
2
18. #include <iostream> using namespace std; int fib(void) { static int f0=0,fl=1; int f; f=f0+fl; f0=fl; fl=f; return(f); } int main() { int i,s=0; for(i=1;i<=8;i++) s=s+fib(); cout<<s<<endl; return 0; }
A.p=&i;
B.*p=&i;
C.*p=i;
D.p=*&i;
15.设宏定义 #define N 3
#define Y(n) ((N+1)*n)
则执行语句 cout<<2*(N+Y(5+1))<<endl;后的输出结果是
A.42
B.48
C.54
D.62
得分
二、程序阅读题(本大题共 5 小题,每小题 5 分,共 25 分)
相关文档
最新文档