Answer to Question #230847 in C++ for Jaguar

Question #230847
Use the following driver program to test your classes InsurancePolicy and CarInsurance:
#include <iostream> #include <fstream> #include "Insurance.h" #include "CarInsurance.h" using namespace std;
int main() {InsurancePolicy myPolicy(123456, "Peter Molema", 3450.67);
CarInsurance yourPolicy(456891, "Wilson Ntemba", 5550.67,
15000.00);
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
myPolicy.showPolicy(cout);
cout << endl;
yourPolicy.showPolicy(cout);
cout << endl << "AFTER UPDATES:" << endl;
myPolicy.setPolicy(123456, "Peter Molema", 5450.67);
yourPolicy.setPolicy(456891, "Wilson Ntemba", 6650.67,
25000.00);
myPolicy.showPolicy(cout);
cout << endl;
yourPolicy.showPolicy(cout);
cout << endl;
return 0;
}
1
Expert's answer
2021-08-30T01:34:57-0400
#include <iostream> 
#include <fstream> 
#include "Insurance.h" 
#include "CarInsurance.h" 
using namespace std;


int main() {
    InsurancePolicy myPolicy(123456, "Peter Molema", 3450.67);


    CarInsurance yourPolicy(456891, "Wilson Ntemba", 5550.67,15000.00);
    
    cout.setf(ios::fixed);
    
    cout.setf(ios::showpoint);
    
    cout.precision(2);
    
    myPolicy.showPolicy(cout);
    
    cout << endl;
    
    yourPolicy.showPolicy(cout);
    
    cout << endl << "AFTER UPDATES:" << endl;
    
    myPolicy.setPolicy(123456, "Peter Molema", 5450.67);
    
    yourPolicy.setPolicy(456891, "Wilson Ntemba", 6650.67,25000.00);
    
    myPolicy.showPolicy(cout);
    
    cout << endl;
    
    yourPolicy.showPolicy(cout);
    
    cout << endl;
    
    return 0;


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS