//Maxwell Brewer CS1A Chapter 3, P. 143, #8
//
/***************************************************************
*
* CALCULATE INSURANCE COST
* _____________________________________________________________
*
* This program will calculate the cost of homeowners insurance
* based off the user input of the price of their home.
* _____________________________________________
* INPUT
*
* Cost to build
*
* OUTPUT
*
* Minimum cost of insurance
*
***************************************************************/
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main() {
// Initialization
const char msgBuildCost[50] = "\n Enter replacement cost of the building: ";
const char msgInsureCost[40] = "\n The minimum amount of insurance is ";
double buildCost, minPrice;
// Display input prompts
cout << msgBuildCost;
cin >> buildCost;
minPrice = (buildCost*0.8); //calculate minimum insurance cost
// Output
cout << msgInsureCost;
cout << minPrice;
return 0;
}
Ly9NYXh3ZWxsIEJyZXdlciAgICAgICAgICAgIENTMUEgICAgICAgICAgIENoYXB0ZXIgMywgUC4gMTQzLCAjOAovLwovKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAqIAogKiBDQUxDVUxBVEUgSU5TVVJBTkNFIENPU1QKICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwogKiAKICogVGhpcyBwcm9ncmFtIHdpbGwgY2FsY3VsYXRlIHRoZSBjb3N0IG9mIGhvbWVvd25lcnMgaW5zdXJhbmNlCiAqIGJhc2VkIG9mZiB0aGUgdXNlciBpbnB1dCBvZiB0aGUgcHJpY2Ugb2YgdGhlaXIgaG9tZS4KICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiAqIElOUFVUCiAqIAogKiBDb3N0IHRvIGJ1aWxkCiAqIAogKiBPVVRQVVQKICogCiAqIE1pbmltdW0gY29zdCBvZiBpbnN1cmFuY2UKICogCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKI2luY2x1ZGUgPGlvc3RyZWFtPgoj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