Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

In Python 3+ Make sure the equations you use, are in the design. Add comments to your code. Make sure your code keeps looping asking

In Python 3+

Make sure the equations you use, are in the design. Add comments to your code. Make sure your code keeps looping asking the user if they want to do another family.

A non-governmental organization needs a program to calculate the amount of financial assistance for needy families. The formula is as follows:

If the annual household income is between $30,000 and $39,999 and the household has at least three children, the amount is $1000 per child.

If the annual household income is between $20,000 and $29,999 and the household has at least two children, the amount is $1500 per child.

If the annual household income is less than $20,000, the amount is $2000 per child.

Implement a function for this computation. Write a program that asks for the household income and number of children for each applicant, printing the amount returned by your function. Use a -1 as a sentinel value for the input.

Test Cases:

Household income = $35,000No. of children = 4 (should return $1000/child)

Household income = $25,000No. of children = 3 (should return $1500/child)

Household income = $18,000No. of children = 2 (should return $2000/child)

Household income = $40,000No. of children = 1 (should return No assistance)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students explore these related Databases questions