Pseudo Problem Analysis

591 WordsSep 2, 20153 Pages
•A. Problem Analysis - Following the directions in the assignment, clearly write up your problem analysis in this section. This problem will require selection statements, repetition statements and arrays. The information about various computer parts can be stored in an array which can be iterated to display options to users. •B. Program Design - Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. The program has been divided in following modules: Hierarchy chart getInput() getInput() output() output() Main() Main() 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. Here is the pseudo code: 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

More about Pseudo Problem Analysis

Open Document