Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help I keep getting an error for the line: read -p Enter the number of cards to draw: num_cards I'm not sure what I'm

help I keep getting an error for the line: read -p "Enter the number of cards to draw: " num_cards I'm not sure what I'm missing in this part of the loop.

image text in transcribed

image text in transcribed

image text in transcribed

I have an error in my code, that I'm not sure why. it is in the previous line(s) of the num_cards input when the user chooses option 1.

true; \#creates the menu loop and the options for the loop -e "Welcome to the card deck simulator, please select from the foldoring option -e "1. Draw a selected number of cards from the current deck" -e "2. Get a new deck of cards." -e "3. Exit." -p "Enter your choice: " choice ase schoice in read -p "Enter the number of cards to draws " num_cards draw_cards =$ \$num_cards ${ drawn_cards [e]} ;i deck =( "\$\{ppades [e]]} " "\$\{diamonds[e]\}" "\$\{ctubs[e]\}" "\$\{tearts[e]\}" echo "Your new deck of cards has been created." echo "Exiting" exit ;j echo "Invalid choice, try again." done true; \#creates the menu loop and the options for the loop -e "Welcome to the card deck simulator, please select from the foldoring option -e "1. Draw a selected number of cards from the current deck" -e "2. Get a new deck of cards." -e "3. Exit." -p "Enter your choice: " choice ase schoice in read -p "Enter the number of cards to draws " num_cards draw_cards =$ \$num_cards ${ drawn_cards [e]} ;i deck =( "\$\{ppades [e]]} " "\$\{diamonds[e]\}" "\$\{ctubs[e]\}" "\$\{tearts[e]\}" echo "Your new deck of cards has been created." echo "Exiting" exit ;j echo "Invalid choice, try again." done

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions