Program 1 - Gift Card Utilization:
You got a gift card for your local store. It has som...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 25.04.2020 01:43 gungamer720
Program 1 - Gift Card Utilization:
You got a gift card for your local store. It has some credit you can use to buy things, but it may be used only for up to two items, and any credit you don't use is donated to charity. You want to maximize the amount of the card you spend. Therefore, you want to buy two items which add up as close to the gift card value as possible. You will generate the value of the gift card (random amount between $25 and $75) and a list of 10 item values (in increments of $5. from $5 to $50) in an array. You should return a pair of indices that correspond to values that add up to the gift card total or as close as possible. Hint #1: it is highly recommended that you print out the array to the screen for debugging; it can be included as part of the output. Something like:
| $14 | $25 / $ 71 $ 48 $171 $191 $331 $21$471 $10||
Hint #2: this can't be solved by doing only one pass of the array... How do you know if the first element is part of the solution? What about the second?
Sample Output (your gift card amount will differ):
Gift Card Amount: 64 You bought item #9 for $50 You bought item #1 for $10 Amount Donated to Charity: 4
Gift Card Amount: 71 You bought item #9 for $50 You bought item #3 for $20 Amount Donated to charity: 1
Gift Card Amount: 56 You bought item #9 for $50 You bought item #0 for $5 Amount Donated to charity: 1
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 20:00
Need asap write a short paper describing the history and differences between six sigma, waterfall, agile, and scrum models. understanding these models can give you a good idea of how diverse and interesting it development projects can be. describe what the rationale for them is and describe their key features. describe the history behind their development. at least 400 words
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 22:30
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 14:30
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
You know the right answer?
Questions
![question](/tpl/images/cats/mat.png)
Mathematics, 15.07.2019 08:00
![question](/tpl/images/cats/en.png)
English, 15.07.2019 08:00
![question](/tpl/images/cats/mat.png)
Mathematics, 15.07.2019 08:00
![question](/tpl/images/cats/istoriya.png)
History, 15.07.2019 08:00
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.07.2019 08:00
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.07.2019 08:00
![question](/tpl/images/cats/mat.png)
Mathematics, 15.07.2019 08:00
![question](/tpl/images/cats/biologiya.png)
Biology, 15.07.2019 08:00
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.07.2019 08:00
![question](/tpl/images/cats/mat.png)
Mathematics, 15.07.2019 08:00
![question](/tpl/images/cats/istoriya.png)
History, 15.07.2019 08:00