Create a flow chart for the following:
A. Problem Analysis
The input consists of computer base price (CompPrice), the CPU choice (CPU_choice), the RAM choice (RAM_choice), and the Graphics Card choice (VideoCard_choice). Once the customer has entered a choice of an option, the program will determine the corresponding cost of that option: CPU_cost, RAM_cost, VideoCard_cost.
The only item output is the computer selling price (ComputerPrice). To determine the ComputerPrice, the following computation is: ComputerPrice = CompPrice + CPU_cost + RAM_cost + VideoCard_cost.
B. Program Design
Things the program must do:
1. Input the computer base price
2. Process the various options to compute the additional costs
3. Total all the costs
4. Display the final selling price
The main Module will contain the following submodules:
Compute_CPU_Cost
Compute_RAM_Cost
Compute_VideoCard_Cost
Display_Computer_Price
The Hierarchy chart for Computer Price calculator
Pseudocode as follows:
// Computer Price calculator
// Programmer: Christian Gutierrez, University of Maryland University College
// Version 1.0 - November 09, 2013
// This program calculate the total price to purchase all the components required to build a state-of-the-art gaming computer from components available on the internet.
// Variables used:
// CompPrice - computer base price
// CPU_choice, RAM_choice, VideoCard_choice - CPU, RAM and Video card options choices
// CPU_cost, RAM_cost, VideoCard_cost - CPU, RAM and the Video card cost once the options // are selected
// ComputerPrice - calculated the total price of the computer.
//*************************************************************************
Main module
// Declare the program variables
Declare CompPrice, CPU_cost, RAM_cost, VideoCard_cost As Float
// Display welcome message and program menu choices
Write "Welcome to Computer Gaming Build"
Write "This program is designed to calculate the total price of a computer gaming system."
// Prompt for and input the computer base price:
Write "Enter the Computer base price"
// Computer base price input
Input CompPrice
// Call Modules
Call Compute_CPU_Cost
Call Compute_RAM_Cost
Call Compute_VideoCard_Cost
Call Display_Computer_Price
End Program
//***********************************************************
Compute_CPU_Cost
//Declare variables
Declare CPU_choice As Character
// Display the menu and input user selection:
Write "i3770 - Intel Core i7-3770 Ivy Bridge 3.4GHz (3.9GHz Turbo) LGA 1155 77W Quad-Core Desktop Processor Intel HD Graphics 4000"
Write "i2600K - Intel Core i7-2600K Sandy Bridge 3.4GHz (3.8GHz Turbo Boost) LGA 1155 95W Quad-Core Desktop Processor Intel HD Graphics 3000"
Write "i4930K - Intel Core i7-4930K Ivy Bridge-E 3.4GHz LGA 2011 130W Six-Core Desktop Processor"
Write "Please enter your selection"
// CPU selection input
Input CPU_choice
// Price options are as follows:
Select Case of CPU_choice
Case "i3770":
Set CPU_cost = 269.99
Case "i2600k":
Set CPU_cost = 329.99
Case "i4930K":
Set CPU_cost = 589.99
End Case
//**************************************************************
Compute_RAM_Cost
// Declare variables
Declare RAM_choice As Character
// Display the menu and input user selection:
Write "TX8 - Team Xtreem LV 8GB (2 x 4GB) 240-Pin DDR3 2400 (PC311900)"
Write "EVO - GelL EVO CORSA Series 16GB (4 x 4GB) 240-Pin DDR3 2400 CL 10"
Write "GSK - G.SKILL Ripjaws Z 16GB (4 x 4GB) 240-Pin DDR3 2400 CL 9"
Write "Please enter your selection"
// RAM selection input
Input RAM_choice
// Price options are as follows:
Select Case of RAM_choice
Case "TX8":
Set RAM_cost = 149.99
Case "EVO":
Set RAM_cost = 349.99
Case "GSK":
Set RAM_cost = 629.99
End Case
//*******************************************************************
Compute_VideoCard_Cost
// Declare variable
Declare VideoCard_choice
// Display the menu and input user selection:
Write "V5900 - ATI FirePro V5900 2GB 256-bit 512 Support Stream PCI Express 2.1x16"
Write "V7900 - ATI FirePro V7900 2GB 256-bit 1280 Support Stream PCI Express 2.1x16"
Write "Please enter your selection"
// Video Card selection
Input VideoCard_choice
// Price options are as follows:
If VideoCard_choice = "V5900" Then
Set VideoCard_choice = 429.99
Else
Set VideoCard_choice = 699.99
End If
//**********************************************************************
Display_Computer_Price
// Declare variables
Declare ComputerPrice As Float
// Total Computer price
Set ComputerPrice = CompPrice + CPU_cost + RAM_cost + VideoCard_cost
// Output on Display of total price base on selection
Write "Computer Base Price" + CompPrice
Write "CPU" + CPU_choice + "Price" + CPU_cost
Write "RAM"+ RAM_choice + "Price" + RAM_cost
Write "Video Card" + VideoCard_choice "Price" + VideoCard_cost
Write "The total computer cost base on your selection is: $" + ComputerPrice
C. Program Comments and Test Data
The program should run:
// Computer Base Price
CompPrice = 1815.94
// User select CPU, RAM and Video card choice
CPU_choice = "i3770" // selected choice of three options
RAM_choice= "TX8" // selected choice of three options
VideoCard_choice = "V5900" // selected choice of two options
//Base on user option selection from menu the compute formula goes as follows:
CPU_cost = 269.99
RAM_cost = 149.99
VideoCard_cost = 429.99
ComputerPrice = CompPrice + CPU_cost + RAM_cost + VideoCard_cost
ComputerPrice = 1815.94 + 269.99 + 149.99 + 429.99
ComputerPrice = 2,665.91