Problem definition: 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.
CPU Intel Core i5-3570K Ivy Bridge 3.4GHz $230
Case Rosewill BLACKHAWK Gaming ATX Mid Tower Computer Case $80
Power supply CORSAIR HX Series HX750 $130
Motherboard GIGABYTE GA-990FXA-UD3 $133
Hard Drive TOSHIBA DT01ACA100 1TB 7200 RPM 32MB Cache $65
Sound Card ASUS Xonar DX 7.1 $90
Graphics Card MSI N650-MD1GD5/OC GeForce GTX 650 1GB $110
Operating System Microsoft Windows 7 Ultimate $190
BaseCost = 1, 028
RAM | Purchase Code | Price |
G.SKILL Ripjaws Series 4GB | G | $48 |
G.SKILL Ripjaws Series 8GB | R ...view middle of the document...
What our program will do is: Input the initial cost (BaseCost), and then process the options to compute the additional costs, total all of the cost, and then give the user the final price.
Declare BaseCost, RamCost, DvdCost, MonitorCost As Float
Display welcome message
// Prompt for and input the base cost of the computer:
Write “Enter the base cost: “
Input BaseCost // User will input the base cost of the computer
Call Compute_Ram_Cost module // Directs the computer to run the ram cost module
Call Compute_Dvd_Cost module // Directs the computer to run the Dvd cost module
Call Compute_Monitor_Cost module // Directs the computer to run the monitor cost
Declare RamChoice As Character
/ / Display the menu and input user selection:
Write “G – 4GB Ram” // Showing option G for the Ram selection
Write “ R – 8GB Ram” // Showing option R for the Ram selection
Write “X – 16GB Ram” // Showing option X for the Ram selection
Write “Selection? “ // Asking the user what selection they will make
Select Case Of RamChoice
Set RamCost = 48 // Setting option G to $48 // Setting the cost of G
Set RamCost = 75 // Setting option R to $75 // Setting the cost of R
Set RamCost = 155 // Setting option X to $155 // Setting the cost of X
Write “Invalid selection” // For selections that aren’t on the determined...