For this lab you will do 2 things: Solve it with an algorithm (no python syntax allowed) Make sure that your algorithm always includes all information the programmer would need to code it. Code it in Python - must use decision structure and conditional loop (must also show a menu to choose married or single from) Must use constants for all known values Auto Insurance Problem Write a program that prompts the user for his/her age and marital status. Use the following menu for the user to choose marital status: Married Single Then calculate and display a rate for auto insurance using the following rules: Age Married Rate Less than 25 No $800.00 Less than 25 Yes $700.00 Greater than or equal to 25 No $500.00 Greater than or equal to 25 Yes $450.00 Input validation: The user must choose a valid choice from the menu for married or single (or it will keep asking) and it must validate the user entered a positive number for age or keep asking for one. The user’s age must be at least 16 or tell them they are too young to drive Use try and except to make error statements for invalid entry. You must post your discussion before seeing any other posts!
For this lab you will do 2 things:
- Solve it with an
algorithm (no python syntax allowed)- Make sure that your algorithm always includes all information the programmer would need to code it.
- Code it in Python - must use decision structure and conditional loop (must also show a menu to choose married or single from)
- Must use constants for all known values
Auto Insurance Problem
Write a
- Married
- Single
Then calculate and display a rate for auto insurance using the following rules:
Age |
Married |
Rate |
Less than 25 |
No |
$800.00 |
Less than 25 |
Yes |
$700.00 |
Greater than or equal to 25 |
No |
$500.00 |
Greater than or equal to 25 |
Yes |
$450.00 |
Input validation: The user must choose a valid choice from the menu for married or single (or it will keep asking) and it must validate the user entered a positive number for age or keep asking for one.
The user’s age must be at least 16 or tell them they are too young to drive
Use try and except to make error statements for invalid entry.
You must post your discussion before seeing any other posts!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images