Concept explainers
Future Value
Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula, which is known as the future value formula, is:
The variables in the formula are as follows:
- F is the future value of the account after the specified time period.
- P is the present value of the account.
- i is the monthly interest rate.
- t is the number of months.
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Problem Solving with C++ (10th Edition)
Starting Out with Java: Early Objects (6th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Digital Fundamentals (11th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)arrow_forward(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.arrow_forward(Civil eng.) Write an assignment statement to calculate the linear expansion in a steel beam as a function of temperature increase. The formula for linear expansion, l, is as follows: l=l0(1+(TfT0)) l0isthelengthofthebeamattemperatureT0.isthecoefficientoflinearexpansion.Tfisthefinaltemperatureofthebeam.arrow_forward
- METHODOLOGY A bookstore owner wants you to write a program that calculates the gross pay of an employee. The input to the program is the number of hours the employee works in one week and the employee’s hourly pay rate. The program is to calculate the employee’s gross pay including the possibility of overtime pay. Regular pay is the number of hours the employee worked (up to 40 hours) times the hourly rate. The program is to compute an overtime pay if the employee worked more than 40 hours. All hours beyond 40 should be multiplied to 1.5 for the OT differential pay The program should output the worker’s regular pay, overtime time, and the gross pay (sum of the regular pay and overtime pay). Create an IPO and flowchartarrow_forwardInterest on a credit card’s unpaid balance is calculated using the average daily balance. Suppose that netBalanceis the balance shown in the bill, paymentis the payment made, d1is the number of days in the billing cycle, and d2is the number of days payment is made before the billing cycle. Then the average daily balance is: averageDailyBalance = (netBalance * d1 –payment * d2) / d1 if the interest rate per month is say, 0.0152, then the interest on the unpaid balanceis: interest = averageDailyBalance * 0.0152 Design a program that accepts as input netBalance, payment, d1, d2, and interest rate per month. The program outputs the interest charged. Format your output to two decimal places. C++arrow_forwardDomino's Time Function Name: dominosTime() Parameters: N/A Returns: None Description: During the summer, you ordered a lot of food from Domino's. Pizzas are $12, an order of pasta is $6, and chicken wings are $8. Write a function that asks the user how many of each food item they would like, and then print a response telling them what their order to- tal will be. The order total should be an integer. >>> dominosTime() How many pizzas do you want? 3 How many orders of pasta do you want? 2 How many orders of chicken wings do you want? 2 By ordering 3 pizzas, 2 orders of pasta, and 2 orders of chicken wings, your order total comes to $64.arrow_forward
- PROGRAM DESCRIPTION John dela Cruz is interested in knowing how much his interest earning would be after some time. Assuming there are no deposits other than the original investment, the balance in a savings account after one year may be calculated as: amount = principal * (1 + rate/m)" interest = amount - principal Principal is the balance in the savings account, rate is the interest rate (0 to 100), m is the number of times the interest is compounded during a year (m is either 1,2,3 or 4 if the interest is compounded quarterly) and nis the number of year., Write a program that asks for the borrower's lastname, borrower's first name, borrower's middle name, civil status (Single, Married, Widow), principal, the interest rate and the number of times the interest is compounded. Follow the format of the report provided in the example. OUTPUT Example 1 Enter the borrower's lastname : Enter the borrower's firstname : Enter the borrower's middle name: Enter civil status : Married Enter the…arrow_forwardBackground: Game Rules The rules to the (dice) game of Pig: You will need 2 dice. To Play: a. The players each take turns rolling two die. b. A player scores the sum of the two dice thrown (unless the roll contains a 1): If a single number 1 is thrown on either die, the score for that whole turn is lost (referred to as “Pigged Out”). A 1 on both dice is scored as 25. c. During a single turn, a player may roll the dice as many times as they desire. The score for a single turn is the sum of the individual scores for each dice roll. d. The first player to reach the goal score wins unless a player scores higher subsequently in the same round. Therefore, everyone in the game must have the same number of turns. Execution and User Input This program is quite interactive with the user(s) and will take in the following information; please review the sample input / output sessions for details; we describe them again here emphasizing input. The program will prompt for the number of…arrow_forwardFunction Name: leapYear Parameters: year – an nonnegative integer representing the year Test Cases: >>>leapYear(1996) The year 1996 is a leap year. Enjoy your extra day! >>>leapYear(1901) The year 1901 is not a leap year. Description: Write a function which calculates whether or not a given year is a leap year and has 366 days instead of 365. A general algorithm is as follows: 1. A year will be a leap year if it is divisible by 4 but not by 100. 2. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400. Years such as 1996, 1992, 1988 and so on are leap years because they are divisible by 4 but not by 100. For century years, the 400 rule is important. Century years (ex: 1900, 1800, 1700) are exactly divisible by 4 AND exactly divisible by 100. They are not divisible by 400 and are thus not leap years. You fuction should print out "The year XXXX is a leap year. Enjoy your extra day!" if the year XXXX is a leap year. Print "The…arrow_forward
- Problem 2: Employee Payment The Stark Industry needs a program to calculate how much to pay their hourly employees. They have the following rules: An employee gets paid (hours worked) × (base pay), for each hour up to 40 hours. For every hour over 40, they get overtime = (base pay) × 1.5. If the number of hours is greater than 60, print an error message. Example: If an employee works for 45 hours, and his base pay is $8 , the he will get= (40 * 8)+ [5* (8 * 1.5)] = $380 Create a new class called StarkIndustry. Write a method that takes the base pay and hours worked as parameters, and prints the total pay or an error. Write a main method that calls this method for each of these employees: Employee No Base pay Hours Worked Employee 1 $7.20 35 Employee 2 $8.20 47 Employee 2 $10.50 73 You will have to submit StarkIndustry.java file.arrow_forward10 - In an examination, 500 students appeared. Out of these students, 38 % got A+ grade, 45 % got B+ and the remaining just passed. Assuming that no student failed, find the number of students who got A+, B+ and the number of students who just passed.(Python code)arrow_forwardIntroduction Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: Each team has a name, which is one of the uppercase letters A-Z. No two teams have the same name, so there are a maximum number of 26 teams. Each team has the same number of members. No two runners cross the finish line at the same time – i.e. there are no ties. At the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Team A’s runners finished in 3rd, 5th and 6th place. Team Z’s runners finished in 1st, 2nd and 4th place. Scoring the race Each runner is assigned a score equal to their finishing place. In the example above team Z’s runners achieved scores of 1, 2 and 4. Team A’s runners scores were 3, 5, and 6 respectively. The team’s score is the sum of the members score divided by the number of people on…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr