首页 > > 详细

7CCMFM13讲解、C++程序设计调试、Mathematics辅导、c++语言辅导调试C/C++编程|讲解R语言编程

7CCMFM13
This paper is part of an examination of the College counting towards the award of a degree.
Examinations are governed by the College Regulations under the authority of the Academic
Board.
FOLLOW the instructions you have been given on how to upload your solutions
MSc Examination
7CCMFM13 C++ for Financial Mathematics (MSc)
Summer Mock Exam 2020
Time Allowed: Two Hours
All questions carry equal marks.
Full marks will be awarded for complete answers to FOUR questions.
If more than four questions are attempted, then only the best FOUR will
count.
You may consult lecture notes.
Mock Exam 2020
c King’s College London
7CCMFM13
1. (i) Write a function max(double, double) which takes two doubles and
returns the maximum of them. [20%]
(ii) Write a function mean which takes as input a vector of doubles (using
) and which returns the mean of the elements of the vector.
[20%]
(iii) What’s wrong with the following code?
int& Setx(){
int x=3;
return x;
}
[20%]
(iv) What does the following code print out and why?
# include
using namespace std;
void MyFunction(double& a){
a*=10;
}
int main()
{
double a=1;
MyFunction(a);
cout<

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!