QuestionQuestion

Transcribed TextTranscribed Text

A Day Care Center charges varying weekly rates depending on the age of the child and the number of days per week the child attends, as shown in the Table below. Develop the logic for a program that continuously accepts child care data and displays the appropriate weekly rate. This should use a Multi-Dimension Array indicated below. Days Per Week Age in Years 1 2 3 4 5 30.00 60.00 88.00 115.00 140.00 1 26.00 52.00 70.00 96.00 120.00 2 24.00 46.00 67.00 89.00 110.00 3 22.00 40.00 60.00 75.00 88.00 4 or more 20.00 35.00 50.00 66.00 84.00 Make a working version of this program in Python.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import sys


# get user's legal input
def getInput(message, min, max):
    val = min - 1
    while val < min or val > max:
       val = int(input(message))
       pass
    return val

# run a phrase of the program
def run():

    # the 2d array
    mda = [[0.0, 30.0, 60.0, 88.0, 115.0, 140.0],
          [1.0, 26.0, 52.0, 70.0, 96.0, 120.0],
          [2.0, 24.0, 46.0, 67.0, 89.0, 110.0],
          [3.0, 22.0, 40.0, 60.0, 75.0, 88.0],
          [4.0, 20.0, 35.0, 50.0, 66.0, 84.0]]

    # get age
    age = getInput("Enter age of the child: ", 0, sys.maxsize - 2)

    if age > 4:
       age = 4...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$15.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats