a) Program code is often written using procedures. Give THREE advantages of using procedures in
programming.
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.
Ivzirnalsradeys
0
Newbie Poster
Recommended Answers
Jump to PostThat'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 Postif 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
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Ivzirnalsradeys
0
Newbie Poster
NathanOliver
429
Veteran Poster
Featured Poster
Ivzirnalsradeys
commented:
i understand and sory
+0
Moschops
683
Practically a Master Poster
Featured Poster
Ivzirnalsradeys
commented:
thnk
+0
NathanOliver
429
Veteran Poster
Featured Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
Ivzirnalsradeys
commented:
thanks
+0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.