Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
8ab3660e7f |
@ -4,14 +4,18 @@
|
|||||||
#output day, week, month year costs
|
#output day, week, month year costs
|
||||||
import os
|
import os
|
||||||
import math
|
import math
|
||||||
|
import ciglib
|
||||||
|
from ciglib import fgColor
|
||||||
|
|
||||||
cost = None
|
cost = None
|
||||||
packs = None
|
packs = None
|
||||||
|
|
||||||
|
|
||||||
def calcHours(tempCost):
|
def calcHours(tempCost):
|
||||||
return format(float(tempCost)/wages, '.2f')
|
return format(float(tempCost)/wages, '.2f')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
os.system('clear')
|
os.system('clear')
|
||||||
try:
|
try:
|
||||||
@ -38,36 +42,32 @@ while True:
|
|||||||
os.system('clear')
|
os.system('clear')
|
||||||
break
|
break
|
||||||
|
|
||||||
print("Your cigarettes cost $" + format(cost/20, '.2f'), "each")
|
print(fgColor.RED,"Your cigarettes cost $" + format(cost/20, '.2f'), "each", fgColor.NC)
|
||||||
|
|
||||||
cigsPerPacks = math.ceil(20 * packs)
|
|
||||||
costPerPacks = cost * packs
|
|
||||||
|
|
||||||
YEAR=365
|
|
||||||
WEEK=7
|
|
||||||
print()
|
print()
|
||||||
print("You smoke: ")
|
print(fgColor.CYAN,"You smoke: ",fgColor.NC)
|
||||||
print(cigsPerPacks, "per day")
|
print(fgColor.YELLOW,math.ceil(20 * packs), "cigarettes per day", fgColor.NC)
|
||||||
print(cigsPerPacks * WEEK, "per week")
|
print(fgColor.YELLOW,math.ceil(20 * packs * 7), "cigarettes per week",fgColor.NC)
|
||||||
print(math.ceil((cigsPerPacks * YEAR)/12), "per month")
|
print(fgColor.YELLOW,math.ceil((20 * packs * 365)/12), "cigarettes per month",fgColor.NC)
|
||||||
print(cigsPerPacks * YEAR, "per year")
|
print(fgColor.YELLOW,math.ceil(20 * packs * 365), "cigarettes per year", fgColor.NC)
|
||||||
|
|
||||||
print()
|
print()
|
||||||
|
|
||||||
print("This costs you: ")
|
print(fgColor.CYAN,"This costs you: ",fgColor.NC)
|
||||||
|
|
||||||
tempCost = format(costPerPacks, '.2f')
|
tempCost = format(cost * packs, '.2f')
|
||||||
tempHours = calcHours(tempCost)
|
tempHours = calcHours(tempCost)
|
||||||
print("$" + tempCost, "and", tempHours, "hours per day")
|
print(fgColor.GREEN,"$" + tempCost, "and", tempHours, "work hours per day",fgColor.NC)
|
||||||
|
|
||||||
tempCost = format(costPerPacks * WEEK, '.2f')
|
tempCost = format(cost * packs * 7, '.2f')
|
||||||
tempHours = calcHours(tempCost)
|
tempHours = calcHours(tempCost)
|
||||||
print("$" + tempCost, "and", tempHours, "hours per week")
|
print(fgColor.GREEN,"$" + tempCost, "and", tempHours, "work hours per week",fgColor.NC)
|
||||||
|
|
||||||
tempCost = format((costPerPacks * YEAR)/12, '.2f')
|
tempCost = format((cost * packs * 365)/12, '.2f')
|
||||||
tempHours = calcHours(tempCost)
|
tempHours = calcHours(tempCost)
|
||||||
print("$" + tempCost, "and", tempHours, "hours per month")
|
print(fgColor.GREEN,"$" + tempCost, "and", tempHours, "work hours per month",fgColor.NC)
|
||||||
|
|
||||||
tempCost = format(costPerPacks * YEAR, '.2f')
|
tempCost = format(cost * packs * 365, '.2f')
|
||||||
tempHours = calcHours(tempCost)
|
tempHours = calcHours(tempCost)
|
||||||
print("$" + tempCost, "and", tempHours, "hours per year")
|
print(fgColor.GREEN,"$" + tempCost, "and", tempHours, "work hours per year",fgColor.NC)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user