// variables.cpp : Defines the entry point for the console application. //program to demonstrate program functional decomposition //1. define variables //2. assign values to variables - assignment and interactively //3. order computations //4. output results #include "stdafx.h" //enables use of cout and cin #include "iostream.h" //define variables float item_price; float tax_percentage; float tax_amount; int num_of_items; float total_price_of_order; int _tmain(int argc, _TCHAR* argv[]) { //assigns variable values with assignment statements item_price = 5.50; tax_percentage = .06; //assigns variable value with computation and orders computations tax_amount = item_price * tax_percentage; //assigns variable values interactively with a user prompt cout << "enter the number of items bought: " << endl; cin >> num_of_items; // orders computation total_price_of_order = (tax_amount + item_price)* num_of_items; // order of computations //output of results cout << "price of order is: " << total_price_of_order << endl; return 0; }