Anyone a C++ pro? worth $5 paypal.

skithesprings

Active member
help me out before 10:30 and I'll paypal you 5 bucks or 10 times the percentage I get on the assignment.

I have provided a template that contains a programmer-built function for factorial. I need to modify this program by adding another function that will perform the following calculation for combinations:

(nk) = (n!)/(k!(n-k)!)

where n and k are integer values.

the new function should be called from main and will call the factorial function. this new function should return the calculation above to main, and main should output the result. Do NOT use the same identifier (variable name) in more than one function. Make sure you have some test data before you try to write the program.

Hint: Complete this in two steps. In the first step write the new function to do the division

(n)/(k(n-k))

and test it. Once the program is performing this calculation correctly, then modify the numerator and denominator of the fraction to call the factorial function.

here is what I have. the lines beginning with // are what I'm missing.

/*

The function is to calculate and the facorial of an integer number. The main function will

ask the user to input a number, then call the function, and output the factorial.

input: an integer number

output: The factorial of the integer number entered

processing: A function will be called that employs a loop to calculate the running product

for factorial of a number.

*/

#include

using namespace std;

int factorial (int); //function prototype or declaration

int main()

{

int somenumber, result;

cout
 
I don't really understand the function its asking for but it would go something like this.

int somefunction(int k, int n){

return (factorial(n))/(factorial(k)*factorial((n-k)));

}
 
doesnt seem that hard, you have most of the code right there you just need to tweek the calculations inside the function.

just wait till you get out of that hello world BS and get into abstract data types and all the container structures like tree's and stacks and queues and whatnot

/drunk rant i'm going to bed, sorry i couldnt help
 
just wait till you get to functional languages, buffer overflows, and design patterns (assuming your a cs major)
 
yepp!! i'm about to be done my 3rd year, i still have a lot of technical shit to learn. but they pretty much taught us with C++ to get the basics about programing and object oriented programming. We learned data structures and pretty much everything else in C++, but from other classes i know Java, C#, and of course html/php/javascript

its a great major, other than spending hours in the computer lab when your friends who are "business" majors just dick around and complain about algebra in their easy ass math class

 
haha sooo true. I just finished up in December. Definitely glad I went through with it. Its nice to have a skill that you can apply straight out of school. Your guaranteed a good job.

I've been working for a .NET web development company out of Jackson, WY and pretty much living the dream.

Best advice I can give is to come up with a project to work on outside of school. I spent two summers working on 'findurb' (android app for urban spots) and even though it never took off I learned how to work on real world applications.

good luck with the rest of your school
 
yo dude i took a pictuer to put on findurb, and it crashed. can i send the pic to you and give you the coordinates so you can add it under my name?
 
this so, so much.

and the fact that the classes would be way more fun if i wasn't competing against geniuses.

and the fact that my computer architecture class was the same number of units as my ethnic studies class when i spent 4 times more time on CS and ended up with a worse grade.

/rant
 
If you report the bug I may be able to correct it. The whole thing really just need to be rebuilt from the ground up. I think I'll eventually get around to doing so (as well a iphone port), but until then the project is on hold.

Thanks for the support tho.
 
im a microwave/RF engineering grad student but have dont c++ development for lockheed martin part time. i would say first write the factorial function which is easy then theres a math library that you can include for the division. should be pretty simple.
 
Back
Top