C LANGUAGE!!!
The program uses both files and two dimensional arrays.
The Problem Statement
Business is going well for your friend, who is selling discounts to area clubs and restaurants, which means that business is going well for you!
Both of you have decided that you'll advertise on memory mall, which is roughly arranged as a rectangle. There's not enough time before a football game to hand flyers to everyone arranged on the mall. Therefore, you will only be able to walk through one "row" or "column" of the huge grid for advertising purposes.
Naturally, you'd like to give flyers to as many people as possible as you make your single walk through.
Program Setup
A scaffold of the solution has been created for you: marketing-scaffold.c
Place your solution in the designated area of the scaffold.
Memory mall is arranged like a 20 x 5 grid of tailgating locations. A representation of memory mall has been created using a two dimensional array. You will need to read from a file the number of people in each section or "cell" of memory mall. Then, you should determine which row or column of the grid has the most number of people in it.
Since these numbers represent the number of people in an area, it is guaranteed that all numbers for all input cases are non-negative.
Example
This example is on a smaller grid to illustrate the idea. Suppose the following is our input grid.
200 20 500 19 25 44 5 16 50 30 400 15 80 93 2 14 19 40 600 0 30 18 92 19
Each number represents the number of people tailgating in that cell. 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.
Input File Format
The first line of the input file contains a single positive integer, n (n ≤ 1000), representing the number of grids to process.
This is followed by n 5x20 grids of integers.
Sample Run
After you add your code to designated location in the scaffold, run your program using the input file marketing.txt. Your output should match the output in marketing.out.
marketing.txtPreview the document marketing.out .out and .txt are unformatted files that can be opened with most text editors. Code::Blocks can also create and read files of these types.
This question has been already answered.
you can find it here:
https://www.HomeworkLib.com/homework-help/questions-and-answers/c-programming-program-uses-files-two-dimensional-arrays-problem-statement-business-going-w-q11066799
C LANGUAGE!!! The program uses both files and two dimensional arrays. The Problem Statement Business is...
Program in C++
Implement Conway's Game of Life using 2-dimensional arrays. All the tips, tricks, techniques we have been using in class are allowed. Nothing else. The program should read the initial state of the board by reading in "alive" cells from a user input data file. Meaning your program should ask the user the name of the data file. Assume all the other cells are "dead." Make sure to use modular coding techniques. The main program should be pretty...
Write a C++ program that uses a two dimensional array to display a table of probabilities for a pair of rolling dice. Your custom assigned range of values of each die are: 5 up to and including 10. Section 1 of Program - Specifications: The top row of the table, left to right, and the left column of the array, top to bottom, must contain the assigned range of values displayed on each of the die in ascending order populated...
IN C#.Develop a program that prints out the location of the largest value in a two-dimensional array. The largest values may appear more than once in the array, so you must only print out the first instance. The program defines method locateLargest() that takes a two-dimensional array of integers and returns the location (row index and column index) of the first largest value as a single-dimensional array. The program main method prompts the user to enter a 3-by-4 matrix, prints...
Program in C++! Thank you in advance! Write a menu based program implementing the following functions: (1) Write a function that prompts the user for the name of a file to output as a text file that will hold a two dimensional array of the long double data type. Have the user specify the number of rows and the number of columns for the two dimensional array. Have the user enter the values for each row and column element in...
C++ Program - Arrays- Include the following header files in your program: string, iomanip, iostream Suggestion: code steps 1 thru 4 then test then add requirement 5, then test, then add 6, then test etc. Add comments to display assignment //step 1., //step 2. etc. This program is to have no programer created functions. Just do everything in main and make sure you comment each step. Create a program which has: 1. The following arrays created: a. an array...
Concepts tested by the program:
Working with one dimensional parallel arrays
Use of functions
Use of loops and conditional statements
Description
The Lo Shu Magic Square is a grid with 3 rows and 3 columns
shown below.
The Lo Shu Magic Square has the following properties:
The grid contains the numbers 1 – 9 exactly
The sum of each row, each column and each diagonal all add up
to the same number.
s is shown below:
Write a program that...
Write a JAVA program to solve a sudoku! Given a partially filled 9×9 2D array ‘grid[9][9]’, the goal is to assign digits (from 1 to 9) to the empty cells so that every row, column, and subgrid of size 3×3 contains exactly one instance of the digits from 1 to 9. I have posted 3 input files: sudoku1.txt, sudoku2.txt and sudoku3.txt Problem Analysis & Design - Think about how you will need to solve this problem. You should do an...
C++ Lab 11 – Is This Box a Magic Box? Objectives: Define a two dimensional array Understand how to traverse a two dimensional array Code and run a program that processes a two dimensional array Instructions: A magic square is a matrix (two dimensional arrays) in which the sum of each row, sum of each column, sum of the main diagonal, and sum of the reverse diagonal are all the same value. You are to code a program to determine...
Part 2) write a C++ program that declares a 2 dimensional array: int CSIIAssign3 [10][12]; Initialize your array using a text file, user input or assign value while declaring the array, you can choose the method. Then, a. Write a loop to print first row of the array on one line, using cout. b. Write a loop to print first column of the array on one line, using cout. c. Write a loop to print first five rows of the...
In this assignment, you will write a program in C++ which uses files and nested loops to create a file from the quiz grades entered by the user, then reads the grades from the file and calculates each student’s average grade and the average quiz grade for the class. Each student takes 6 quizzes (unknown number of students). Use a nested loop to write each student’s quiz grades to a file. Then read the data from the file in order...