Your program will read the array

Assignment Help C/C++ Programming
Reference no: EM13166955

Write the pseudo code (algorithm) for the following program definition: a text file contains a square matrix of integer numbers. The file contains an integer number indicating the identical number of rows and columns followed by the data itself (that number cannot be larger than 100). For example a file contains a 3x3 matrix would contain 3 followed by 9 other integer numbers. The program will call one function to determine if all the numbers on the main diagonal are the same.

The function is called checkdiag(int checkdiag (int matrix[][100], int size)) that will return 1 if all the numbers on the main diagonal are the same and 0 otherwise.

Your program will read the array from the file, check the diagonal and print a report containing the size and the status of the diagonal. A typical report would look like: The matrix is 3x3 and all the numbers on the main diagonal are the same.

Part 2:

Write another function called checkdiag2(int checkdiag2(int matrix[][100], int size)) that will return 1 if all the numbers on the anti diagonal are the same and 0 otherwise.

Rewrite your main program to use 2D dynamic allocation instead for your arra. Your array will have rows and columns depending of the first integer read from the file.

Call your function from the main program. A typical report would look like: The matrix is 8x8 and all the numbers on the anti diagonal are the same.

Reference no: EM13166955

Questions Cloud

Write a program that has user enter : Write a program that has user enter a sentence and then determine how many lower case letter were entered. You need to write a logically coherent function that will determine if character is lower case or not. Main will also display the total?
The computerization of health records : A health care issue that has been in the news lately is the computerization of health records. This probability is being approached cautiously because of sensitive privacy and security concerns, among others.
Make an instance of romannumerals : Make an instance of RomanNumerals and invoke the method toRoman(int n). Enter a number in the Arabic notation and it will convert it to a Roman numeral. For example 17 will be converted to XVII.You will notice a test suite that we provide with the..
Calculate display the area of a rectangle (length * width) : Use the input.txt file. Have it read in the number of records to work on. Then for each record read in a character. If it is a C then read in a value and calculate and display the area of a circle (pi*r 2 ), a R then read in two values and calculate ..
Your program will read the array : Your program will read the array from the file, check the diagonal and print a report containing the size and the status of the diagonal. A typical report would look like: The matrix is 3x3 and all the numbers on the main diagonal are the same.
Create a data flow diagram : Create a data flow diagram for Online library management system. It should include search, hold, add items, issue, recall, and add user. It should support books, dvds, and cds. The flows should include each data element, the levels must be balance..
A local department store hires you to write : A local department store hires you to write an automated checkout program to expedite customers in a hurry. The checkout line can only accept five items for any one purchase. Design a program that asks for the price of each item, and then displays..
The conversion must be done in a function : The conversion must be done in a function. The function will accept the pressure in bars and return both atmospheres and psi. Your script should continue to prompt the user to see if they wish to another calculation.
Approximately normally distributed : Write a program MakeFile.cpp that creates a file random.dat that contains 200 random numbers where each number is the sum of 12 random values rand( )%9. When we add a sufficient number of uniformly distributed numbers the result is approximately n..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Accepts a pointer to a c-string as an argument

Write a function that accepts a pointer to a C-string as an argument and capitalizes the fist character of each sentence in the string. For instance, if the string argument is "hello

  Compares the number of possible sequences

A c++ program that compares the number of possible sequences of the length L that can be generated uinder the following assumptions. Given an alphabet of size N=9. The program must output a formatted list comparing the number of possible sequences..

  Program to produce ten random permutations of numbers

In C++(must be able to compile in Visual Studio ): Write a program to produce ten random permutations of numbers 1 to 10.

  Basics of code development on linux and cryptography

Prepare a C program that gives simple mono-alphabetic substitution between plaintext, and Enhance your code to use "-e" to encrypt a string argument and "-d" to decrypt it using argv and argc

  Design and write a c++11/fltk game program

The project is to design and write a C++11/FLTK game program with a graphical user interface. The game is based on "pancake sorting," which actually has some mathematical significance.

  Write a program to crypt its input accordingly

Write a program to crypt its input according to a specified transformation scheme

  Skills required by personnel working in information security

What skills are required by personnel working in information security? Write down some job titles in the field and come up with some required qualifications and some desirable qualifications.

  Give a recursive definition of s.

Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)

  Write c program which has parent process and child process

Write a C program that has a parent process, a child process, and a grandchild process. The parent process should print its id and the square or 5.

  Multiple choice question on c programming

Create a function to print "88 is a great port number" function name is yourName_PrintFunction no input no return type print "88 is a great port number"

  Write a program that plays a tic-tac-toe game.

Using functional decomposition, write a program that plays a tic-tac-toe game.

  Keep track of the size of the array

Keep track of the size of the array so that you cannot exceed the array boundaries. The implementation details (i.e. the private members)of your class are up to you, but the class should have the following public interface

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd