From 216c8232dba501a8a5edde4c7d971671374e7be2 Mon Sep 17 00:00:00 2001 From: mollusk Date: Tue, 9 May 2017 21:34:36 -0700 Subject: [PATCH] stock-time.py: program for my job --- stock-time.py | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 stock-time.py diff --git a/stock-time.py b/stock-time.py new file mode 100644 index 0000000..87b8e85 --- /dev/null +++ b/stock-time.py @@ -0,0 +1,70 @@ +#!/usr/bin/python3.5 +"""Calculate the stocking speed of employees""" +from datetime import timedelta + + +class Person(): + """Defines: name, cases, start/end time for eomployees""" + def __init__(self, name, cases, start_time, end_time): + self.name = name + self.cases = cases + self.start_time = start_time + self.end_time = end_time + + def get_name(self): + """Prints the name""" + return self.name + + def get_cases(self): + """Gets the cases""" + return self.cases + def get_start(self): + """Gets start_time""" #store the delta start time here + + return self + + def get_end(self): + """get end time""" + return self.end_time + +def start_time(): + """Get start time""" + start_hour = int(input("What is the current hour?: ")) + start_minute = int(input("What is the current minute?:")) + + started_time = timedelta(hours=start_hour, minutes=start_minute) + + if start_hour > 24 or start_minute > 60 or start_hour < 0 or start_minute < 0: + print("These values are fucked") + else: + print("Start Time:", started_time) + + return started_time +##end + +def test(): + """test function""" + start_time() + +def main(): + """main func""" + + starting_time = timedelta(hours=1, minutes=30) + ending_time = timedelta(hours=4, minutes=00) + + duration = ending_time - starting_time + print(duration) + name = input("Enter a name: ") + cases = input("Enter cases: ") + start_time = input("Enter start_time: ") + end_time = input("Enter end time: ") + + person = Person(name, cases, start_time, end_time) + + print("Name: " + person.get_name() + "\n") + print("Cases: " + person.get_cases() + "\n") + print("Start Time: " + person.get_start() + "\n") + print("End Time: " + person.get_end() + "\n") +#main() + +test()