Professional Documents
Culture Documents
HSYD100 1 Jan Jun2023 FA2 PC V2 13022023
HSYD100 1 Jan Jun2023 FA2 PC V2 13022023
Weighting: 25%
Educator: P. Jideani
Examiner: P. Jideani
Total: 50 marks
Instructions:
• You must submit your code and your screenshots of your application in one pdf
file
1 HSYD100-1–Jan-Jun2023-FA2-PC-V2-13022023
Question 1 [20 marks]
You and four other members of your programming study group decide to tackle
programming by making it fun and interesting. The five of you decide to create a game.
Each member of the team picks a number, the program should accept this number.
Using a bar chart style illustrate the numbers chosen by displaying an asterisk for each
number. The output of your program should display similar to the image below
2 HSYD100-1–Jan-Jun2023-FA2-PC-V2-13022023
RUBRIC
Functionality Marks
You are gradually making progress in your programming journey and your love for
programming continues to grow. You are developing an application for invoicing.
Create a class called Purchase. Each Purchase must have an invoice number, amount
of sale and an amount for sales tax. You have been reminded that you need to include
set methods for the invoice number and sale amount. For the set method of the sale
amount, calculate the sales tax as 5 percent of the sale amount. You have been again
reminded that you need to include a display method that displays all the purchase’s
details.
RUBRIC
Functionality Marks
Instance variables 3
Mutator methods 6
3 HSYD100-1–Jan-Jun2023-FA2-PC-V2-13022023
Question 2.2 [17 marks]
You are about to complete this exciting invoicing system. Now code an application that
declares a purchase object and prompts the user for purchase details. When this
prompt is made, do not allow the user to proceed until a number between 1000 and
6000 inclusive has been entered. When the system prompts for a sale amount, it must
not proceed until the user has entered a non-negative value. In the event a valid
purchase object has been created, display the object’s invoice number, sale amount
and sales tax.
RUBRIC
Functionality Marks
Object creation 3
4 HSYD100-1–Jan-Jun2023-FA2-PC-V2-13022023