0

1.write an algo that asks a user to input a month and a year. The algo then determines the number of days in that month and year(Note: Take into consideration leap year)

2. write an algo that asks a user to input a date and a month. The algo then determines which zodizc sign the person belongs to.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Wolfgan
1

One of Daniweb rules is

Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

If you have a coding problem then please post some code and someone will help you.

0

This problem for students. I do not see the code that you can not.
Formula for calculating a leap year is known to all.

Result := ((Year mod 4) = 0) and ((Year mod 100) <> 0) or ((Year mod 400) = 0);

Algorithm for computing is very simple.

const
  Days: array[1..12] of Byte = (31,28,31,30,31,30,31,31,30,31,30,31);
begin
     if (Month = 2) and IsLeapYear(Year) then
        Result := Days[Month]+1
     else
        Result := Days[Month];

Do not want to think for themselves? Then, and help you no sense. None who do not need experts do not know how to do the work yourself.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.