Fill This Form To Receive Instant Help
Homework answers / question archive / Please help me in this C++ Assignment
Please help me in this C++ Assignment. Use only functions, arrays, pointers, structures as such.
Inthis problem, you will write a function with two integer parameters, k and n, both positive integers with values >= 1. This function must print all possible ways in which the value k can be divided into n non-negative integer values. For example, if this function 1s called with values k = 2 andn = 3, then the unction must print all possible ways in which the value 2 can be divided into 3 non-negative integer values, as shown below. As you can see below, each line contains three (specified by assigning n = 3) non-negative integer values that add to 2 (specified by assigning k = 2). Also,
3
ae
note that, collectively, these lines include all possible ways in which value k = 2 can be divided
inton = 3 non-negative values.
002
O11
020
101
110
200
Additional example cases are provided in Table 2 ahead.
7) Given an NxN array, starting at array element (0, 0) shown in green, visit every tile, in the order shown. When visiting a tile, print its row number and column numbers, followed by endl.
While a 5x5 array 1s shown below, your program should work for an NxN array for any value of N.
Further, how would you generalize this for a non-square array, 1.e., for an MxN array where M # N?
Note: While this problem 1s about NxN arrays, the solution does not actually need to create this array!
C
O 1 2 3 4
01/7 |e |o “<|y
1 |v A re 7 r
)
r 2 A A 7 "A ‘y’
3 Ivy 7 iZ 7 Y
4 |a |> Al? |e