Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java code with these requirement:An e - commerce company specializes in cards with sports figures on them. Each sport has different categories of cards.For instance,

Java code with these requirement:An e-commerce company specializes in cards with sports figures on them. Each sport has different categories of cards.For instance, there might be more desirable cards with the most popular sports personalities, others will small pieces of player's jersey attached, and so on. they have a number of each category of card want to make some number of packets greater than 1 that each contain equal numbers of each type of card.To do this, they will add more cards of each type until each type can be divided equally among some number of packets. Determine the minimum number of additional cards needed to create a number of packets with equal type distribution. functional description: complete the function cardPackets. cardPackets has the following parameters: int cardTypes[n]: the quantity available of card type returns: int: the minimum number of additional cards to add Example: n =5; cardType =[4,7,5,11,15] In order to make 2 matching packets, the following numbers of additoonal cards of each type must be added:[0,1,1,1,1]. this sums 4 additional cards. the number of cards are[4,8,6,12,16 and they can be evenly amomg two packets.if three packets are created, an additional[2,2,1,1,0] cards are neeeded, sum=6 items. this yields quantities[6,9,6,12,15].Any number of packets >=2 can be created, but creating 2 packets requires the minimum number of additional cards.

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

Step: 3

blur-text-image

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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions