•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:
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=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=0 as integer initialized to 0
Declare totalPrice as double
Module double getInput()
Declare price as double
Declare ch as character
Declare i as integer
for i=0 to 8
Display computerItems[i],” (y/n) : "
Set price=price + computerPrice[i]
End for loop
DISPLAY<<"Hard Disk - "
For i=0 to 2
DISPLAY otherItems[i]," (y/n) : "...