It is a C++ assignment. i wrote the program but it gives me error. please i need help to fix my following assignment. i posted the assignment too.


Here is code:
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int magic[3][3] = {{4, 9, 2}, {3, 5, 7}, {8, 1, 6}};
int sumRow, sumCol;
int diag1 = 0, diag2 = 0;
//
// ─────────────────────────────────────────────────────── CHECKING DIAGONALS ─────
//
for (int i = 0; i < 3; i++)
{
diag1 += magic[i][i];
diag2 += magic[i][2 - i];
}
if (diag1 != 15 || diag2 != 15)
{
cout << "Invalid Magic numbers\n";
exit(0);
}
//
// ────────────────────────────────────────────────── CHEKING ROW AND COLUMNS ─────
for (int i = 0; i < 3; i++)
{
sumRow = 0;
sumCol = 0;
for (int j = 0; j < 3; j++)
{
sumRow += magic[i][j];
sumCol += magic[j][i];
}
if (sumRow != 15 || sumCol != 15)
{
cout << "Invalid Magic numbers\n";
exit(0);
}
}
cout << "Valid magic numbers!\n";
}
Output:

It is a C++ assignment. i wrote the program but it gives me error. please i...
Can someone please help me to fix this APA citations format? I wrote this citation and my teacher commented "check APA for reference heading" Herzig, C. T., Stone, P. W., Castle, N., Pogorzelska-Maziarz, M., Larson, E. L., & Dick, A. W. (2016). Infection prevention and control programs in US nursing homes: results of a national survey. Journal of the American Medical Directors Association, 17(1), 85-88.
When I run my program it gives me these exceptions and I don't know what it means by it : Exception in thread "main" java.lang.NumberFormatException: For input string: "Code" Does anyone know what I need to change for this to work?
NEED SOME HELP WRITING THIS C++ PROGRAM...so far I wrote this program for (r-1; r <-5; r++) output for (r = 1; r<= 5; r++) output NEED HELP WITH THIS PATTERN:
This is my python assignment You wrote a program to prompt the user for hours and rate per hour to compute gross pay. Also your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours. Enter Hours: 45 Enter Rate: 10 Pay: 475.0 (475 = 40 * 10 + 5 * 15) Rewrite your pay program using try and except so that your program handles non-numeric input gracefully. Enter Hours: 20 Enter Rate:...
C Program Please include comments and reasoning for the error and why the fix works. Thank you The following function is supposed to return true if any element of the array a[] has the value 0 and false if all elements are nonzero. Sadly, it contains an error. Find the error and show how to fix it. boolean has_zero(int a[], int n) { int i; for (i = 0; i < n, i++) { return (a[i] == 0 ) ?...
Please help me I need someone to help me with this program in C# please Write a program named Admission for a college’s admissions office. The user enters a numeric high school grade point average (for example, 3.2) and an admission test score. Display the message Accept if the student meets either of the following requirements: A grade point average of 3.0 or higher, and an admission test score of at least 60 A grade point average of less than...
Please help me ead to toe assessement of a patient that as a Pancreatitis, i wrote"The expected finding during head to toe assessment in the patient are, vomiting, fever and rapid pulse, dry mucous membrane, rigid abdomen, tachycardia, hypotension, bruising in the flank and around the umbilicus" but my instroctor those not want that she want something from General Status Vital signs Head, Ears, Eyes, Nose, Throat Neck Respiratory Cardiac Abdomen Pulses Extremities Skin Neurological Please help as i do...
I am still struggling to do this assignment using c++ visual studios right now, i need help before the deadlineThe questions are in the google docs and I need help now because the due date was very soon at the 30th of November 2021 so I need help as soon as possible about the program on visual studios c++ and make the program quick before the due date right now.Now I got 11 people request to get the answer on...
Question: Please help me to correct answer , I don't understand.
This is my last chance. please help me. 1s...
Please help me to correct answer , I don't understand. This is
my last chance. please help me.
1st pic: qustion
2nd pic: professor said that fix it. (NEED
HELP)
3rd pic: what I answered... please help me. Thank you so
so s os o much!!!
I am not sure what teacher wants me to put separate.......
please help me.(...