// 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;
// 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;
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Modify the given c++

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images

Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education