Question: here is my code : def num _ tiles ( ) : tray _ width = float ( input ( What is the width
here is my code :
def numtiles:
traywidth floatinputWhat is the width of the tray?
trayheight floatinputWhat is the height of the tray?
tilewidth floatinputWhat is the width of the tile?
tileheight floatinputWhat is the height of the tile?
# Calculate the area of the tray and tile
trayarea traywidth trayheight
tilearea tilewidth tileheight
# Calculate number of tiles without rotation
tilesnorotation traywidth tilewidthtrayheight tileheight
# Calculate number of tiles with rotation
tileswithrotation traywidth tileheighttrayheight tilewidth
# Max number of tiles choosing between rotated and nonrotated arrangement
maxtiles intmaxtilesnorotation, tileswithrotation
# Calculate total area occupied by tiles
totaltilearea maxtiles tilearea
# Calculate unoccupied area in the tray
unoccupiedarea trayarea totaltilearea
# Output the results
printfThe tray has width roundtraywidth, and height roundtrayheight, and area roundtrayarea,
printfThe tiles have width roundtilewidth, and height roundtileheight, and area roundtilearea,
printfThe maximum number of tiles in the tray is maxtiles
printfThe total area of the tiles is roundtotaltilearea, and the unoccupied area in the tray is roundunoccupiedarea,
# Run the function
numtiles
I have been trying for hours and it hasnt been working what is the solution so that i can get the expected outputs in green and not get whats in red wrongWhat is the width of the tray?
What is the height of the tray?
What is the width of the tile?
What is the height of the tile?
The tray has width and height and area
The tiles have width and height and area
The maximum number of tiles in the tray is
The total area of the tiles is and the
unoccupied area in the tray is
The maximum number of tiles in the tray is
The total area of the tiles is and the
unoccupied area in the tray is What is the width of the tray?
What is the height of the tray?
What is the width of the tile?
What is the height of the tile?
The tray has width and height and area
The tiles have width and height and area
The maximum number of tiles in the tray is
The total area of the tiles is and the
unoccupied area in the tray is
The maximum number of tiles in the tray is
The total area of the tiles is and the
unoccupied area in the tray is
The picture is one example of the tests but do know that there are many hidden tests that i dont have acces to so please make it as robust as you possibly can...
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
