Ask Question
25 December, 14:17

Now write the outline of a Class called BulgarianSolitaire. Remember, what does this class need to "know" and what does it need to "do"? I want you to write pseudo code for how this Class can play Bulgarian Solitaire with 45 cards. What is a triangular number?

+1
Answers (1)
  1. 25 December, 16:04
    0
    import java. util. ArrayList;

    import java. util. Collections;

    class Bulgarian

    {

    public static void main (String[] args)

    {

    max_cards=45;

    arr->new ArraryList

    col=1;

    card=0;

    left=max_cards;

    do{

    col->random number

    row->new ArrayList;

    for i=0 to i
    {

    card++

    add card into row

    }

    add row into arr

    left=max_cards-card;

    }while (card
    finish->false

    while (! finish)

    {

    for i=0 to arr. size ()

    remove one card from each row

    add row into arr

    size->new ArrayList;

    for i=0 to i
    add arr[i] into size

    sort (size)

    for i=1 to size. size ()

    if ith element is equals to (i-1) + 1

    finish->true

    else

    finish->false

    for i=0 to i
    print->arr elements

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Now write the outline of a Class called BulgarianSolitaire. Remember, what does this class need to "know" and what does it need to "do"? I ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers