Please help with this code and make sure to create in c++. Make sure it is 100% correct and works on Visual studios. Thxs. Write the code as described in the questions below. Submit your code electronically in the box at the bottom. You may only use Java, C# or C++. The economy is defined using a 2-dimensional data structure: A “payday” will be considered to be any region of $ values where all cells in the region are connected either vertically or horizontally. For example, the following illustrates a matrix with 5 rows and 8 columns containing three objects. $’s and P are used in the diagram to represent the two types of values: PPPP$PPPPPP$$PPPPP$$PPP$PP$PPPP$P$PPP$$$ a) Write a program to read in the data from the text file and store it into a data structure. Your program should output it to the screen after it has read in the file. (If you can’t get this to work hard-code the above example and continue to part b). Here is a sample text file (containing the above data): Payday.txt. b) Write a function CountTotalMoney() which will return an integer describing the number of “$”s in the economy matrix. b) Write a function CountMoneyPotSize (dataStructure M, int startRow, int startCol) with the following post condition: /* Post: The number of cells in the payday (if any) which has a cell at location startRow, startCol returned */ For example, a call to CountMoneyPotSize(M, 0, 4); --where M is the matrix (whatever data structure you used), and 0, 4 is the startRow and startCol-- would return 6 because there are 6 cells making up the payday which has a cell at 0, 4. Note that the “$” value at location (4, 1) is not counted since it only touched the payday via a diagonal.
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
Please help with this code and make sure to create in c++. Make sure it is 100% correct and works on Visual studios. Thxs.
Write the code as described in the questions below. Submit your code electronically in the box at the bottom. You may only use Java, C# or C++.
The economy is defined using a 2-dimensional data structure:
A “payday” will be considered to be any region of $ values where all cells in the region are connected either vertically or horizontally. For example, the following illustrates a matrix with 5 rows and 8 columns containing three objects. $’s and P are used in the diagram to represent the two types of values:
PPPP$PPPPPP$$PPPPP$$PPP$PP$PPPP$P$PPP$$$
a) Write a program to read in the data from the text file and store it into a data structure. Your program should output it to the screen after it has read in the file. (If you can’t get this to work hard-code the above example and continue to part b). Here is a sample text file (containing the above data): Payday.txt.
b) Write a function CountTotalMoney() which will return an integer describing the number of “$”s in the economy matrix.
b) Write a function CountMoneyPotSize (dataStructure M, int startRow, int startCol) with the following post condition:
/* Post: The number of cells in the payday (if any) which has
a cell at location startRow, startCol returned */
For example, a call to CountMoneyPotSize(M, 0, 4); --where M is the matrix (whatever data structure you used), and 0, 4 is the startRow and startCol-- would return 6 because there are 6 cells making up the payday which has a cell at 0, 4.
Note that the “$” value at location (4, 1) is not counted since it only touched the payday via a diagonal.

Step by step
Solved in 5 steps with 4 images









