Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Posts: 3Member
[color=Red]Your assignment will be to produce a program, structure chart and testing plan for a program that does the following:

Take two strings from the user:
-The first will be the current date in DD/MM/YYYY format
-The second will be the current time HH:MM

The program will then output the following:
-How many days there are left in the month
-How many months left in the year
-How many years left before the year 3000
-Working out what fraction of the day is left (Remembering there are 24 hours in a day, and 12:00 would be 0.5 through the day)[/color]

[b]here is the code i have at the moment, im just a bit stuck at trying to do the bitwhere it does the days left of the month, how many months are left, and the left from year 3000 bit.[/b]

[italic]program Assignment2;

Uses
crt;

Var
Date:String;
Day,Month,Year,DaysLeft,MonthsLeft:String;
Hours,Minutes:String;

begin

Writeln ('Please enter the current date in the format DD/MM/YYYY');
Writeln ('Please enter the current time in the format (24 hour) HH:MM');

Day:= Copy(Date,1,2);
Month:= Copy(Date,4,5);
Year:= Copy(Date,7..10);
Hours:= Copy(Time,1,2);
Minutes:= Copy(Time,4,5);

If Month = 01,03,05,07,08,10,12 then
Days = 31
End If

If Month = 04,06,09,11 then
Days = 30
End If

If Month = 02 then
Days = 28
End If

end.[/italic]