Question: Homework3 (15pts) Enter the target value: 38 Write a program that uses functions to solve the problem below: Add a function, subsetSupl(), to your program

 Homework3 (15pts) Enter the target value: 38 Write a program that

Homework3 (15pts) Enter the target value: 38 Write a program that uses functions to solve the problem below: Add a function, subsetSupl(), to your program that takes as input a list of positive integers and a positive number target. Your function should display an addition expression of the numbers that add up to the target value and return True if there are three numbers in the list that add Target list entered: [5,4,10,20,15,19] up to target. For example, if the input is list [5,4,10,20,15,19] and the target value is 38 , then the function should display 4+15+19=38 and return True because 4+15+19=38. However, the same input list [5,4,10,20,15,19] and target 10 should not display an addition expression and returns False: Target value entered: 38 1. The program will prompt the user to enter the list and the target value 2. The program will call subsetSum() and pass the list and target value as arguments 4+15+19=38 3. The function will determine whether 3 numbers in the list add up to the target value a. Display an addition expression in the function and return True Function return value: True 4. If three numbers in the list do not add up to the target value a. Function returns False 5. Display the function return value in the program Include the following in your program logic 1. Program prompts for the list and target values 2pts 2. Function subset Sum() is defined with the correct number of parameters 2pts 3. Call the subsetSum() function and pass the list and target values as arguments 1 pt 4. Function uses selection structure to determine if 3 numbers in the list add up to the target value or not 5pts 5. Function displays addition expression 2pts 6. Function returns True or False 1.5pts 7. Program displays function return value 1.5pts Enter the target value: 10 Target list entered: [5,4,10,20,15,19] Target value entered: 10 Example Program Runs: Example 1 Function return value: False Enter a list containing integers: [5,4,10,20,15,19] Important: If your program does not run, that's an automatic 50% deduction Homework submission details

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!