当前在线人数9256
首页 - 分类讨论区 - 娱乐休闲 - 大脑工作室版 - 同主题阅读文章

此篇文章共收到打赏
0

  • 10
  • 20
  • 50
  • 100
您目前伪币余额:0
未名交友
[更多]
[更多]
c++ 选择题求解
[版面:大脑工作室][首篇作者:tinytear] , 2012年08月25日12:49:01 ,2067次阅读,0次回复
来APP回复,赚取更多伪币 关注本站公众号:
[分页:1 ]
tinytear
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 1 ]

发信人: tinytear (cookiehui), 信区: BrainTeaser
标  题: c++ 选择题求解
发信站: BBS 未名空间站 (Sat Aug 25 12:49:01 2012, 美东)

1. What is Visual C++?
a.It's a program used for starting other programs.
b.It's a program that you use to create other programs.
c.It's a program for browsing the Web.
d.It's a multimedia program that teaches you how to program.

2.What is the name of the process by which Visual C++ converts your C++
code to a program the computer can understand?
a.Compile.
b.Run.
c.Debug.
d.Build.

3.What do you call the container that stores all the files you write and
all the files Visual C++ writes to create a program?
a.Solution Explorer.
b.Software.
c.Class.
d.Project.

4. Which one of the following is a good example of an attribute for a class
Car?
a.Drive.
b.Color.
c.Stop.
d.Car.

5.Suppose you have a class called Porsche. This class has two attributes,
each being an instance of class BucketSeat. Which statement below
correctly describes this situation?
a.The class Porsche is a BucketSeat.
b.The class Porsche has a BucketSeat.
c.The class BucketSeat is a Porsche.
d.The class BucketSeat has a Porsche.

6. When you use Visual C++, which window do you use to change the
attributes of a form?
a.Form designer.
b.Properties window.
c.Solution Explorer.
d.Object.

7. You've just been hired to write a program for the bank down the street.
What should you do first?
a.Identify the problem and decide why you're writing the program and
who will use it.
b.Design the program using the form designer in C++Builder.
c.Write a set of classes.
d.Divide up your source code into multiple files.

8. What is a technical word for a step-by-step process?
a.Class.
b.Inheritance.
c.If statement.
d.Algorithm.

9. What is a radio button?
a.A control you can type words into.
b.A control with text and a small circular button to its left that you
can click.
c.A control with a slider on it so you can scroll through your forms.
d.A control with a drop-down menu.

10.What type of variable would hold the number 253? (Notice that there
are no double quotation marks around the number 253.)
a.A string variable.
b.A pointer variable.
c.A character variable.
d.An integer variable.

11. Which line of code below declares a variable called Count as an integer
and sets its initial value to 189?
a.int Count = 189;
b.int Count = "189";
c.string Count = "189";
d.string Count = 189;

12. What is a comment in your code?
a.A note in the code that instructs the computer to perform a task.
b.A note that you type into the form designer.
c.A note in the code for the humans reading the program.
d.A note that you type into the Properties window.

13. In an if statement, how do you compare if two numbers are equal?
a.Use != to check for equality.
b.Use == to check for equality.
c.Use <= to check for equality.
d.Use >= to check for equality.

14.If you're doing a case-sensitive comparison (that is, you want your
comparison to be sensitive to case), then which one of the following two
comparisons will be equal?
a.'HOUSE' and 'house'
b.'hose' and 'HOSE'
c.'HORSE' and 'HORSE'
d.'HOWS' and 'HOUSE'

15.Which of the following keywords serves the purpose of "otherwise" or
"none of the above" in an if statement?
a.if
b.{
c.}
d.else

16. How many elements are in the following array?
int morenumbers[80];
a.79.
b.80.
c.0.
d.81.

17. What is the first and last element in the following array?
int morenumbers[80];
a.The first is 0 and the last is 80.
b.The first is 0 and the last is 79.
c.The first is 1 and the last is 80.
d.The first is 1 and the last is 79.

18.Which one of the following sets of code will run a for loop, starting
with 0, and going up to and including 79? (Be sure to pay close attention
to the less-than signs and the equal signs.)
a.int x;
for (x=0; x<79; x++) { x++)="">
b.int x;
for (x=0; x<78; x++) { x++)="">
c.int x;
for (x=0; x<=80; x++) { x++)="">
d.int x;
for (x=0; x<=79; x++) { x++)="">

19. In computer programming, what do you call a block of code that may take
information, process code, and may return a value?
a.An array.
b.A class.
c.A for-loop.
d.A function.

20.Look very closely at the following function. What does it do?
int AddTwo(int Original)
{
int NewNumber;
NewNumber = Original + 2;
return NewNumber;
}
a.The function adds two to a number and returns the answer.
b.The function takes a two and adds two to get four.
c.The function takes an original number and adds the original number
to itself.
d.The function adds two to a string.

21· What is cin? (Please read the choices very carefully.)
a.An object used for reading from the console.
b.An object used for writing to the console.
c.An object used for displaying information on a form.
d.An object used for reading information from a form.

22. Take a look at the following class. What are the names of its member
variables?
class Pen
{
public:
float Length;
string Color;
int InkAmount;
};
a.The member variables are class, Pen, and public.
b.The member variables are class, Pen, public, Length, Color, and
InkAmount.
c.The member variables are public, float, AnsiString, and int.
d.The member variables are Length, Color, and InkAmount.

23.Which of the following is an instance of the Button class?
a.A button you drop on the form from the Toolbox.
b.You typed Button in code.
c.You divided your source code up into function.
d.You add #include in your code.

24. What does MyPen.Length = 6.0; mean? (Please read the choices
carefully.)
a.It means you're retrieving the Length attribute of MyPen and comparing
it to 6.0.
b.It means you're setting all instances of MyPen to 6.0.
c. It means you're storing 6.0 in the Length attribute of MyPen.
d.It means you're storing 6.0 in the MyPen attribute of Length.

25. If you're writing a class and you use the word private, what does that
mean?
a.It means the members that follow the word private can't be accessed
outside the class.
b.It means the class itself can only be accessed by similar classes.
c.It means a comment will follow that's intended only to the users of
the class and not the users of the program.
d.It means you can't create instances of the class.
26. Suppose you have an object named HondaAccord and you want to call the
object's AddGas function. The AddGas function takes a GasStation instance as
a parameter, for which you'll pass AmocoAt34th. How do you write this as
code?
a.AddGas.HondaAccord.(AmocoAt34th);
b.AmocoAt34th.AddGas(HondaAccord);
c.HondaAccord.AmocoAt34th(AddGas);
d.HondaAccord.AddGas(AmocoAt34th);

27.Which of the following must a class declaration have?
a.member functions.
b.private keyword.
c.class keyword.
d.public keyword.

28. What does this line of code do? cout << &x << endl;
a.It prints out the address of the variable called x.
b.It prints out the value of the variable called x.
c.It prints out an ampersand symbol followed by the letter x.
d.It prints out an ampersand symbol followed by the value stored in x.

29. If you have a pointer called ptr, and it points to an object, what
symbols do you type in to access the member variable called height of the
object?
a.height->ptr
b.ptr->height
c.height.ptr
d.ptr.height

30. What does the following line of code mean? class HondaAccord : public
Car {
a.It means the class HondaAccord is a member of the class Car.
b.It means the class HondaAccord is derived from the class Car.
c.It means Car is a public member of HondaAccord.
d.It means the class Car is derived from HondaAccord.

31. What happens if you have a class called Car, and it has a public member
function called Drive, and then from Car, you derive a new class called
FordTaurus?
a.You'll be required to write a new function called Drive for FordTaurus.
b.FordTaurus won't be allowed to have a function called Drive.
c.FordTaurus will inherit the function Drive.
d.FordTaurus will inherit every function except the one called Drive.

32. Suppose Car has a private variable called MilesPerGallon, and from Car
you derive a new class called HondaAccord. Which one of the following
describes the situation?
a.HondaAccord is free to directly access the private member
MilesPerGallon.
b.HondaAccord is free to directly modify the private member
MilesPerGallon.
c.MilesPerGallon is neither a member of HondaAccord nor of Car.
d.HondaAccord can't access the private member MilesPerGallon in the
inherited class called Car.

33. What is a header file?
a.It's a file containing code that you share between different code
files.
b.It's not really a file—it's a function header.
c.It's a file that states the name of your program.
d.It's the file where you're required to put your variable declarations.

34. What does this line mean? #include <iostream>
a.It means you're going to type a program called iostream.
b.It means you want to include the header file called iostream. The
angled brackets mean iostream isn't in your project directory.
c.It means you want to include the header file called iostream. The
angled brackets mean iostream is in your project directory.
d.It signifies the beginning of your program.

35. Microsoft Visual C++, C++Builder, and gcc are examples of what?
a.C++ code.
b.Builders.
c.Free tools.
d.Compilers.

36.Where should you go for more information about C++?
a.You don't. This class told it all.
b.Many places: the Internet, books, C++ experts, more courses.
c.The compiler will give you all the information you need.
d.Microsoft will send somebody to your home.
--

※ 来源:·WWW 未名空间站 海外: mitbbs.com 中国: mitbbs.cn·[FROM: 108.]

 
[分页:1 ]
[快速返回] [ 进入大脑工作室讨论区] [返回顶部]
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996