Loop Exercise 1 Suppose that you want to take out a loan for $10,000, with 18% APR, and you're willing to make payments of $1,200/month. How long will.

Slides:



Advertisements
Similar presentations
Let’s say we take out a $5,000 loan on our credit card, which charges a 19.99% Annual Percentage Rate for its interest. They also charge us a minimum monthly.
Advertisements

Solving Problems with Repetition. Objectives At the end of this topic, students should be able to: Correctly use a while statement in a C# program Correctly.
SECTION 13-3 Truth in Lending Slide TRUTH IN LENDING Annual Percentage Rate (APR) Unearned Interest Slide
© 2005 The McGraw-Hill Companies, Inc., All Rights Reserved McGraw-Hill/Irwin Slide 1 Fin 5413 Introduction Loan Amortization Use of Financial Calculator.
OBJECTIVES 3.2 Factorizations Slide 1Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc. aFind the factors of a number. bGiven a number from 1 to.
Microsoft Excel Setting up Constants; the Payment, Present Value, and Conditional functions; What-If analysis.
A number is divisible by another number if the quotient is a whole number with no remainder.
Debt 1. Interest rate: Annual Percentage Rate APR 2.
STAGE 3 Stage 2: relative information Table number in source Presentation all tied together My from stage 2!! Stapled to the top. Outside info /
Fixed Rate and Fixed Duration Loans You need to know three things about a fixed rate, fixed duration loan: How much do you need to borrow? What is the.
Financial Mathematics II Week 9. Work on stage 3 of final project this week. –Paper copy is due next week (include all stages, including before and after.
Thinking Mathematically
11.3 Function Prototypes A Function Prototype contains the function’s return type, name and parameter list Writing the function prototype is “declaring”
Microsoft Excel How to do a quick loan using PMT.
Chapter 14: Installment Purchases
LSP 120: Quantitative Reasoning and Technological Literacy Section 118
1 LoansLoans When we calculate the annual payment of a loan (A), the payment is actually composed of interest and payment on principal. The mechanics are.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 6 – Car Payment Calculator Application: Introducing.
Credit Cards. Amortization Tables Fill-in headings across in the first row. (Type "Month in cell A1, Beginning Balance in cell B1, etc…) Month Beginning.
Section 4C Loan Payments, and Credit Cards Pages C.
MONTHLY PAYMENTS The situation – Buying a Car  You want to buy a car that costs $10,000 and are planning on putting $1,000 down. Pretend it’s a.
Section 1.1, Slide 1 Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 8.5, Slide 1 Consumer Mathematics The Mathematics of Everyday Life 8.
Loans and Credit Cards LSP 120 Week 9 Joanna Deszcz.
LSP 120: Quantitative Reasoning and Technological Literacy Topic 9: Financial Mathematics Loans and Credit Cards Prepared by Ozlem Elgun1.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Looping Exercises Deciding Which Loop to Use At this.
Section 4D Loan Payments, and Credit Cards Pages
Find the monthly payment R necessary to pay off a loan of $90,000 at 5% compounded monthly for 30 years. (Round final answer up to the nearest cent.) MATH.
1 Copyright (C) 2008 by Dennis A. Fairclough all rights reserved.
April 9, 2010Math 132: Foundations of Mathematics 8.2 & 8.3 Homework Solutions 459: 35.a. I = (4000)(0.0825)(0.75) = $ b. $4, : 1.A = $10,000(1.
Amortized Loans An amortized loan is a loan paid off in equal payments – consequently, the loan payments are an annuity. In an amortized loan:
Charge It Right. 2 You Will Know  The characteristics of a credit card  The costs of using a credit card  The potential problems with credit card use.
More While Loop Examples CS303E: Elements of Computers and Programming.
Chapter 5: Control Structures: Iteration Visual Basic.NET Programming: From Problem Analysis to Program Design.
Borrowing to Buy a Home 6.1. Down Payments and Closing Costs Terms to know: – Down Payment – Mortgage Loan – Principal – Closing Costs – Points.
Writing JavaScript Functions. Goals By the end of this unit, you should understand … How to breakdown applications into individual, re-usable modules.
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
INSTALLMENT BUYING WALTER S. SORILLO MAED – MATHEMATICS REPORTER.
Calculating mortgage payments (Paying back your student loans)
Today in Precalculus Go over homework Need a calculator Notes: Loans & Mortgages (Present Value) Homework.
PHP : Validating forms and loops. Some things for helping you to validate input  The isset function can be used to test if a php variable is passed.
Copyright © 2011 Pearson Education, Inc. Managing Your Money.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 16 I’m on the Inside; You’re on the Outside.
Count Controlled Loops (Nested) Ain’t no sunshine when she’s gone …
Factor A factor of an integer is any integer that divides the given integer with no remainder.
Prime Numbers Damian Gordon. Prime Numbers So let’s say we want to express the following algorithm: – Read in a number and check if it’s a prime number.
5-1 Computing APRs What is the APR if the monthly rate is.5%? What is the APR if the semiannual rate is.5%? What is the monthly rate if the APR is 12%
Lecture 7: Menus and getting input. switch Multiple-selection Statement switch Useful when a variable or expression is tested for all the values it can.
Copyright © 2002, Department of Systems and Computer Engineering, Carleton University 1 *** Modification *** This assignment turned out to a bit.
Aim: Money Matters: Amortization Course: Math Literacy Aim: How does money matter? Annuities in reverse: Amortization! Do Now:
Ms. Young Slide 4-1 Unit 4C Loan Payments, Credit Cards, and Mortgages.
L AB 4 July 5th. F OR LOOP Exercise 1: Find two ways of “Summing all 1, 2, and 3 digit prime numbers.” Use for loop Hint: isprime, primes.
Prime and Composite Numbers A prime number is a natural number greater than 1 whose only factors are 1 and itself. The first few prime numbers are 2,
Solving Problems with Repetition Version 1.0. Objectives At the end of this topic, students should be able to: Correctly use a while statement in a C#
Design Document Sample Given two concentrated circles with different radii, calculate the area which falls inside the big circle but outside the small.
General Condition Loop A general condition loop just loops while some condition remains true. Note that the body of the loop should (eventually) change.
Mortgages. A mortgage is a loan that is secured by property. Mortgages are large loans, and the money is generally borrowed over a large amount of time.
Section 13.2 Loans. Example 8 Find the future value of each account at the end of 100 years if the initial balance is $1000 and the account earns: a)
Credit Cards and Pay Day Loans. Aims and objectives Aim: Promote understanding of the hidden charges associated with credit cards and pay day loans. Objectives:
LSP 120: Quantitative Reasoning and Technological Literacy
LSP 120: Quantitative Reasoning and Technological Literacy
B24: I can use a table to find the annual percentage rate of a loan.
Exercise 24 ÷ 2 12.
Review Basic Math Divisibility tests Prime and Composite Numbers
Intro to Nested Looping
Intro to Nested Looping
Intro to Nested Looping
Suppose I want to add all the even integers from 1 to 100 (inclusive)
Chapter 6 Lesson 4 PMT Function.
Intro to Nested Looping
Presentation transcript:

Loop Exercise 1 Suppose that you want to take out a loan for $10,000, with 18% APR, and you're willing to make payments of $1,200/month. How long will it take you to pay off the loan and how much interest will you pay? An amortization table will show you how much you owe each month, the number of months to pay off the loan, and the total interest.

Amortization Table Mth Payment Amount Total Interest =

Amortization Calculation The interest owed at the end of a month is: interest = amount * APR/1200 The amount owed at the end of a month is: amount += interest The payment is the either the fixed payment amount ($1,200 in this case) or the total amount, if the total amount is less than the fixed payment. The new amount is the amount - payment.

Program Write a program that will read in the amount of the loan, the Annual Percentage Rate (APR), and the amount of the fixed payment, and then will calculate and print out the amortization table and then the total amount of interest paid on the loan. The program should prompt the user for the inputs and print out the table formatted properly with labeled columns.

Sample Output Enter amount of loan> Enter APR> 18 Enter monthly payment> 1200 Mth Payment Amount Total Interest =

Loop Exercise 2 A prime number is an integer greater 1 than is divisible only by 1 and itself. For example, 2 is a prime, 3 is a prime, but 4 is not a prime (4 is divisible by 2). Write a program to print out all the prime numbers between 1 and 100, printing ten numbers per line.

Sample Output Primes between 1 and

Prime Calculation To check if one number divides another, just check if the remainder after division is 0. For example if (i % j == 0) then j is a factor of i (and if j is neither i n or 1, i is not prime). Hint: It would be helpful to use a bool variable, isPrime, to record whether or not the number is prime.

Program Design Consider how to develop this program top-down, that is, starting with the problem statement: Clearly, we will need to loop over all numbers from 1 to 100. What kind of loop is this? Then, for each number, we need to decide whether or not it is prime, and print it out if it is. This requires a second, nested, loop.