Homework Assignment Help - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Homework Assignment Help (/thread-10823.html) |
Homework Assignment Help - sphedicl - Jun-08-2018 This is the assignment description: I really haven't received any instructions other than "go online and figure it out yourself" I think I kind of understand it but I really need some help. Much appreciated in advance! Using the if-elif statement, write a program that, given a person’s age, will return their classification and rate multiplier as defined in the table below. Outputs: Person’s Age: nnn Classification: xxx Rate Multiplier: n.n Where: xxx = represents the identifying the persons classification n = represents a numeric value. Inputs: Person’s Age? nnn Insurance classification and rating table Age (Inclusive) Classification Rate Multiplier 12 and Below Child 1.0 13 to 18 Teen 1.5 19 to 65 Adult 1.7 66 and above Senior 2 RE: Homework Assignment Help - micseydel - Jun-08-2018 (Jun-08-2018, 03:29 AM)sphedicl Wrote: I think I kind of understand it but I really need some help.What have you tried? RE: Homework Assignment Help - sphedicl - Jun-08-2018 x = int(input("Person's Age? ")) nnn = "Person's Age" xxx = 'Classification' n.n = 'Rate Multiplyer' this is all I have and I have no idea what I'm doing def main() : xx = int(input("Person's Age?")) if xx < 12: print('Child, Rate: 1.0') elif xx == 12: print('Child, Rate: 1.0') elif xx < 18: print('Teen, Rate: 1.5') elif xx > 12: print('Teen, Rate: 1.5') elif xx == 12: print('Teen, Rate: 1.5') elif xx < 66: print('Adult, Rate: 1.7') elif xx > 18: print('Adult, Rate: 1.7') elif xx > 65: print('Senior, Rate: 2') RE: Homework Assignment Help - pinku018 - Jun-08-2018 (Jun-08-2018, 04:05 AM)sphedicl Wrote: x = int(input("Person's Age? ")) nnn = "Person's Age" xxx = 'Classification' n.n = 'Rate Multiplyer' this is all I have and I have no idea what I'm doing def main() : xx = int(input("Person's Age?")) if xx > 65: print('Senior, Rate: 2.0') elif xx <=65 and xx >18: print('Adult, Rate: 1.7') elif xx <=18 and xx > 12: print('Teen, Rate: 1.5') else: print('Child, Rate: 1.0') |