Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be in Python(please have a screen shot on these solution code) ** 1 1.1 1 (Game: nine heads and tails) Nine coins are placed

Must be in Python(please have a screen shot on these solution code)image text in transcribed

** 1 1.1 1 (Game: nine heads and tails) Nine coins are placed in a 3 3 matrix with some face up and some face down. You can represent the state of the coins with the val- ues 0 (heads) and 1 (tails). Here are some examples 0 0 0 101 110 0100 01 100 11 0 1 11 000 10 0 001 10 0 10 1 1 0 0 1 1 0 Each state can also be represented using a binary number. For example, the pre- ceding matrices correspond to the numbers There are a total of 512 possibilities. So, you can use the decimal numbers 0, 1, 2, 3, ., and 511 to represent all states of the matrix. Write a program that prompts the user to enter a number between 0 and 511 and displays the corresponding 3 3 matrix with the characters H and T. Here is a sample run Enter a number between0 and 511:7 Enter The user entered 7, which corresponds to 000000111. Since 0 stands for H and 1 for T, the output is correct *11.13 (Locate the largest element) Write the following function that returns the location of the largest element in a two-dimensional list: def locateLargest(a): The return value is a one-dimensional list that contains two elements. These two elements indicate the row and column indexes of the largest element in the two-dimensional list. Write a test program that prompts the user to enter a two- dimensional list and displays the location of the largest element in the list. Here is a sample run: Enter the number of rows in the list: 3 Enter Enter a row: 23.5 35 2 10 Enter Enter a row: 4.5 3 45 3.5 -Enter Enter a row: 35 44 5.5 11.6 I-Enter The location of the largest element is at (1, 2)

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

3. Describe the strategic training and development process.

Answered: 1 week ago

Question

10. Microsoft Corporation

Answered: 1 week ago