Anyone interested in helping me out again??

This is a discussion on Anyone interested in helping me out again?? within the C++ Programming forums, part of the General Programming Boards category; In my intro to computer science course I have to write the following programs: Problem #1: You have secured a ...

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    29

    Anyone interested in helping me out again??

    In my intro to computer science course I have to write the following programs:

    Problem #1:

    You have secured a mortgage for a house that costs $240,000. The down payment is $40,000.

    1) Monthly payment is $1500
    2) Payments are 12 times a year (365 days a year) at equally spaced intervals.
    3) Rate is 6% for the first 3 years and 7% afterwards.

    Find the following:
    1) How many months will it take to pay off the entire mortgage?
    2) What is the final monthly payment?

    Problem #2

    A crime has been committed at a particular scene. You have limited resources to investigate. Because the crime happened recently, the farthest away the criminal can be is 100 miles away to the east and 100 miles away to the north (the criminal canít go west or south because of walls and other restrictions.) Furthermore, the criminal never goes west or south because he is fleeing where the authorities are. The chance that the criminal is at x miles east is for any x in between 0 and 100 is the same. It is also so that the chance that the criminal is y miles north for any y in between 0 and 100 is the same.If the criminal is x miles east and y miles north, you will need to investigate everywhere that the criminal could have been so that you can look for evidence.

    Estimate the probability that you only have to investigate 5000 square miles. Estimate this by writing a computer program and running many iterations.



    Anyone interested in helping me out?

  2. #2
    NotSoAvgProgrammer
    Join Date
    Jul 2007
    Location
    Virginia, U.S.
    Posts
    57
    I'm sure many of us would be willing to help you out. We aren't going to do it for you though, at least show some effort, or at least have a code box for the looks of you post. You post here to learn, not to cheat. If you want to cheat, go pay some kid $5 bucks.

    Joe
    A quality job is not necessarily a *good* job. A quality job is, by definition, conformance to requirements. Therefore a *good* job, may not be a quality job.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    903
    I won't do it under 80$ per problem.

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    I'll do it all wrong for you so you fail for $1337. If that's too high, I can do a worse job for $13.37.

    BTW, why are you even taking this course if you don't want to learn to do it yourself?

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,554
    I'll do it for a down payment of $40,000
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,801
    These guys might be interested: http://www.rentacoder.com.

    Otherwise, you're going to have to show some effort.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  7. #7
    NotSoAvgProgrammer
    Join Date
    Jul 2007
    Location
    Virginia, U.S.
    Posts
    57
    Shoot, I would take the class for you, for $5. I'm just not old enough to get in a CS class yet. lol

    next year....................... std::cout<<"hello world strikes back."


    Joe
    A quality job is not necessarily a *good* job. A quality job is, by definition, conformance to requirements. Therefore a *good* job, may not be a quality job.

  8. #8
    Registered Abuser
    Join Date
    Sep 2007
    Location
    USA/NJ/TRENTON
    Posts
    127
    WRITE OUT THE PROBLEM AND HOW TO SOLVE IT STEP BY STEP FIRST.

    The difficulty in your homework certainly isn't in the coding, it's in solving these math problems really.

    PSUEDO-CODE is your friend! Use it liberally!

    Once you've worked out the solution on paper, apply the coding techniques you've learned in class, you'll be amazed at how simple this really is, and you'll feel a great sense of accomplishment at what you can do on your own! There is no substitute to doing this beginning stuff ON YOUR OWN! From re-typing a "Hello World!" program over and over to much more complicated things... PRACTICE MAKES BETTER!

    No one here magically knew how to write programs one day, they learned because they were interested in programming. If you can't live with this, then maybe you need to re-evaluate what you want to do with your life. Programming is not something that is learned in a semester or two, then forgotten. Programming is a continual learning process. Few people can claim they know everything no matter what the subject. If this stuff really interests you, apply yourself! If you find yourself struggling with these beginning courses, catch-up with your peers, study day and night, live, eat, sleep, and $h*t programming! I do, and I still have a long ways to go! But I look forward to the challenges that lie ahead.

    That's how you need to tackle this problem, and all problems that you'll be faced with in CS.

  9. #9
    Cryptanalyst
    Join Date
    Sep 2007
    Posts
    52
    Quote Originally Posted by sh3rpa View Post
    No one here magically knew how to write programs one day, they learned because they were interested in programming. If you can't live with this, then maybe you need to re-evaluate what you want to do with your life.
    The dude has a point!

  10. #10
    Registered User
    Join Date
    Sep 2007
    Posts
    29

    Smile

    I'm sorry! I guess I should have posted what I have finished. Here is what I have done so far:

    Code:
    #include <iostream>
    
    using namespace std;
    int main()
    
    {
    double initial_amount;
    double interest_rate6;
    double interest_rate7;
    int monthly_payment;
    int payment_period;
    double down_payment;
    double numpayment_period;
    double loan_balance;
    double monthlyint_paid;
    double initialpay_paid;
    double remaining_balance;
    double length_years;
    char list_more;
    int dividelist = 0;
    char quit;
    
    do
    {
    	cout << "Enter the initial price of the house (eg. xxxxxx.xx): ";
    	cin >> intial_amount;
            cout << "Enter the down payment for the house (eg. xxxxx.xx): ";
            cin >> down_payment;
    	cout << "Enter the annual interest rate for the first 3 years (eg. x.xx): ";
    	cin >> interest_rate6;
    	cout << "Enter the annual interest rate following the first 3 years (eg. x.xx): ";
    	cin >>  interest_rate7;
    	cout << "Enter the amount of annual payment periods (if once a month, press 12): ";
            cin >> payment_period;
    
            numpayment_period = -(LN(1-(initial_amount/down_payment)**(interest_rate6/payment_period)))/LN(1+(interest_rate6/payment_period));
            numpayment_period = numpayment_period/12;
    
            cout << "It will take you" << numpayment_period << "months to pay of your mortgage." <<endl;
    
            length_years = -1/payment_period*(LN(1-(initial_amount/down_payment)*(interest_rate6/payment_period)))/LN(1+(interest_rate6/payment_period))
    
            remaining_balance = remaining_balance*(1-((1+(interest_rate6/(12*100))**(numpayment_period-1))/((1+(interest_rate6/(12*100))**(length_years*12)-1))
    
    }
    
    ++dividelist;
    
    if (dividelist==12)
            cout << "Enter 'Y' to continue," << "'D' for new data," << "'N' to quit>";
            cin >> list_more;
    
    if ((list_more=='Y')||(list_more=='y'))
            dividelist=0;
    
    else if ((list_more=='D'||(list_more=='d'))
    break;
    
    else if ((list_more=='N')||(list_more=='n'))
    
    return list_more;
    
    while ((quit!='n')&&(quit!='N')&&(quit!='y')&&(quit!='Y'));
            cout << "Enter Y to continue, N to quit>";
            cin >> quit;
    
    	return 0;
    }
    I didn't mean for that to come off as I wanted someone to write the program for me, sorry! If anyone has any suggestions about what I'm doing wrong, that would really help me out a lot! Thanks so much!

  11. #11
    Cryptanalyst
    Join Date
    Sep 2007
    Posts
    52
    Code:
     while ((quit!='n')&&(quit!='N')&&(quit!='y')&&(quit!='Y'));
            cout << "Enter Y to continue, N to quit>";
            cin >> quit;
    Uhh. Set a char size for quit[1], and I think you want this
    Code:
    #include <conio> //Add this for a useful thing I'll show you,alongwith rest of the headers
    ......
    ......
    do{
          .....
          .....
        }//brace to END do,and check while
    while (toupper(quit[0]) != n || toupper(quit[0]) == y); //"==" at Y coz you want to break off the loop if the user hits Y. While it is not equal to n,the loop will continue. And toupper allows the letter to be both uppercase and lowercase,saves you time.
    Anything else I've spotted I'll tell you after my studies...crappy English exam tomorrow,aye >.>
    Last edited by SVXX; 10-03-2007 at 10:28 AM.

  12. #12
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Quote Originally Posted by hk_mp5kpdw View Post
    These guys might be interested: http://www.rentacoder.com.

    Otherwise, you're going to have to show some effort.
    They actually tend to report stuff to college professors. .

  13. #13
    Registered Abuser
    Join Date
    Sep 2007
    Location
    USA/NJ/TRENTON
    Posts
    127
    I'll say you ought to simplify this some more...

    also, if you're going to post code, at least put semicolons, matching "("'s and ")"'s, etc, where they're needed before posting. (no one wants to go through and fix typeos, especially if it's someone else's program).

    I'm also confused a bit, in your original post you stated the problems ver batem, but in your sample code, it looks like you want everything to be variables (meaning num. of payments a year, interest rates not 6 or 7 percent, etc.) What is it that your teacher wants you to do? Solve exactly what's written there, or a more general solution like you're proposing?

  14. #14
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,069
    SVXX, if you're going to assist with the problem, don't tell the OP to submit his homework using non-standard libraries. That's a good way to get a big red 'F' in any programming class.
    Sent from my iPadģ

  15. #15
    Cryptanalyst
    Join Date
    Sep 2007
    Posts
    52
    Quote Originally Posted by SlyMaelstrom View Post
    SVXX, if you're going to assist with the problem, don't tell the OP to submit his homework using non-standard libraries. That's a good way to get a big red 'F' in any programming class.
    Edit owns. MUHUHAHAHAHAHA.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Anyone interested?
    By JarJarBinks in forum Projects and Job Recruitment
    Replies: 7
    Last Post: 09-17-2004, 05:59 AM
  2. for beginner's or anyone interested
    By Iconoklast in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 03-25-2004, 01:45 PM
  3. War with Iraq - Read this article if you're interested
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-25-2003, 11:10 PM
  4. Who here would be interested...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 07-19-2002, 08:10 PM
  5. interested in helping????
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 05-05-2002, 09:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21