a) Program code is often written using procedures. Give THREE advantages of using procedures in
b) Write an algorithm (pseudocode or flowchart) for a procedure to validate the input of a date in
February in any year.
The date should be input in the form ddmmyyyy e.g. 07021998
You will need to store each numeric part of the date separately and validate each part.
Include a calculation to determine whether the year entered is a leap year and then check that day is
within the allowed range – in a leap year there are 29 days in February otherwise there are only 28 days in
February - e.g. 29021983 is not valid as there are normally only 28 days in February, however 29021984
is valid because it is a leap year.
Leap years are determined in the following way:
If the year is a century year (such as 1800, 1900, 2000) it is a leap year if it can be divided by 400.
If the year is not a century year then it is a leap year if it can be divided by 4.
Jump to Post
That's not going to happen. This is not a website where you post your problem and you get an answer. This is a place where you come to with questions about an answer and we will help you with it. You get what you put in. Putting in nothing gets …
Jump to Post
if you cant help so please @priteas so please staw away from other buisness
I think you need to rephrase that. Try something like this:
I need to give three advantages of using procedures. I'm not sure exactly what the question is asking. I think that a …
All 6 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.