Reference no: EM132931400
Java - Programming Environment
Objectives:
• Analyse a simple data processing problem to correctly identify the data and high-level processing involved.
• Apply the basic programming construct of selection to develop pseudocode that solves simple data processing problems
• Use appropriate programming tools to develop an effective computer program from pseudocode
• Specify and execute test plans for pseudocode and programming code
• Develop external documentation for the process of converting a simple data processing problem into a computer program
• Internally document a computer program with appropriate comments.
Task 1: Pseudocode
Write a pseudocode for the Ticketing Program that will allow a user to buy multiple tickets across different ticket categories, and then display a summary of what they have purchased.
In greater detail you will need to create a program that will:
• Ask the user to select a category of tickets to purchase
• Ask the user to enter the number of tickets to be purchased
• Display a summary message regarding the number of tickets to be purchased
• Ask the user to confirm the purchase by pressing ‘Y' (If they do not wish to confirm, the program should return to the Main Menu)
• The program should display the total amount for the number of tickets purchased through the selected category
• The program should then ask if the user wishes to purchase tickets from another category
? If Yes, then the program should return to the Main Menu, with a summary of what they have purchased underneath.
? If No, the user should be given an overall summary of what they have purchased in all categories, including a grand total, and the program should then exit
Figure1 below shows an example of the expected program output
Task 2: Data dictionary
Write a Data dictionary for the corresponding pseudocode written in Task 1.
You should enter at least 10 variables.
Variable name
|
Type
|
Length
|
Acceptable
|
Description
|
|
|
|
values
|
|
|
|
|
|
|
|
|
|
|
|
Task 3: Desk check
Desk-check the pseudo code written in Task 1 using at least two test datasets. Provide both the test data table and desk-check table.
Use the template given below to complete your answer.
Test data table:
|
|
|
Input
|
|
Expected Total
|
First
|
Variable
|
|
Value
|
Variable
|
|
Value
|
dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Second
|
Variable
|
|
Value
|
Variable
|
|
Value
|
dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Desk check table:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Line
|
|
|
Variables
|
|
|
|
Input/Output
|
Number
|
|
|
|
|
|
|
|
|
|
1
|
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
|
|
Task 4: Programming
Write a program based on the pseudocode and data dictionary you designed in Task 1 and Task 2
• The program should match the logic specified in the pseudo code.
• The code should be easy to read and understand.
• The code should be well formatted.
• The program should use meaningful variable names
• The code should be well documented. This should include comments about the program: program name, purpose, author; comments describing each variable and comments on each section of the program.
Task 5: Testing
Test the program by providing screen shot using the following test data:
• Child: Number of tickets = 5
• Adult: Number of tickets = 10
• Senior: Number of tickets = 2