//Charlotte Davies-Kiernan CS1A Chapter 2 P.83 #13
//
/******************************************************************************
*
* Compute Circuit Board Price
* ____________________________________________________________________________
* This program calculates the selling price of a circuit board that is
* sold at a percentage of profit
*
* Computaion is based on the formula:
* selling price = cost + (cost * profit rate)
* ____________________________________________________________________________
* INPUT
* cost : Constant for cost of the circuit board
* profitRate : Constant for profit percentage
* OUTPUT
* sellingPrice : Price of the circuit board including the profit percentage
*****************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float cost; //INPUT - constant for cost of the circuit board
float profitRate; //INPUT - constant for profit percentage
float sellingPrice; //OUTPUT -circuit board price including profit percentage
//
// Initialize Program Variables
cost = 12.67;
profitRate = 0.40;
//
// Compute Selling Price
sellingPrice = cost + (cost * profitRate);
//
// Output Result
cout << std::fixed << std::setprecision(2); //format ouput to 2 decimal places
cout << "Selling price of the circuit board: $" << sellingPrice << endl;
return 0;
}