Home Page > > Details

7CCMFM13 AssignmentHelp With ,C++ Programming AssignmentDebug ,Mathematics Course Assignment ,c++ Assignment Debug C/C++ Programming|Help With R Programming

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<

Contact Us - Email:99515681@qq.com    WeChat:codinghelp
Programming Assignment Help!