COMP 2710 Software Construction Homework 2 – Design and Algorithm

Slides:



Advertisements
Similar presentations
Advanced Algebra II Notes 1.5 Loans and Investments Investigation: (Use Sequential Mode, Stat Plot to simplify. See below)
Advertisements

1 Dr. Xiao Qin Auburn University Spring, 2011 COMP 7370 Advanced Computer and Network Security The VectorCover.
Section 4C Loan Payments, and Credit Cards Pages C.
LIFE SCENARIO Personal Finance. 1)You make custom bicycles; if you price them at $500 you will sell 300 bikes. If you sell them at $200 you will sell.
Section 4D Loan Payments, and Credit Cards Pages
Loans and Investments Lesson 1.5.
1 Copyright (C) 2008 by Dennis A. Fairclough all rights reserved.
Interest on Loans Section 6.8. Objectives Calculate simple interest Calculate compound interest Solve applications related to credit card payments.
Section 6.2 Notes. Can you afford a loan?  First way to tell  Second way to tell.
Mortgage Loans. What is a Mortgage Loan? A loan secured by real property.
What is a Mortgage? - Part 2 Review 1. What is the term of a mortgage? The length of time that the interest rate is fixed. 2. What is the difference between.
The explanation for a Spreadsheet week 17 How do you set up a spreadsheet!
Ms. Young Slide 4-1 Unit 4C Loan Payments, Credit Cards, and Mortgages.
Understanding Car Payments. Mark wants a go-cart. Mark wants a go-cart. A go-cart costs $500. A go-cart costs $500. Mark only has $100. This is his Down.
CHAPTER 1 LESSON 3 Linear Functions. WHAT IS A LINEAR FUNCTION?  A linear function is a function that can be written in the form f(x)= ax+b where a and.
UNDERSTANDING MONEY MANAGEMENT CHAPTER If payments occur more frequently than annual, how do you calculate economic equivalence? 2.If interest period.
FIN 420 Week 4 DQ 2 Visit a site such as to determine current rates for both a 60- month and a 36-month loan on a new car where the buyer.
Introduction to Credit
LenderSelect Mortgage Group The Benefits of Buying
Great Rates. Personal Service.
College lesson four credit presentation slides 04/09.
Financial Applications -Compound Interest
effects of changing conditions
LSP 120: Quantitative Reasoning and Technological Literacy
Cell phone use is prohibited.
Learning Objectives Today we will Learn:
USING CREDIT SSEPF4: The student will evaluate the costs and benefits of using credit.
Simple Interest By: Ms. Naira.
Personal Finance Today’s Agenda:
Main Idea and New Vocabulary Key Concept: Slope Example 1: Find Slope
MATH 110 Sec 8-5 Lecture: Annuities – Amortization
Earning Credit.
LSP 120: Quantitative Reasoning and Technological Literacy
COMP 2710 Software Construction Inheritance
7.6.7 Simple Interest.
Credit cards Debts.
Unit 4.3 LOAN CALCULATIONS AND REGRESSION
LESSON TWO: PERSONAL SPENDING
Percent and Problem Solving : Interest
Credit Scores Interest on Debt and Interest on Savings
Budget Simulation : Finance Refresher
What I Focus On is What I Get!
More on Installment Loans
Exponential Functions – Personal Finance
effects of changing conditions
Introduction to Credit Cards
Teens lesson seven credit presentation slides 04/09.
Calculating Loan Repayments
Chapter 6 Lesson 4 PMT Function.
Powerpoint Jeopardy Salary vs. Hourly ATM
Teens lesson seven credit presentation slides 04/09.
Home loan for $185,000 for 30 years at 8.5%
ECS15 while.
NEFE’s High School Financial Planning Program Lesson 2-2: Credit Costs
Interest, Payments, and Credit
3-6 Credit Card Statements
Business and Consumer Loans
Teens lesson seven credit presentation slides 04/09.
The Line Of Credit Method
Teens lesson seven credit presentation slides 04/09.
Loans.
College lesson four credit presentation slides 04/09.
Statements & Finance Charge
Section 12.4 Personal Property Loans.
Teens lesson seven credit presentation slides 04/09.
What is credit? What does it mean to be “creditworthy”??
WARMUP George is getting a loan to buy a car. He will borrow $17,000 for 4 years at 7.2%. What are his monthly payments? How much in finance charges.
College lesson four credit presentation slides 04/09.
Teens lesson seven credit presentation slides 04/09.
Basic Accounting Concepts (Text 273 – 280)
Presentation transcript:

COMP 2710 Software Construction Homework 2 – Design and Algorithm Note: 45 Minutes (5 Minutes question and practice time not included) History: Fall’11 Spring’14 Lec03b: homework 1 assigned in week 1 (Ideal) Spring’15 Lec04c: homework 1 assigned in week 2 (Late) Dr. Xiao Qin Auburn University http://www.eng.auburn.edu/~xqin xqin@auburn.edu

Student Performance Homework 1 vs. Homework 2 3-2 2

Time Management for Your Homework 2c Reading: 15 Minutes Analysis: 15 Minutes Algorithm: 30 Minutes Coding: 1-2 Hours

User Input See /comp3000/demo/display.cpp 2-4 4

Output * * * * * * * See /comp3000/demo/display.cpp 2-5 5

Description You have just purchased a stereo system that cost $1000 on the following credit plan: no down payment, an interest rate of 18% per year (and hence 1.5% per month), and monthly payments of $50. The monthly payment of $50 is used to pay the interest, and whatever is left is used to pay part of the remaining debt. Your Task: Write a program that will tell you how many months it will take you to pay off this loan in particular and any loan in general. Your program also needs to calculate the total amount of interest paid over the life of any loan. 2-6 6

What candidate variables and constants should you consider? Your First Question What candidate variables and constants should you consider? You have just purchased a stereo system that cost $1000 on the following credit plan: no down payment, an interest rate of 18% per year (and hence 1.5% per month), and monthly payments of $50. The monthly payment of $50 is used to pay the interest, and whatever is left is used to pay part of the remaining debt. Give you two minutes to work on candidate variables and constants. Loan Amount Interest Rate, Monthly Interest Rate Monthly Payment Balance 2-7 7

Your Second Question How to use the following variables and constants to calculate principal and interests? (Consider regular cases) Loan Amount Interest Rate, Monthly Interest Rate Monthly Payment Balance $50 monthly payment. The first month you pay 1.5% of $1000 in interest. That is $15 in interest. The remaining $35 is deducted from your debt, which leaves you with a debt of $965.00. The next month you pay interest of 1.5% of $965.00, which is $14.48. Hence, you can deduct $35.52 (which is $50–$14.48) from the amount you owe.

Your Second Question How to repeatedly calculate principal and interests for regular cases (i.e., non-last payment)? Monthly Payment 1. Monthly Interests 2. Principal = Monthly payment – Monthly Interests 3. Balance = Balance - Principal 4. Monthly Interests = Balance * Monthly Rate

How to determine the last month and last payment? Your Third Question How to determine the last month and last payment? while (balance > 0) { if (balance > monthly_payment) { /* regular case */ monthly_interest = _______; total_interest = _______; principal = _______; balance = ________; } else /* special case: last payment */ last_payment = monthly_interest + balance; balance = 0; Problem here! (balance * monthly_rate + balance > monthly_payment)