Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: Maximal Advertising Business is going well for your roommate, who is selling discounts to area clubs and restaurants, which means that business is going

Problem: Maximal Advertising

Business is going well for your roommate, who is selling discounts to area clubs and restaurants, which means that business is going well for you! Your program for keeping track of everyone's accounts is working perfectly.

Both of you have decided that you'll advertise on memory mall, which is roughly arranged as a rectangle. You've decided that there's not enough time before a football game to get to everyone arranged on the mall, but that you will only be able to walk through one "row" or "column" of the huge grid for advertising purposes.

Naturally, you'd like to hit as many people as possible as you make your single walk through. For this assignment you'll complete a program that reads in the number of people in each "cell" of memory mall, which is arranged like a 20 x 5 grid of cells, and determines the maximum number of people in any row or column of the grid.

For example, (this example is on a smaller grid to illustrate the idea), if the following was the input grid, where each number represents the number of people tailgating in that cell,

200 20 500 19 25 44 5 16
50 30 400 15 80 93 2 14
19 40 600 0 30 18 92 19

if we select the third column shaded blue, we would advertise to 1500 people. This is more than if we chose any of the other columns or rows.

Note: Since these numbers represent number of people in an area, it is guaranteed that all numbers for all input cases are non-negative.

Add your code in the designated area to the file marketing-scaffold.c.

After you add the correct code, if you run your program on the input file marketing.txt, your output should match the output in marketing.out.

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 Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

Is the page design inviting and accessible? (283)

Answered: 1 week ago