#source code screenshots
#code
import datetime
print("Birthday Calculator\n")
while(1):
name = input("Enter name: ")
birthday = input("Enter birthday (MM/DD/YY): ")
list = []
list = birthday.split('/')
mm = int(list[0]);
dd = int(list[1])
yy = int(list[2])
c=19;
if(yy<10):
c=200;
elif(yy<=18):
c=20;
yy = int(str(c)+str(yy))
w = datetime.date(yy, mm, dd);
print("Birthday: "+ w.strftime("%A")+", "+w.strftime("%B")+"
"+w.strftime("%d")+", "+str(w.year))
x = datetime.date.today()
print("Today: "+ x.strftime("%A")+", "+x.strftime("%B")+"
"+x.strftime("%d")+", "+str(x.year))
years_diff = x.year - yy;
days_diff = 0;
if(mm>x.month):
years_diff = years_diff-1;
y = datetime.date(x.year, mm, dd)
diff = y-x;
days_diff = diff.days;
elif(mm==x.month):
if(dd>x.day):
years_diff = years_diff-1;
days_diff = dd-x.day;
elif(dd<x.day):
if(dd==x.day-1):
days_diff=-1;
else:
y = datetime.date(x.year+1, mm, dd)
diff = y-x;
days_diff = diff.days;
else:
y = datetime.date(x.year+1, mm, dd)
diff = y-x;
days_diff = diff.days;
if(years_diff<2):
print(name+" is "+str(years_diff*365+365-days_diff)+" days
old.")
else:
print(name+" is "+str(years_diff)+" years old.")
s = ""
if(days_diff==0):
s="is today!"
elif(days_diff==1):
s="is tomorrow!"
elif(days_diff==-1):
s="was yesterday!"
else:
s="is in "+str(days_diff)+" days.";
print(name+"'s birthday "+s+"\n")
option = input("Continue? (y/n): ")
if(option=='n'):
break;
#output screenshot
#any query, post in comment section
Write in python code Project 11-1: Birthday Calculator Create a program that accepts a name and...
Write a C++ program that determines the user's age after the user enters both the current date and hisher birthdate as 3 integers: yyyy mm dd Define a class which is named DateType and will be used to declare 2 objects: "birthday" and "today". The class will have a function "output" which will display the date in conventional form (like it is above next to Date Assigned: Month dd, yyyy and it will have a second function named “input”...
Coding in C++ Write a program using structures to store the following weather information: - Month name - Day of month (Monday, Tuesday, etc) - High Temperature - Low Temperature - Rainfall for the day Use an the input.txt file to load the data into weather structures. Once the data for all the days is entered, the program should calculate and display the: - Total rainfall for the data - Average daily temperatures. (note: you'll need to calculate the days...
Write a program called RentalRate.java which reads in a date of birth, today’s date and a male/female designation from the user, and will then determine the basic daily and weekly rates for rental of an economy class car. Rental rate classes are: Best rate (male drivers, age 33–65 and female drivers, age 30-62)--$40.00per day, $200.00 per week Risk rate 1 (female drivers, age 25–29)–Best rate plus $10.00 per day or best rate plus $55.00 per week. Risk rate 2 (male...