Computer Science, asked by madhumatitpatil, 5 months ago

You are given with a file card.c which will give one card at a time. You need to select 13

cards out of deck(52 cards).

The selection of cards will be done based on following rules .

1. all the cards must be of same symbol.

2. all the cards must have unique number.

3. all the cards must be sorted as shown below(do not use any sorting algorithms).

A,2,3,4,5,6,7,8,9,10,J,Q,K

4. Formula to calculate luck

a= attempts made to get all 13 cards.

Ans=(a/52)*100

Luck(%)=(Ans*100)/75​

Answers

Answered by VIBHUGUP
1

Answer:

(a/52)*100

Explanation:

Note the symbol of first card.

Thereafter check each subsequent card if it matches this symbol, if yes, accept it, else reject it.

We can designate a 13 sized array and each accepted card  to be saved in its own corresponding array index.

Keep an attempt counter (a), and an accept conter.

The moment accept counter is 13, Find Luck = (a/52)*100

Similar questions