Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework 4 (Programming portion) Due Date: Monday, October 4th, 1:45pm You will need to make two submissions for this homework. The written assignment is detailed

image text in transcribed
Homework 4 (Programming portion) Due Date: Monday, October 4th, 1:45pm You will need to make two submissions for this homework. The written assignment is detailed in a different le. Background Congratulations! You've obtained an internship position working with Master Chef Aaron at the Foo Bar. This worldrenowned restaurant serves a high-class appetizer: the Tofu Fighter. What makes this cube-shaped tofu so special is that it is homogeneous, so it has 100% texture consistency. Description Preparing the Tofu Fighter by hand takes a very long time due to the fact that it must have perfect consistency, so Master Chef Aaron has asked you to write a program that can help the cooks make Tofu Fighter quickly. For tofu to be homogeneous, the density must be constant at all points. The kitchen has a Density Perception (DP) device which can scan an object and nd the density at each location, represented by the 3D matrix of. Aaron wants you to write an algorithm to identify the volume of the largest homogeneous cube located in an r by c by t non-homogenous tofu block. I / 0 Format The 1/0 part of the program is given and you shouldn't modify it. It parses layer by layer, reading as if 2D maps were stacked on top of each other. Run your program in the command line and input three integers r, c, 1 followed by the level-by- level maps of your space. Your program should output one single integer indicating the answer. Extra outputs will result in a score of 0. Implementation Details You're required to implement a singlele, dynamic programming solution using C++ based on the skeleton code provided on Blackboard. It will be compiled with C++11 standard: g++ DP.cpp o dp std=c++11 1. Fill out name, ID number, username, and Email elds in the .cpp le correctly. 2. Finish the following function: int solve(int r, int c, int. 1, int*** d) This function receives four parameters r, c, I, d, as described in problem description, and it should return the volume of the largest homogeneous cubic space. 3. Make sure to comment out your extraneous code before submitting. 4. You should submit your completed .cpp le through Blackboard

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions