首页 > > 详细

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 微信:codinghelp2
© 2014 www.7daixie.com
程序代写网!