Objectives By completing this a at you are demonstrating your ability to: • Decompose problems to create new solutions • Use variables and expressions to store and manipulate data • Use console input to take in data from a user • Create console output to report data to users Call functions Comment your code appropriately t requirements You are not allowed to use conditional statements, relational operators, and logical operators. You must solve this problem using arithmetic expressions. . You can make use of built-in Python functions. • The code must be properly commented, it will carry marks. Introduction Amxn LEGO baseplate is a collection of interconnected cells in a grid, where m is the number of rows and is the number of columns (m,n22). A baseplate has raised studs on the top. The classic LEGO bricks have raised studs on the top with tubes underneath to lock onto studs from other bricks or the baseplate. Though the LEGO bricks come in different sizes, in this assignment, we assume that all bricks have the same size. They will always have two rows (length is two). The number of columns (width) could be any number 21. The bricks are placed in a horizontal fashion i.e. a row must be full before moving to the next row. Also, a level should be full before a brick is placed on the next level (on top of the lower-level bricks) 2 Figure 1: A LEGO baseplate (Credit: LEGO) Figure 2: LEGO bricks (Credit: LEGO). Problem 1 Write a program in Python that performs the following tasks in order (sample output is shown in fig 3,4,5) 1. Takes the number of rows 'm' of the baseplate from the user 2. Takes the number of columns 'n' of the baseplate from the user. 3. Takes the number of columns 'y' of the brick from the user. 4. Prints the number of bricks that can be fixed on a given baseplate. In addition to the assignme requirements mentioned on page 1. you are not allowed to use Integer division (//). Enter the number of rows 'n' on the baseplate:5 Enter the number of cols 'n' on the baseplate:5 Enter the number of cols "y" on the brick:6 The maximum tiles that can be fixed on a 55 baseplate are: 0 Figure 3: Problem 1-sample run 1.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
ED
I
book title - as1.pdf
771
1 of 4
f Facebook
(198) YouTube
8 https://moodle31.upei.ca/pluginfile.php/902631/mod_resource/content/1/as1.pdf
*Objectives
By completing this assent you are demonstrating your ability to:
• Decompose problems to create new solutions
• Use variables and expressions to store and manipulate data
• Use console input to take in data from a user
• Create console output to report data to users
• Call functions
• Comment your code appropriately
Instagram
• You can make use of built-in Python functions.
• The code must be properly commented, it will carry marks.
+ 80%
nt requirements
• You are not allowed to use conditional statements, relational operators, and logical operators.
• You must solve this problem using arithmetic expressions.
Introduction
Am x n LEGO baseplate is a collection of interconnected cells in a grid, where m is the number of
rows and n is the number of columns (m, n > 2). A baseplate has raised studs on the top. The classic
LEGO bricks have raised studs on the top with tubes underneath to lock onto studs from other bricks
or the baseplate.
Though the LEGO bricks come in different sizes, in this assignment, we assume that all bricks
have the same size. They will always have two rows (length is two). The number of columns (width)
could be any number > 1. The bricks are placed in a horizontal fashion i.e. a row must be full before
moving to the next row. Also, a level should be full before a brick is placed on the next level (on top
of the lower-level bricks).
Home | bartleby
2
Figure 1: A LEGO baseplate (Credit: LEGO).
Figure 2: LEGO bricks (Credit: LEGO).
Problem 1
Write a program in Python that performs the following tasks in order (sample output is shown in figs.
3,4,5):
1. Takes the number of rows 'm' of the baseplate from the user.
2. Takes the number of columns 'n' of the baseplate from the user.
3. Takes the number of columns 'y' of the brick from the user.
CH
4. Prints the number of bricks that can be fixed on a given baseplate. In addition to the assignment
requirements mentioned on page 1, you are not allowed to use Integer division (//).
Enter the number of rows 'm' on the baseplate: 5
Enter the number of cols 'n' on the baseplate: 5
Enter the number of cols 'y' on the brick: 6
The maximum tiles that can be fixed on a 55 baseplate are: 0.
Figure 3: Problem 1 - sample run 1.
0
I 2
F
»
Transcribed Image Text:ED I book title - as1.pdf 771 1 of 4 f Facebook (198) YouTube 8 https://moodle31.upei.ca/pluginfile.php/902631/mod_resource/content/1/as1.pdf *Objectives By completing this assent you are demonstrating your ability to: • Decompose problems to create new solutions • Use variables and expressions to store and manipulate data • Use console input to take in data from a user • Create console output to report data to users • Call functions • Comment your code appropriately Instagram • You can make use of built-in Python functions. • The code must be properly commented, it will carry marks. + 80% nt requirements • You are not allowed to use conditional statements, relational operators, and logical operators. • You must solve this problem using arithmetic expressions. Introduction Am x n LEGO baseplate is a collection of interconnected cells in a grid, where m is the number of rows and n is the number of columns (m, n > 2). A baseplate has raised studs on the top. The classic LEGO bricks have raised studs on the top with tubes underneath to lock onto studs from other bricks or the baseplate. Though the LEGO bricks come in different sizes, in this assignment, we assume that all bricks have the same size. They will always have two rows (length is two). The number of columns (width) could be any number > 1. The bricks are placed in a horizontal fashion i.e. a row must be full before moving to the next row. Also, a level should be full before a brick is placed on the next level (on top of the lower-level bricks). Home | bartleby 2 Figure 1: A LEGO baseplate (Credit: LEGO). Figure 2: LEGO bricks (Credit: LEGO). Problem 1 Write a program in Python that performs the following tasks in order (sample output is shown in figs. 3,4,5): 1. Takes the number of rows 'm' of the baseplate from the user. 2. Takes the number of columns 'n' of the baseplate from the user. 3. Takes the number of columns 'y' of the brick from the user. CH 4. Prints the number of bricks that can be fixed on a given baseplate. In addition to the assignment requirements mentioned on page 1, you are not allowed to use Integer division (//). Enter the number of rows 'm' on the baseplate: 5 Enter the number of cols 'n' on the baseplate: 5 Enter the number of cols 'y' on the brick: 6 The maximum tiles that can be fixed on a 55 baseplate are: 0. Figure 3: Problem 1 - sample run 1. 0 I 2 F »
ED
I
book title - as1.pdf
S
+|||
TE
3 of 4
f Facebook
(198) YouTube
Instagram
https://moodle31.upei.ca/pluginfile.php/902631/mod_resource/content/1/as1.pdf
+ 80%
Enter the number of rows 'm' on the baseplate:4
Enter the number of cols 'n' on the baseplate:7
Enter the number of cols 'y' on the brick: 3
The maximum tiles that can be fixed on a 4 * 7 baseplate are: 4
Figure 4: Problem 1 - sample run 2.
Enter the number of rows 'm' on the baseplate: 5
Enter the number of cols 'n' on the baseplate: 6
Home | bartleby
Enter the number of cols 'y' on the brick:5
The maximum tiles that can be fixed on a 5* 6 baseplate are: 2
Figure 5: Problem 1 - sample run 3.
1. Takes the number of rows 'm' of the baseplate from the user.
2. Takes the number of columns 'n' of the baseplate from the user.
3. Takes the number of columns 'y' of the brick from the user.
4. Takes the total number of bricks 't_num' placed on the baseplate.
Problem 2
Write a program in Python that performs the following tasks in order (sample output is shown in
figs.):
Enter the number of rows 'm' on the baseplate: 5
Enter the number of cols 'n' on the baseplate: 6
5. Prints the number of bricks placed on the topmost level of the baseplate, assuming that all
lower levels were complete. A level is considered "complete" if it has the maximum possible
bricks.
3
Enter the number of cols 'y' on the brick:4
Enter the total number of bricks 't_num' placed on the baseplate:31
The number of bricks placed on the topmost level of the baseplate are: 1
Figure 6: Problem 2-sample run 1.
Enter the number of rows 'm' on the baseplate: 5
Enter the number of cols 'n' on the baseplate: 6
Enter the number of cols 'y' on the brick:4
Enter the total number of bricks 't_num' placed on the baseplate:30
The number of bricks placed on the topmost level of the baseplate are: 2
Figure 7: Problem 2 - sample run 2.
0
CH ΙΩ
F
»
Transcribed Image Text:ED I book title - as1.pdf S +||| TE 3 of 4 f Facebook (198) YouTube Instagram https://moodle31.upei.ca/pluginfile.php/902631/mod_resource/content/1/as1.pdf + 80% Enter the number of rows 'm' on the baseplate:4 Enter the number of cols 'n' on the baseplate:7 Enter the number of cols 'y' on the brick: 3 The maximum tiles that can be fixed on a 4 * 7 baseplate are: 4 Figure 4: Problem 1 - sample run 2. Enter the number of rows 'm' on the baseplate: 5 Enter the number of cols 'n' on the baseplate: 6 Home | bartleby Enter the number of cols 'y' on the brick:5 The maximum tiles that can be fixed on a 5* 6 baseplate are: 2 Figure 5: Problem 1 - sample run 3. 1. Takes the number of rows 'm' of the baseplate from the user. 2. Takes the number of columns 'n' of the baseplate from the user. 3. Takes the number of columns 'y' of the brick from the user. 4. Takes the total number of bricks 't_num' placed on the baseplate. Problem 2 Write a program in Python that performs the following tasks in order (sample output is shown in figs.): Enter the number of rows 'm' on the baseplate: 5 Enter the number of cols 'n' on the baseplate: 6 5. Prints the number of bricks placed on the topmost level of the baseplate, assuming that all lower levels were complete. A level is considered "complete" if it has the maximum possible bricks. 3 Enter the number of cols 'y' on the brick:4 Enter the total number of bricks 't_num' placed on the baseplate:31 The number of bricks placed on the topmost level of the baseplate are: 1 Figure 6: Problem 2-sample run 1. Enter the number of rows 'm' on the baseplate: 5 Enter the number of cols 'n' on the baseplate: 6 Enter the number of cols 'y' on the brick:4 Enter the total number of bricks 't_num' placed on the baseplate:30 The number of bricks placed on the topmost level of the baseplate are: 2 Figure 7: Problem 2 - sample run 2. 0 CH ΙΩ F »
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY