Professional Documents
Culture Documents
Pascal Task Sheet 3
Pascal Task Sheet 3
1. Create a shopping till to add up the cost of a series of purchases. Your program must:
Accept amounts from the user
Subtotal the amounts
Provide a final total
Accept payment
Calculate change
Return change
Advanced:
Allow the user to clear the last entry
2. Create a program which tests an integer for a prime number. Your program must:
Accept a positive integer from the user
Test the number to determine whether or not it is a prime number
Return a message to the user indicating whether or not the input was a prime number
The program should continue to run until the user chooses to exit the program
Advanced:
Accept the number in a suitable format and write validation code to ensure it is an
integer