Electrical and Computer Engineering
25 of 52
UAH
CPE 112
Good Style Example
•//****************************************************************
•// HouseCost program
•// This program computes the cost per square foot of
•// living space for a house, given the dimensions of
•// the house, the number of stories, the size of the
•// nonliving space, and the total cost less land
•//****************************************************************
•#include <iostream>
•#include <iomanip>    // For setw() and setprecision()
•using namespace std;
•
•const float WIDTH = 30.0;               // Width of the house
•const float LENGTH = 40.0;              // Length of the house
•const float STORIES = 2.5;              // Number of full stories
•const float NON_LIVING_SPACE = 825.0;   // Garage, closets, etc.
•const float PRICE = 150000.0;           // Selling price less land
•
•