Question: A . [ Worth 1 3 points ] Function program 1 ( ) . When button with the label problem 1 is clicked, the
AWorth points Function program When button with the label "problem is clicked,
the function program should be called in your JS file. This method should call a recursive
helper function with logic equivalent to that in the iterative flowchart that is shown above.
This recursive function and its iterative analogue determines all the possible ways that a bill
for dollars can be split among people. One option might be that every person pays the
Page
same amount. Another option might be that one person pays for everything. The input in this
problem will represent the total amount of money to pay in dollars and the output will be
every possible way you could split the bill, assuming everyone pays a whole number of dollars.
For example, if the input $ your function might list off these options:
: $: $: $
: $: $: $
: $: $:$
and
However, if the user enters a negative number of dollars or a value that is not prefixed with a $
symbol, the output should read "Invalid Input".
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
