Free Essay

Cmis102Hw2

In:

Submitted By punkdaddy1313
Words 704
Pages 3
NAME:
CMIS 102
INSTRUCTOR:
Due Date:

Program Description: This program will calculate the total cost of a customized gaming PC using user selections for Case, Hard Drive, and Graphics Card. There is a baseline cost included in the final price.
Analysis: The formula used to determine the computer cost is: TotalCost=CaseCost + HDCost +GPUCost + BaselineCost. All cost items are integers. Input values are TotalCost, A-I. Output value is TotalCoast as Float. Baseline price is a fixed float of 649.99 Prices were determined using the website: www.newegg.com Case Options | Hard Drive Options | GPU Options | A: Rosewill THOR V2-$129.99 | D: Seagate Hybrid 2TB-$109.99 | G: EVGA GeForce GTX 970-$349.99 | B: AZZA Solano 1000-$119.99 | E: Western Digital Red 3TB-$124.99 | H: ZOTAC GeForce GTX 970-$549.99 | C: Thermaltake Chaser MK-I-$114.99 | F: HGST Deskstar 4TB-$184.99 | I: XFX Radeon R9 290X-$329.99 |

Test Plan Test Case | Input | Expected Output | 1 | Baseline: $649.99Case A:$129.99Hard Drive E: $124.99GPU G: $349.99 | Total Cost: $1254.96 | 2 | Baseline: $649.99Case B: 119.99Hard Drive D: $109.99GPU I: 329.99 | Total Cost: $1209.96 | 3 | Baseline: $649.99Case C: $114.99Hard Drive F: $184.99GPU H: $549.99 | Total Cost: $1499.96 |

START
START
FLOWCHART END
END
WRITE “The Total Cost of your gaming PC is $” + TotalCost
WRITE “The Total Cost of your gaming PC is $” + TotalCost
SET TotalCost=Baseline + CaseCost + HDCost + GPUCost
SET TotalCost=Baseline + CaseCost + HDCost + GPUCost
INPUT GPUCost
INPUT GPUCost
WRITE “Enter GPUCost”
WRITE “Enter GPUCost”
INPUT HDCost
INPUT HDCost
WRITE “Enter HDCost”
WRITE “Enter HDCost”
INPUT CaseCost
INPUT CaseCost
Write “Enter CaseCost”
Write “Enter CaseCost”
INPUT Baseline
INPUT Baseline
WRITE “Enter Baseline”
WRITE “Enter Baseline”

PSEUDOCODE /* NAME: DATE: COURSE: CMIS102 DESCRIPTION: Gaming PC Assignment */ Main Module //This program takes the cost of three computer parts selected by the user and a baseline price to determine the price of a high-end gaming PC //Declare variables Declare Baseline, CaseCost, HDCost, GPUCost as Float //Get Baseline Cost Write “Enter the Baseline Cost:” Input Baseline //Call Modules to perform certain tasks Call Compute CaseCost Call Compute HDCost Call Compute GPUCost Call Display SellingPrice END Main //Display a welcome message to customer Display WelcomeMessage Module Write “Welcome to the Custom Gaming PC Program” Write “You will have several options to choose from” End WelcomeMessage //This module will get the case selection from the customer and sets the case cost CaseCost Module Declare Case Option as Character //Display the menu and input customer selection Write “A-Rosewill THOR V2 Case” Write “B-AZZA Solano1000 Case” Write “C- Thermaltake Chaser MK-I Case” Write “Which Case Option do you want?” Input Case Option //Calculate cost of case selection Select Case of Case Option Case “A”: Set CaseCost=129.99 Break Case “B”: Set CaseCost=119.99 Break Case “C”: Set CaseCost=114.99 Break End Case End CaseCost //This module gets the Hard Drive selection from the customer and sets the HD Cost HDCost Module Declare HD Option as Character //Display menu and input user selection Write “D-Seagate Hybrid 2TB” Write “E-Western Digital Red 3TB” Write “F-HGST Deskstar 4TB” Write “Which HD Option do you want?” Input HD Option //Determine cost of HD Selection Select case of HD Selection Case “D”: Set HDCost=109.99 Break Case “E”: Set HDCost=124.99 Break Case “F”: Set HDCost=184.99 Break End Case END HDCost //This module gets the GPU selection from the customer and sets the GPU cost GPUCost Module Declare GPU Option as Character //Display menu and input user selection Write “G-EVGA GeForce GTX 970” Write “H-ZOTAC GeForce GTX 980” Write “I-XFX Radeon R9 290X” Write “Which GPU Option do you want?” Input GPU Option //Determine cost of GPU selection Select case of GPU Option Case “G”: Set GPUCost=349.99 Break Case “H”: Set GPUCost=549.99 Break Case “I”: Set GPUCost=329.99 Break End Case END GPUCost //This module calculates the total cost and displays it to the customer Display SellingPrice Module Set SellingPrice=Baseline + CaseCost +HDCost + GPUCost Write “The total cost of your gaming PC is $” + SellingPrice End Display SellingPrice

Similar Documents