Python Forum
Homework Assignment Help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Homework Assignment Help
#1
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
Reply
#2
(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?
Reply
#3
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')
Reply
#4
(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 < 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')
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')
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I am completely lost on this homework assignment a36 1 1,707 Feb-21-2022, 06:01 AM
Last Post: buran
  saving issue on homework assignment russoj5 2 1,920 Oct-26-2020, 01:53 PM
Last Post: russoj5
  Help with homework assignment grayarea3 1 2,829 Feb-20-2019, 10:10 PM
Last Post: ichabod801
  Homework Assignment Help pinku018 3 3,027 Jun-08-2018, 01:09 PM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020