Jump to content

anyone fancy helping me out with a bit c++


Recommended Posts

Guest squall
Posted

I have my c++ resit tomorrow afternoon, its an open book exam that im not totally prepaired for.

I can do the first 2 sections of the exam. Its just the last section - section c im not able to do. You have to write a program.

My leacturer suggested i should have a program that would meet the requirements of the previous years exams, just incase it came up again, with a bit of a nudge and a wink i think.

So if anyone has any free time tonight or before tomorrow afternoon, I would really appresaite if you could have a look at the past exam paper attached, and see if you can come up with anything.

Theres beer in it for you at the next meet :)

csc601c2.pdf

csc601c1.pdf

Guest ferret
Posted

Sorry to be a boring old git, but isn't this cheating?

Guest squall
Posted

no, seeing as its passed exam papers. Id be doing them anyway in preperation for the exam, like i did for the other modules i take.

Most people use past papers as a guide to what to expect in an exam, theres nothing dodgy about it.

Chances are there will be a similar but different question in the exam.

Guest ajb3000
Posted

So you're planning on "buying" someone a "free" beer at the next meet? hhmmm.... nice plan.

Sorry but I don't know any C++.

Guest squall
Posted

yeah i owe everyone beer anyway, exp owen, aka beersoft

Guest squall
Posted

Just realised the maths one was at the top of the list, thats the hardest of the 3, so i have deleted it! hope you guys can help me out

Guest maxh2003
Posted

Prob. too late for you to read but here's my hurried answer to C. you'd get *some* marks for this, at least.

{input is double a, double e}

double x_previous = 0;

double x = a;

while(x_previous+x>e)

{

x_previous = x;

x = (x_previous + a/x_previous) / 2;

}

sprintf("Answer is %d",x);

The appropriate datatype is the highest-precision floating point datatype, namely DOUBLE, because this will give the algorithm's result maximum precision. Since we are dealing with square roots it is highly likely that the answer to a given arbitrary integer will be a non-integer.

Who's going to correct the above, then? :-D :-D :-D

Guest squall
Posted

superstar! Im just about to go to the exam... i will take it with me! Thanks!

Guest maxh2003
Posted

...oh f***, I hope some of the above was right then... :shock: :oops: :)

Guest squall
Posted

well the questions came up in the exam sure enough so you helped me out alot. you best get your ass to the next meet i owe you beer :P

cheers mate :)

Posted from my SmartPhone!

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.