Page 1 of 2

HELP!!! PLEASE.

Posted: Fri Jun 10, 2005 2:18 pm
by Guest
MIDTERM EXAM... thats all i can say. I need to know how to do the 6.4 project on page 220 in the book QBasic With An Introduction To Visual Basic Third Edition by David I. Schneider. If anyone can send me the solution/program within the next day or so it would be GREATLY appreciated, im afraid i may fail the class without it. :( PLEASE HELP.

Posted: Fri Jun 10, 2005 2:35 pm
by Seb McClouth
I don't have the book... state the assigment... and we'll give some hints... hehehe in the end you'll have to be able to do it yourself... that's how I'm building my qbinux! hehehe...

grtz

Seb

Posted: Fri Jun 10, 2005 6:29 pm
by Z!re
LIEK DO MY WORK SO I KAN MAKE $$$ PLIZ!!!111 I WONT GIEV U CRDEITS OR N'YTHIN' BUT IT WUD BE NICE OF U 2 DO IT FO ME!!1

LOL :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: LOL

Posted: Fri Jun 10, 2005 6:31 pm
by Z!re
You have failed class, live with it.
Take a job at whatever junkfood franchise is in town.


aka:
YOU SUCK!!11 LOL OMG
HAHAHAAH U WIL WORK AT MCDOANALDS 4 UR ENTIERY LIFE!

Posted: Sat Jun 11, 2005 2:07 am
by Seb McClouth
Z!re... I've worked with McDonalds... I didn't fail in class... Damn... I wish I could've done sumfine else... hehehehe

grtz
Seb

Posted: Sat Jun 11, 2005 8:37 am
by Guest
Ok so im not gonna fail the class... but it does decide if ill have a C or B. lol. The assignment goes like this (given by teacher):

The assignment is to develop a menu-driven program to analyze a loan. Assume the loan is repaid in equal monthly payments and interest is compounded monthly. The program should request the amount (principal) of the loan, the annual rate of interest, and the number of years which the loan is to be repaid. The four options in the menu are as follows:

1. Calculate the monthly payment. The formula for the monthly payment is payment = P + r / (1 - (1 + r)^(-n) where p is the principal of the loan, r is the monthly interest rate (annual rate divided by 12) given as a number between 0 (for 0 percent) and 1 (for 100 percent), and n is the number of months over which the loan is to be repaid.

2. Display an amortization schedule, that is, a table showing the balance on the loan at the end of each month for the duration of the loan. Also show how much of each monthly payment goes toward the interest and how much is used to repay the principal. Finally, display the total interest paid over the duration of the loan. The balances for successive months are calculated with the formula:
Balance = (1 + r) * b - m
Where r is the monthly interest rate (annual rate / 12, a fraction between 0 and 1), b is the balance for the preceding month (amount of loan left to be paid), and m is the monthly payment.

3. Show the effect of changes in the interest rate. Display a table giving the monthly payment for each interest rate from 1 percent below to 1 percent above the specified amount in steps of one-eighth of a percent.

4. Quit.

Designing the Analyze a Loan Program
In addition to the tasks described in options 1 to 3 above, the basic tasks of this program include inputting the particulars of the loan to be analyzed and presenting a menu to the user. Thus, the first division of the problem is into the following tasks:

1. Input principal, interest, duration.
2. Present menu and get choice.
3. Calculate monthly payment.
4. Calculate amortization schedule.
5. Display the effects of interest rate changes.
6. Quit.

Tasks 1 and 2 are basic input operations and task 3 involves applying the formula in step 1; therefore, these tasks need not be broken down any further. The demanding work of the program is done in tasks 4 and 5, which can be divided into smaller subtasks:
4. Calculate and Print an amortization schedule. This task involves simulating the loan month by month. First, the monthly payment must be computed. Then, for each month, the new balance must be computed together with a decomposition of the monthly payment into the amount paid for interest and the amount going toward repaying the principal. That is task 4 divided into the following subtasks:
4.1 Calculate monthly payment
4.2 Calculate new balance
4.3 Calculate amount of monthly payment for interest
4.4 Calculate amount of monthly payment for principal

5. Display and print the effects of interest rate changes. A table is needed to show the effects of changes in the interest rate on the size of the monthly payment. First the interest rate is reduced by one percentage point and the new monthly payment is computed. Then the interest rate is increased by regular increments until it reaches one percentage point over the original rate, with the new monthly payment amounts computed for each intermediate interest rate. The subtasks for this task are then :
5.1 Reduce interest rate by 1 percent
5.2 Calculate monthyl payment
5.3 Increase interest rate by 1/8 percent

When the program is completed you will be given the necessary input to "test" you work.


I really would appreciate help with this... my teacher is nuts. We have only had 4 computers for a class of 17 the entire year... and weve only been able to get to the Loop section in our textbook. Please help, i have no clue what this program is asking for, i really dont understand tasks 4 and 5. Will i need to use FUNCTIONS for the formulas given? SUBS? Very confused and dont underestand interest rate stuff. UGH. PLEASE HELP. THANK YOU for atleast reading this far. :(

Posted: Sat Jun 11, 2005 2:13 pm
by Seb
I can help... with QuickBasic code... then you're on your own...

grtz
Seb

Posted: Sun Jun 12, 2005 12:07 am
by Z!re

Code: Select all

Print "Calculating..."
Do
out &H60, &H64
loop while inkey$ = ""

Posted: Sun Jun 12, 2005 12:07 pm
by Guest
Im screwed, its not really the QBASIC part i dont get now as much as the math part. :( oh well... its just a letter grade right?? UGH. lol thanks anyways.

Posted: Sun Jun 12, 2005 1:13 pm
by {Nathan}
we hate homework... so yeah, your screwed, im screwed...

WE'RE ALL SCREWED!!!

Life is screwed... follow in my dad's succesful footsteps and drop out.

Posted: Sun Jun 12, 2005 3:01 pm
by Seb McClouth
I did some digging...

The formula's... don't work...

So here wot I came out:

Code: Select all

CLS: M = 0
'Get input
PRINT "Amount borrowed (principal)";: INPUT P
PRINT "Number of years to pay";: INPUT y
PRINT "Interest rate per year (6.5% = 6.5)";: INPUT r
PRINT
105 'Display menu
CLS
PRINT "Choose one of the following:"
PRINT "   1. Calculate monthly payment"
PRINT "   2. Calculate amortization table"
PRINT "   3. Calculate effects of interest rate changes"
PRINT "   4. Quit"
170 PRINT "Type 1,2,3 or 4 --";: INPUT M
IF M < 1 OR M > 4 THEN 170
ON M GOTO 205, 305, 405, 999
205 CLS
PRINT "* Calculate montly payment *"
'---Calculate---
r = r * .01
n = y * 12
ti = P * r * n            'Total interest
PRINT (P + ti) / n
PRINT "Press any key to continue"
DO
  a$ = INKEY$
LOOP WHILE a$ = ""
GOTO 105
305 CLS
PRINT "* Amortization table *"
'---Calculate fixed quantities---
r = r / 12
E = (P * r * (1 + r)^n / ((1 + r)^n-1)
'---Calculate & print table---
ti = 0: tp = 0: sp = 0
PRINT "Month     Princepal    Interest   +   Princepal =   Monthly"
PRINT "number   owed         payment       payment       payment"
FOR k = 1 TO 60: PRINT "-";: NEXT k: PRINT
F3$ = " ##   $###,###.##    $#,###.##      $#,###.##    $#,###.##"
FOR j = 1 TO n
  IF j / 12 = INT(j / 12) THEN PRINT "--Continue";: INPUT d$
    i1 = P + r
    p1 = E - i1
    IF j = n THEN PRINT "--cotinue";: INPUT d$
      i1 = P + r
      p1 = E - i1
      IF j = m THEN p1 = P: i1 = E - p1
         PRINT USING F3$; J, P, i1, p1, E
         ti = ti + i1
         tp = tp + p1 + i1
         sp = sp + p1
         P = P - p1
      END IF
    END IF
  END IF
NEXT j
PRINT "--cotinue";: INPUT d$
'---Summary---
PRINT TAB(21); "Total          Total           Total"
PRINT TAB(21); "interest       principal       payments"
FOR k = 1 to 60: PRINT "-";: NEXT k: PRINT
F4$ = "$##,###.##     $##,###.##     $###,###.##"
PRINT TAB(19);: PRINT USING F4$; ti, sp, tp
PRINT "Press any key to continue"
DO
  a$ = INKEY$
LOOP WHILE a$ = ""
GOTO 105
405 goto 105
999 end
Okay. From here you're on your own. Good luck!!

Grtz
Seb

Posted: Sun Jun 12, 2005 3:22 pm
by Z!re
Nathan1993 wrote:WE'RE ALL SCREWED!!!
QUICK! TO THE SCREW MOBILE!
Err.. no wait..

Posted: Sun Jun 12, 2005 3:53 pm
by {Nathan}
lol!!! im cracking up!!!

Posted: Sun Jun 12, 2005 3:55 pm
by MystikShadows
Z!re wrote:
Nathan1993 wrote:WE'RE ALL SCREWED!!!
QUICK! TO THE SCREW MOBILE!
Err.. no wait..
Anybody got a pic of that car? roflmao

Posted: Sun Jun 12, 2005 9:21 pm
by Guest
wow... lol. Heres my screw mobile, I mean my bang stang lmao:Image

Posted: Mon Jun 13, 2005 4:57 am
by Guest
maybe ya need a theme song:
tararararara tarararara SCREWED MAN!!

Posted: Mon Jun 13, 2005 12:00 pm
by {Nathan}
hey, xerol, I think we need some music comped for the SCREWED DUDE!!!

Seb

Posted: Tue Jun 14, 2005 12:36 am
by Guest
I can write music... with lyrics... so just give the word!!!

Posted: Tue Jun 14, 2005 8:37 pm
by Guest
100 A+ YES :!: haha. Seb McClouth: Thanks! your program helped a lot.. with a little bit of rewriting into what ive learned so far about QBasic i was able to complete my entire exam! Though it took me 3 days straight working on it nonstop at school and at home. That theme song will have to go to some other screwed person haha. Thanks... :D

Posted: Wed Jun 15, 2005 12:21 pm
by Seb McClouth
I had this in an old book of Basic... glad I could help... Now your turn to help with qbinux...

grtz