You are part of a startup called ASCII-unlimited. You plan to dominate the market in character based graphics for gaming! Your team has identified a set of 13 fundamental operations that are likely to be useful for many of the games you ultimately produce. Accordingly, you are developing a library of C functions which implement these operations. For this assignment you will write these 13 functions. There are 11 functions operating on square dynamically allocated 2D arrays of characters and 2 operating on C strings. The table below lists the function prototypes and assigns each an estimated difficulty level on a scale of 1-3 (just for rough guidance -- you may or may not end up agreeing with the scores...) ESTIMATED DIFFICULTY (1-3). FUNCTION 1: less challenging 3: more challenging char ** alloc_square_mtx(int n); 1 void free_square_mtx (char **m, int n); 1 void pop_mtx_alpha(char **m, int n); 1 void display_mtx(char **m, int n); 1 void swap_rows (char **m, int rl, int r2, int n);

Question

Solve first 3 functions please protoypes are in the header.

You are part of a startup called ASCII-unlimited. You plan to dominate the market in character
based graphics for gaming! Your team has identified a set of 13 fundamental operations that are likely to
be useful for many of the games you ultimately produce. Accordingly, you are developing a library of C
functions which implement these operations.
For this assignment you will write these 13 functions. There are 11 functions operating on square
dynamically allocated 2D arrays of characters and 2 operating on C strings.
The table below lists the function prototypes and assigns each an estimated difficulty level on a scale of
1-3 (just for rough guidance -- you may or may not end up agreeing with the scores...)
ESTIMATED DIFFICULTY
(1-3).
FUNCTION
1: less challenging
3: more challenging
char ** alloc_square_mtx(int n);
1
void free_square_mtx(char **m, int n);
1
void pop_mtx_alpha (char **m, int n);
1
void display_mtx(char **m, int n);
1
void swap_rows (char **m, int rl, int r2, int n);
Expand
Transcribed Image Text

You are part of a startup called ASCII-unlimited. You plan to dominate the market in character based graphics for gaming! Your team has identified a set of 13 fundamental operations that are likely to be useful for many of the games you ultimately produce. Accordingly, you are developing a library of C functions which implement these operations. For this assignment you will write these 13 functions. There are 11 functions operating on square dynamically allocated 2D arrays of characters and 2 operating on C strings. The table below lists the function prototypes and assigns each an estimated difficulty level on a scale of 1-3 (just for rough guidance -- you may or may not end up agreeing with the scores...) ESTIMATED DIFFICULTY (1-3). FUNCTION 1: less challenging 3: more challenging char ** alloc_square_mtx(int n); 1 void free_square_mtx(char **m, int n); 1 void pop_mtx_alpha (char **m, int n); 1 void display_mtx(char **m, int n); 1 void swap_rows (char **m, int rl, int r2, int n);

/**
* Function: alloc_square_mtx
Description: Dynamically allocates a square nxn 2D
大
matrix of characters.
The individual matrix
elements need not be initialized.
The matrix is returned as a char **
Estimated Difficulty: LEVEL-1
*/
char ** alloc square_mtx(int n);
/**
* Function: free_square_mtx
Description:
deallocates all dyanamically allocated
大
オ
components of a matrix previously produced by
alloc_square_mtx.
大
大
* Estimated Difficulty:
* /
LEVEL-1
void free_square_mtx(char **m, int n);
/**
* Function: pop_mtx_alpha
* Description: populates square matrix of characters
with random, lower-case letters a..z
大
TIP: srand () and rand () might be handy
Estimated Difficulty: LEVEL-1
*/
void pop mtx alpha (char **m, int n);
/ **
* Function: display_mtx
* Description: prints given square matrix row-by-row (printing
a newline after each row).
大
大
* Estimated Difficulty: LEVEL-1
オ
* TIPS: putchar or the %c specifier in printf might be handy
Expand
Transcribed Image Text

/** * Function: alloc_square_mtx Description: Dynamically allocates a square nxn 2D 大 matrix of characters. The individual matrix elements need not be initialized. The matrix is returned as a char ** Estimated Difficulty: LEVEL-1 */ char ** alloc square_mtx(int n); /** * Function: free_square_mtx Description: deallocates all dyanamically allocated 大 オ components of a matrix previously produced by alloc_square_mtx. 大 大 * Estimated Difficulty: * / LEVEL-1 void free_square_mtx(char **m, int n); /** * Function: pop_mtx_alpha * Description: populates square matrix of characters with random, lower-case letters a..z 大 TIP: srand () and rand () might be handy Estimated Difficulty: LEVEL-1 */ void pop mtx alpha (char **m, int n); / ** * Function: display_mtx * Description: prints given square matrix row-by-row (printing a newline after each row). 大 大 * Estimated Difficulty: LEVEL-1 オ * TIPS: putchar or the %c specifier in printf might be handy

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Engineering

Programing

Related Computer Engineering Q&A

Find answers to questions asked by students like you.

Q: 8.1 LAB: Creating passwords (1) Prompt the user to enter two words and a number, storing each into s...

A: PROGRAM CODE:   color = input("Enter favorite color:\n")pet = input("Enter pet's name:\n")number = i...

Q: Nolan Corporation has outstanding convertible bonds with a face value of $15,000 and a current book ...

A: Under book value method of recording conversion of bonds into common stock takes into account book v...

Q: The triangle below is equilateral. Find the length of side xx in simplest radical form with a ration...

A: Click to see the answer

Q: 23. Use the tabulated half-cell potentials to calculate the equilibrium constant (K) for the follow...

A: Click to see the answer

Q: Which of the following statements regarding the income statement is true?a. The income statement pro...

A:       The financial statements of the business are prepared for presenting the results of operations...

Q: Paul's house 5 miles Clara's house 12 miles What is the shortest possible distance between the house...

A: Given data: The distance of Paul's house is a=5 miles. The distance of Clara's house is b=12 miles.

Q: A. Using the table above determine the value of G at 298K for the process represented by the equatio...

A: All the parts are answered below. 

Q: In addition to calculating specific heat capacities, some calorimeters can be used to determine how ...

A: A) The number of Joules in 1 calorie = 4.184 J.  

Q: The wildlife game commission poured 5 cans of fish (each can contained approximately 100 fish) into ...

A: We have to find the number of fish in the lake.

Q: Pedro is planning a campaign that involves using social media to build his company's brand equity. B...

A: 4 A Pedro is planning a campaigning that involves a social media, in order to build a  brand equity,...

Q: Draw the organic product of the Lewis acid-base reaction shown below. Include all lone pairs and cha...

A: The reaction taking place is given as,  

Q: Height of 10th grade boys is normally distributed with a mean of 63.5 in. and a standard deviation o...

A: Given height of 10th grade boys is normally distributed with a mean of 63.5 in. and a standard devia...

Q: 7. Tarzan prepares to swing and much to his dismay, gets his loincloth stuck on a branch. He's left ...

A: Here, we use the relation between weight and mass of a body to get the weight of Tarzan.

Q: Bonnie is making a dipping sauce. She mixes 150 milliliters of soy sauce with 100 milliliters of vin...

A: given : She mixes 150 millilitres of soy sauce with 100 millilitres of vinegar.

Q: The figure shows two disks anda flat ring, each with the same uniform charge Q. R 2R (a) (b) (c) Ran...

A: The value of the electric  field at the point P above the disc of radius R is defined as, E1=kσ2π1-z...

Q: Part a: The number of transistors per IC in 1972 seems to be about 4,000 (a rough estimate by eye). ...

A: Given that number of transistors /IC in 1972 seems to be about 4,000.  So we need to use Moore's law...

Q: Select the mixture which is capable of tolerating the addition of a strong acid without altering the...

A: Click to see the answer

Q: For the operation of part R-193, two operations are being considered. The capital investment associa...

A: Answer - Need to find- Assume an 8-hour work day. Further assume all parts produced can be sold. Sho...

Q: Danny spent a lot of time during COVID-19 recording the age of every professional wrestler. The data...

A: See the hand written solution

Q: During 2019, Rachael Parkins, president of Mathieson Company, was paid a semimonthly salary of $8,00...

A: Calculate the amount of FICA taxes that should be withheld from Person R. Particulars OASDI HI ...

Q: Classify each statement as an example of adhesion, cohesion, or surface tension. Drag each statement...

A: Cohesion is the condition of cohering or staying together of similar things. Cohesion may be seen in...

Q: Mary, Mack, and Martha are the investors in the start of the same business. Mary’s net worth is $750...

A: Solution- Mack may Invest his intended amount,but mary and martha may only invest $1 Million total.

Q: Fill in the following table with the quantity sold, the price buyers pay, and the price sellers rece...

A: Price elasticity of demand measures how the change in a product’s price affects its associated deman...

Q: Ulla Unigriffin DNA: | CAT AGG GAG | CAA GGG TGA CTT TTT | AAT AAT GAC GGG | MRNA: amino acids:

A: DNA and RNA are nucleic acids present in the organisms. DNA is the deoxy ribose nucleic acid whereas...

Q: Match each description to the correct level of protein structure. The complete three-dimensional con...

A: Protein structure is the ultimate confirmation that helps in the determination of the structural-fun...

Q: Roxanne Quimby met Burt Shavitz at his roadside honey stand in Maine. Twenty years later, a multimil...

A: In the given case Roxanne Quimby runs a company named as Burt Bee that is known for natural, earth f...

Q: Predict a possible phenotype from the following mutations in the Lac Operon: a deletion in “GGAATTGT...

A: The sequence given is the  DNA sequence of lac operator.

Q: Mátch éách đéfinitión to its appropriate concept. Definition Equality Efficiency When economic benef...

A: Click to see the answer

Q: ) Using rounding to the nearest 10, which number is the best estimate of 432 - 169? 370 360 260 270

A: First of all find the value of 432-169

Q: there are 6000 students at mountain high school and 3/4 of these students are seniors,if 2/3 of the ...

A: Click to see the answer

Q: The following table shows the daily receipts in millions of dollars of the movie "The Hunger Games" ...

A: Average Rate of change = change in receipt/change in days

Q: Nikita Enterprises has bonds on the market making annual payments, with eight years to maturity, a p...

A: Using excel PMT function Where NPER =  Year's to maturity PV = Price of bond FV = face value Rate = ...

Q: Propose an efficient synthesis for the following transformation: CI The transformation above can be ...

A: The alkyl chloride can be converted into alkene by the elimination reaction with a base. The alkene ...

Q: For each organic compound in the table below, enter the locant of the highlighted side chain. compou...

A: The locants in the above given molecules are,  

Q: community hospital in a rual community operates the ambulance service. the hospital purchases a new ...

A: Depreciation means reduction in value of asset over the useful life of the asset. This is done to al...

Q: Question The lengths of two sides of a triangle are 2x - 5 and x + 3. If the perimeter of the triang...

A: Click to see the answer

Q: If Congress wanted to help the economy out of a recession, they would be most likely to: check all t...

A: Recession refers to a phase of the downturn in the economic cycle when there is a fall in the countr...

Q: 55,000, average male's salary under 6 foot tall of $47,000, with a p-value of 0.45.  Based on that r...

A: Given: p-value=0.45 We usually take the significance level as 5%, i.e, 0.05. The decision rule state...

Q: What is the molarity of an HCl solution if 27.3 mL of it neutralizes 134.5 mL of 0.0165 M Ba(OH)2? (...

A: Given details, Volume of HCl = 27.3 mL = 0.0273 L Volume of Ba(OH)2 = 134.5 mL = 0.1345 L Molarity o...

Q: From the following list of selected items taken from the records of Rosewood Appliance Service as of...

A: Accounting's goals include keeping a systematic record of all financial transactions in a book of ac...

Q: equired information Skip to question [The following information applies to the questions displayed b...

A: The closing entries are prepared to close the temporary accounts of the business that can not be dir...

Q: Auden rolled two number cubes and recorded the results. What is the experimental probability that th...

A: Click to see the answer

Q: H. C C-0-H H. H. Identify and select all structures below that represent a constitutional isomer(s) ...

A: Constitutional isomers are those which are  compounds which are differ in the connectivity of atoms ...

Q: he following table lists several corporate bonds issued during a particular quarter. Company AT&T Ba...

A: Given that the bond value is $3000We know that I=PTR100 where P is Principal, T is time and R is Rat...

Q: The profit function for a microchip company selling z processors is P(x) = 20a - 15900. Each process...

A: The total cost incurred by a firm operating in a market includes fixed costs and variable costs. Fix...

Q: You decide to buy some stocks for a certain price and then sell them at another price. Write a progr...

A: Write a program that determines whether or not the transaction was profitable.  If your transaction ...

Q: Suppose Argentina produces only cars and trucks. The resources that are used in the production of th...

A: In Argentina, resources are not specified for producing a car and trucks it means there is an equal ...

Q: What do structuralism, Gestalt psychology, and Sigmund Freud all have in common? A)They were all co...

A: Sigmund Freud: Psychoanalysis is a school of thought given by Sigmund Freud. The therapy under psych...

Q: What series of reagents could be used to carry out the conversion shown? CI O C2/FeBr3; CH3CI/AICI3C...

A: The first step is electrophilic substitution reaction, in which meta - chloro product is formed.  In...

Q: Bobearns $60,000 a year at an accounting firm. Each year, he receives a raise. Bobhas determined tha...

A: Given: Bob earns $60,000 a year at an accounting firm. Each year, he receives a raise. Bob has deter...