Question

-Create an 2D array that is 12 rows and 15 columns
-Populate each element with random upper-case character & display to screen in programmer created function called function_1
-Traverse array to find horizontal pairs of characters in a programmer created function called function 2
-Traverse array to find vertical pairs of characters in a programmer created function called function3
-Display to the screen the number of horizon pairs and the number of vertical pairs in programmer created function called function 4
-Do not use strings
-Specify second dimension of a 2D array in the prototype and declaration header of any function in that passes a 2D array by address/reference
-Three identical characters in a row should be counted as 2 pairs
-Four identical characters in a row should be counted as 3 pairs, etc

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

#include <stdio.h>
#include <stdlib.h>

#define ROWS 12
#define COLS 15

void function1(char data[][COLS]);    //Function prototypes
int function2(char data[][COLS]);
int function3(char data[][COLS]);
void function4(int horiz, int vert);

int main()
{
    char data[ROWS][COLS];    //Declaration of array

    function1(data);    //Call First fucntion
    function4(function2(data), function3(data));    //Call function 4 with function2 and 3 being called within

    return 0;
}...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Related Homework Solutions

C++: Poker Hand
Homework Solution
$15.00
C++
Computer
Science
Poker
Straight
Flush
Four
Kind
Full
House
Three
Two
Pairs
High
Card
Do-While Loop For a Ticket-Taker Problem
Homework Solution
$15.00
Programming
Computer Science
C++
Ticket-Taker
Prices
Do-While Loop
Discounts
Children
Constant Values
Integers
Sales
Messages
Input
Output
Coding Using Pipes
Homework Solution
$30.00
Computer Science
Programming
Algorithms
Pipes
File Management
Command Line
Communication
Utility Program
Display Results
Numbers
Input
Output
Characters
Errors
C++ Classes For Card Game
Homework Solution
$20.00
Programming
C++
Computer Science
Coding
Classes
OOP
Functions
Methods
Variables
Statements
Constructor
Random Numbers
Inheritance
Card Games
Get help from a qualified tutor
Live Chats