Question
Code in C++ Modify the following code by adding an input function and output formatting function in accordance with the requirements below. The functions do
Code in C++
Modify the following code by adding an input function and output formatting function in accordance with the requirements below. The functions do not have to be part of the class.
Code that need to be modified!
#include void Loanpayment::setloanamount(double n) {loan=n; } void Loanpayment::setyears(double n) {years=n; } doubleLoanpayment::paymentcalculator() {double term,payment; term=(1.+pow((rate/12.),12*years)); payment=(loan*rate/12.*term)/term-1.; return payment; } doubleLoanpayment::totalpayment(double p) {return p*(12.*years); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started