// P63.cpp - This program is a driver written to demonstrate how the constructor function works. Loan:Loan() { // Body intentionally kept empty so the default values are used. // If you wish to set the default value of the members to specific // values, here is the place to do it. // For example, to make the default value of amount = 0 // you will use amount = 0; #include class Loan / Loan is called structure tag { public: Loan(); Loan(int ID, float amount, float rate, int term); void set(); float payment(); void display(); private: int ID; // assume an unique integer between 1111-9999 float amount; // S amount of the loan float rate; // annual interest rate int term; // number of months, length of the loan }3; // You could actually copy the body of set function here too Loan::Loan(int I, float am, float rt, int trm) { ID = I; amount = am; rate = rt; term = tm; void Loan:set() int main() { Loan loan1(1234, 2300, 5.5, 48); / initialize to values given Loan loan2; // use the default values Loan loan3; Loan loan4 = loan%; // Initialize the loanl object caut << "Enter the ID ÇİR >> ID; this loan n"; cout << "Enter the amount of this loan \n"; cin >> amount; GRUR << "Display loan1 \n"; loan1.display(); cour << "Enter the annual interest rate of this loan (in %) \n"; GQUR << "Display loan2 \n"; loan2.display(); CU>> rate; cout << "Enter the term (number of months, length of the loan) \n"; GQUR << "Display loan4 \n"; loan4.display(); cin >> term; loan3.set(); // set the values CQUR << "Display loan3 \n"; loan3.display(); void Laan::display() { cout << ID << endl: cout << amount << endl: cout << rate<< endl; cout << term << endl; return 0;

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question

Modify the given c++ program

Loan:Loan()
{
// Body intentionally kept empty so the default values are used.
// If you wish to set the default value of the members to specific
// values, here is the place to do it.
// For example, to make the default value of amount = 0
// you will use amount = 0;
// P63.cpp - This program is a driver written to demonstrate how the constructor
function works.
#include<iostream>
class Loan l Loan is called structure tag
{
public:
Loan();
Loan(int ID, float amount, float rate, int term);
void set();
float payment();
void display();
private:
int ID; // assume an unique integer between 1111-9909
float amount; // $ amount of the loan
float rate; // annual interest rate
int term; // number of months, length of the loan
};
at%3D
// You could actually copy the body of set function here too
Loan::Loan(int I, float am, float rt, int trm)
{
ID = I;
amount = am;
rate = rt;
term = trm;
}
void Loan:set()
{
// Initialize the loanl object
cout << "Enter the ID of this loan \n";
cin >> ID;
int main()
Loan loan1(1234, 2300, 5.5, 48); // initialize to values given
Loan loan2; // use the default values
Loan loan3;
Loan loan4 = loanl;
Cout << "Enter the amount of this loan \n";
çin >> amount;
Gout << "Display loan1 \n";
loan1.display();
cout << "Enter the annual interest rate of this loan (in %) \n";
Gout << "Display loan2 \n";
loan2.display();
çin >> rate;
cout << "Enter the term (number of months, length of the loan) \n";
Gout << "Display loan4 \n";
loan4.display();
cin >> term;
}
loan3.set(); // set the values
Gout << "Display loan3 \n";
loan3.display();
void Laan:display()
{
cout << ID << endl:
cout << amount << endl;
cout << rate << endl;
Cout << term << endl:
return 0;
Transcribed Image Text:Loan:Loan() { // Body intentionally kept empty so the default values are used. // If you wish to set the default value of the members to specific // values, here is the place to do it. // For example, to make the default value of amount = 0 // you will use amount = 0; // P63.cpp - This program is a driver written to demonstrate how the constructor function works. #include<iostream> class Loan l Loan is called structure tag { public: Loan(); Loan(int ID, float amount, float rate, int term); void set(); float payment(); void display(); private: int ID; // assume an unique integer between 1111-9909 float amount; // $ amount of the loan float rate; // annual interest rate int term; // number of months, length of the loan }; at%3D // You could actually copy the body of set function here too Loan::Loan(int I, float am, float rt, int trm) { ID = I; amount = am; rate = rt; term = trm; } void Loan:set() { // Initialize the loanl object cout << "Enter the ID of this loan \n"; cin >> ID; int main() Loan loan1(1234, 2300, 5.5, 48); // initialize to values given Loan loan2; // use the default values Loan loan3; Loan loan4 = loanl; Cout << "Enter the amount of this loan \n"; çin >> amount; Gout << "Display loan1 \n"; loan1.display(); cout << "Enter the annual interest rate of this loan (in %) \n"; Gout << "Display loan2 \n"; loan2.display(); çin >> rate; cout << "Enter the term (number of months, length of the loan) \n"; Gout << "Display loan4 \n"; loan4.display(); cin >> term; } loan3.set(); // set the values Gout << "Display loan3 \n"; loan3.display(); void Laan:display() { cout << ID << endl: cout << amount << endl; cout << rate << endl; Cout << term << endl: return 0;
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT