Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a VBA code that calculates the total area of the rectangles that can be created with neighbour x ' s in a given 4

Write a VBA code that calculates the total area of the rectangles that can be
created with neighbour x's in a given 44 square matrix including x's and
O's.
4 x 4 square matrix will include only X's and O's in an Excel sheet starting
from A1.
Example:
When clicked on calculate button, message box should show 48.
Details of the solution is listed below:
The rectangles with a single square: A1, D1, B2, D2, A3, B3, C3, D3, B4, C4
Total area: 10
The rectangles with 2 squares: A3B3, B3C3, C3D3, B4C4, B2B3, B3B4,
C3C4, D1D2, D2D3
Total area: 18
The rectangles with 3 squares: A3B3C3, B3C3D3, B2B3B4, D1D2D3
Total area: 12
The rectangles with 4 squares: A3B3C3D3, B3C3B4C4
Total area: 8
Notes:
I will test your code with at least 10 different input sets.
A single square is also a rectangle.
Both width and length of the rectangle can be greater than 1 unit.
Please show your answer in a message box.
image text in transcribed

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

=+b) Is MediaChips manufacturing process in control?

Answered: 1 week ago