主题:help!!
我也不知道该不该发这里,以下是试题的C++部分,还有其他很多部分,涉及C#、VB、网络、硬件、安全管理,题目比较基础,而且测试是开卷的,要求自己找资料问老师和同学或朋友,但比较急,所以想找人帮忙做我不擅长的部分C++和C#。望帮忙,先谢过。
c\c++部分(35分)
1. 用变量a给出下面的定义 (8分)
a) 一个整型数(An integer)
b) 一个指向整型数的指针(A pointer to an integer)
c) 一个指向指针的的指针,它指向的指针是指向一个整型数(A pointer to a pointer to an integer)
d) 一个有10个整型数的数组(An array of 10 integers)
e) 一个有10个指针的数组,该指针是指向一个整型数的(An array of 10 pointers to integers)
f) 一个指向有10个整型数数组的指针(A pointer to an array of 10 integers)
g) 一个指向函数的指针,该函数有一个整型参数并返回一个整型数(A pointer to a function that takes an integer as an argument and returns an integer)
h) 一个有10个指针的数组,该指针指向一个函数,该函数有一个整型参数并返回一个整型数( An array of ten pointers to functions that take an integer argument and return an integer )
2. What is the output?Why?(2分)-------------------------------------#define square(x) (x)*(x)
int x=2;
cout << square(x++);-------------------------------------答案:
3. 写出以下程序的入口函数. (4分)
1)
Win32 Console :
2)
Win32 App
:
3)
Win32 Non-MFC DLL:
4)
MFC规则 DLL:
4、Define a type 'Boolean', write a function IsNegative (to return true if an input integer is negative), and a function showBoolean (to display a boolean on the screen). Then write a complete program to test everything. (8分)
5. 把缓冲区数据写入指定的文件. (5分)
//
---------------------------------------------------
//
写入文件
//
buffer – 缓冲区指针
//
size – 缓冲区大小
//
szDir – 指定文件目录
//
szFileName –- 指定文件名
//
返回值 0 表示成功
//
---------------------------------------------------
int WriteToFile (void *buffer, size_t size, TCHAR *szDir, TCHAR *szFileName)
{
//
答案
}
6、A real polynomial P(x) of degree n or less is given by
P(x) =
With coefficients
representing real numbers.
You are part of a design team and your task is to define a class to represent P(x) and to evaluate the value of the polynomial P(x) at x.(8分)
a)
Providing that the value of n is always less than 100, what is the most suitable data structure to store coefficients ? Define this data structure and name it a.
b)
Define the class ‘Polynomial’ that contains the following three data items(private data):
·
a Answer to part a.
·
n Polynomial degree.
·
x
The class ‘Polynomial’ also contains three member functions:
·
setn
sets the value of n ( passed as a parameter) and returns nothing.
·
SetCoefficients
sets
by asking the user to enter them. This function has no parameter and returns nothing;
·
Evaluate
evaluates the value of polynomial p at x (passed as a parameter) and returns the result as an integer value.
Note that you just need to write the definition of the class. Do not write body of the functions in this part.
c)
Give the implementation of the function ‘Evaluate’.
Assume that the function ‘setCoefficient’ is always called before calling the function ‘Evaluate’ so you are sure that were set before the function ‘Evaluate’ and you can use them in your function.
c\c++部分(35分)
1. 用变量a给出下面的定义 (8分)
a) 一个整型数(An integer)
b) 一个指向整型数的指针(A pointer to an integer)
c) 一个指向指针的的指针,它指向的指针是指向一个整型数(A pointer to a pointer to an integer)
d) 一个有10个整型数的数组(An array of 10 integers)
e) 一个有10个指针的数组,该指针是指向一个整型数的(An array of 10 pointers to integers)
f) 一个指向有10个整型数数组的指针(A pointer to an array of 10 integers)
g) 一个指向函数的指针,该函数有一个整型参数并返回一个整型数(A pointer to a function that takes an integer as an argument and returns an integer)
h) 一个有10个指针的数组,该指针指向一个函数,该函数有一个整型参数并返回一个整型数( An array of ten pointers to functions that take an integer argument and return an integer )
2. What is the output?Why?(2分)-------------------------------------#define square(x) (x)*(x)
int x=2;
cout << square(x++);-------------------------------------答案:
3. 写出以下程序的入口函数. (4分)
1)
Win32 Console :
2)
Win32 App
:
3)
Win32 Non-MFC DLL:
4)
MFC规则 DLL:
4、Define a type 'Boolean', write a function IsNegative (to return true if an input integer is negative), and a function showBoolean (to display a boolean on the screen). Then write a complete program to test everything. (8分)
5. 把缓冲区数据写入指定的文件. (5分)
//
---------------------------------------------------
//
写入文件
//
buffer – 缓冲区指针
//
size – 缓冲区大小
//
szDir – 指定文件目录
//
szFileName –- 指定文件名
//
返回值 0 表示成功
//
---------------------------------------------------
int WriteToFile (void *buffer, size_t size, TCHAR *szDir, TCHAR *szFileName)
{
//
答案
}
6、A real polynomial P(x) of degree n or less is given by
P(x) =
With coefficients
representing real numbers.
You are part of a design team and your task is to define a class to represent P(x) and to evaluate the value of the polynomial P(x) at x.(8分)
a)
Providing that the value of n is always less than 100, what is the most suitable data structure to store coefficients ? Define this data structure and name it a.
b)
Define the class ‘Polynomial’ that contains the following three data items(private data):
·
a Answer to part a.
·
n Polynomial degree.
·
x
The class ‘Polynomial’ also contains three member functions:
·
setn
sets the value of n ( passed as a parameter) and returns nothing.
·
SetCoefficients
sets
by asking the user to enter them. This function has no parameter and returns nothing;
·
Evaluate
evaluates the value of polynomial p at x (passed as a parameter) and returns the result as an integer value.
Note that you just need to write the definition of the class. Do not write body of the functions in this part.
c)
Give the implementation of the function ‘Evaluate’.
Assume that the function ‘setCoefficient’ is always called before calling the function ‘Evaluate’ so you are sure that were set before the function ‘Evaluate’ and you can use them in your function.