Use the five step process to design a pseudocode algorithm for the following scenarios:
Create a flow chart for each algorithm.
Publish your work to your assignment document.
Scenario 1
A graphic artist needs to be able to provide quotes for creating business cards for clients.Business cards have an initial artwork setup cost and a cost per card. She needs to be able to enter the initial artwork setup cost,the cost per card,and the number of cards required.The program should then calculate the quote and display the result on the screen.
Problem
To provide quotes for clients business cards
Inputs
Initial artwork setup cost
Cost per card
Number of cards required
Outputs
The Quote
Processing
Get the initial artwork setup cost
Get the cost per card
Get the number of cards required
Add the initial artwork setup cost to the cost per card and multiply this figure by the number of cards required
Algorithm
Calculate the quote
Prompt the user for the initial artwork setup cost
Get the initial artwork setup cost
Validate the initial artwork setup cost
Prompt the user for the cost per card
Get the cost per card
Validate the cost per card
Prompt the user for the number of cards required
Get the number of cards required
Validate the number of cards required
Initial artwork setup cost + cost per card x number of cards required
Display the quote
Close Display
End
Scenario 2
A project manager needs to be able to to estimate how many weeks it will take to complete a project.She needs to be able to enter the number of project team members,the number of hours in a working week and the estimated number of hours it will take to complete the project. The program should then calculate the number of weeks it will take to complete the project.The number of weeks should then be displayed on the screen.
Problem
To find out how many weeks it will take to complete a project
Inputs
Number of project team members
Number of hours in a working week
Estimated number of hours it will take to complete the project
Outputs
The number of weeks it will take to complete the project
Processing
Get the number of project team members
Get the number of hours in a working week
Get the estimated number of hours it will take to complete the project
Multiply the number of team projects members by the number of hours in a working week,divide this figure by the estimated number of hours it will take to complete the project
Algorithm
Calculate the weeks
Prompt the user for the number of project team members
Get the number of project team members
Validate the number of project team members
Prompt the user for the number of hours in a working week
Get the number of hours in a working week
Validate the number of hours in a working week
Prompt the user for the estimated number of hours it will take to complete the project
Get the estimated number of hours it will take to complete the project
Validate the estimated number of hours it will take to complete the project
Number of project team members x number of hours in a working week / estimated number of hours it will take to complete the project
Display the number of weeks
Close Display
End
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment