A Python program should be written to produce output that corresponds to the given hour, minute, second, day of the month, month's name, year, and day of the week's name.
present_year=2016
present_month="January"
present_date="1"
present_day="Friday"
present_hour=0
present_minute=0
present_second=0
input<-from user(seconds)//taking imput from the user using Python program
total_seconds=input
//checking with seconds
if(total_seconds<60)
present_second+=total_seconds
else
total_minutes=total_seconds/60
remaining_seconds=total_seconds-total_minutes*60
present_second+=remaining_seconds
//checking with minutes
if(total_minutes<60)
present_minute+=total_minutes
else
total_hours=total_minutes/60
remaining_minutes=total_minutes-total_hours*60
present_minute+=remaining_minutes
//checklng with hours
if(total_hours<24)
present_hour+=total_hours
else
total_days=total_hours/24
remaining_hours=total_hours-total_days*24
present_hour+=remaining_hours
//checking with days
total_weeks=total_days/7
remaining_day=total_days-total_weeks*7
switch(remaining_day)
case 1:
present_day="Friday"
case 2:
present_day="Saturday"
case 3:
present_day="Sundayday"
case 4:
present_day="Monday"
case 5:
present_day="Tuesday"
case 6:
present_day="Wedday"
case 7:
present_day="Thursday"
//checking with years
if(total_days>366)
while(total_days)
if(present_year%4==0)
total_days-=366
present_year+=1
if(present_year%4!=4)
total_days-=365
present_year+=1
if(present_year%4!=0&&total_days<365)
break;
if(present_year%4==0&&total_days<366)
break;
//checking with months and date
if(total_days<=366)
while(total_days)
if(present_month="January")
present_date++
total_days--
if(present_date==31)
present_month="February"
present_date=0
if(present_month="February")
present_date++
total_days--
if(present_date==28&&present_year%4!=0)
present_month="March"
present_date=0
if(present_date==29&&present_year%4==0)
present_month="March"
present_date=0
if(present_month="March")
present_date++
total_days--
if(present_date==31)
present_month="April"
present_date=0
if(present_month="April")
present_date++
total_days--
if(present_date==30)
present_month="May"
present_date=0
if(present_month="May")
present_date++
total_days--
if(present_date==31)
present_month="June"
present_date=0
if(present_month="June")
present_date++
total_days--
if(present_date==30)
present_month="July"
present_date=0
if(present_month="July")
present_date++
total_days--
if(present_date==31)
present_month="August"
present_date=0
if(present_month="August")
present_date++
total_days--
if(present_date==31)
present_month="September"
present_date=0
if(present_month="September")
present_date++
total_days--
if(present_date==30)
present_month="October"
present_date=0
if(present_month="October")
present_date++
total_days--
if(present_date==31)
present_month="November"
present_date=0
if(present_month="November")
present_date++
total_days--
if(present_date==30)
present_month="December"
present_date=0
if(present_month="December")
present_date++
total_days--
if(present_date==31)
present_month="January"
present_date=0
//printing present time
print present_hour:present_minute:present_second present_date present_month present_year present_day
Learn more about Python program here:
brainly.com/question/28691290
#SPJ4