subject

Write a program that deals random cards, printing the "rank" of the card and its "suit" (both randomly generated) until you have dealt 4 aces. to select a card, you will first choose a random number from 1 - 13 which will represent the "rank" of the card. numbers from 2 through 10 can be printed just as they are. however, the number 1 should print "ace", the number 11 should print "jack", the number 12 should print "queen" and the number 13 should print "king". you will also have to select a second random number from 1 to 4 which represents the "suit". this is completely independent of the "rank" described above. (notice that each time you draw a card, it is as if it were from a fresh (undealt) deck. thus, it is possible to draw two or more "aces of spades", or two or more "3 of clubs".) at the end of the program, you should print out the number of face cards (jack, queen or king) that you dealt.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 22.06.2019 15:10
Consider a direct-mapped cache with 216 words in main memory. the cache has 16 blocks of 8 words each. it is a word-addressable computer (rather than a byte-addressable computer which we normally discuss). (a) how many blocks of main memory are there? (b) what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, cache block, and block offset fields (if they apply)? (c) to which cache block will the memory reference db6316 map?
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
You know the right answer?
Write a program that deals random cards, printing the "rank" of the card and its "suit" (both random...
Questions
question
Biology, 06.10.2019 07:20
question
Mathematics, 06.10.2019 07:20
question
Chemistry, 06.10.2019 07:30
Questions on the website: 13722367