Free Essay

Flow Chart Cmis102

In:

Submitted By blas671
Words 338
Pages 2
Program Description – I will be building a state of the art gaming computer. I will calculate the total prices based on the total input for each test case. After each test case has been formulated it will end in the total expected output of each test case. Analysis – The input of this program will consist of the base price ($500.00), the (OS $101.79), the (HD $79.99), and the (Processor $189.00. After all the choices have been selected, the program will determine the total cost of that option.
The required output for the program will be the total cost of the state of the art gamming computer. The program will then determine the total cost of the state of the art gaming computer by using the following computation: TotalCost = BasePrice+OS+HD+Processor.

Flow chart

The main module executes and setups necessary variables. It then calls getInput function which asks user about details of computer parts. The output function displays the total along with the details.

Pseudo - code

Declare array computerItems[]="CPU","Case","Power supply","Motherboard","DVD","Sound Card","Monitor","Graphics Card" as string
Declare array computerPrice[]=175.00, 90.00,70.00,142.99,99.99,60.00,154.00,214.99 as double
Declare array computerSelected[8]=0 as integer initialized to 0
Declare array otherItems[]="Hard Disk - 500GB","Hard Disk - 1TB","Hard Disk - 1.5TB","RAM - 4MB","RAM - 8MB","RAM - 12MB","OS - Windows7","OS - Red Hat Linux","OS - Windows XP" as string
Declare array otherPrice[]=98,128,148,80,90,100,199.99,349,319 as double
Declare arrayu otherSelected[9]=0 as integer initialized to 0

Module Main() Declare totalPrice as double Set totalPrice=0 Call totalPrice=getInput() Call output(totalPrice)
End Main()

Module double getInput() Declare price as double
Set price=0 Declare ch as character Declare i as integer for i=0 to 8 Display computerItems[i],” (y/n) : " Input ch If ch=='Y' Set price=price + computerPrice[i] Set computerSelected[i]=1 End if End for loop DISPLAY

Similar Documents

Free Essay

Cs 102 Hands on Lab

...CMIS 102 Hands-On Lab // Week 3 Overview: This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design (using both flow chart and pseudocode visualization), and implementation with C code. The example provided uses sequential and selection statements. Program Description: This program will calculate the area of a right triangle. The program will ask the user to enter the base and height and then use these values to calculate and then print the area of the triangle. If the area of the triangle is greater than 100 square units, an additional message is printed stating the triangle is too large for the specification. However; if the triangle is less than or equal to 100 square units, the additional message will state the triangle is within specifications. The design step will include both pseudocode and flow chart visualization. Analysis: I will use sequential and selection programming statements. I will define two float numbers for the base and height: base, height. Float numbers were selected as opposed to integers to make sure triangles of all dimensions are possible and not just whole numbers. Float number will store the area: area The area will be calculated by this formula: Area = ½ * (base * height) For example if the base was 4.2 and the height was 5.3 the area would be calculated as: Area = ½ * (4.2 * 5.3) = ½ * (22.26) = 11.13 The additional selection...

Words: 723 - Pages: 3