I really need your help with C++ task.

I am really new into this and I still have no idea what to do.
Can someone please help me with 3 task from school?

Task 1.
Write a program that input a two-dimensional matrix A (M,K) - (M<=50), (K<=50).
Write a program that replaces the values of the elements of the row, in which there is the minimum element with value 100, and the values of the elements of the column in which there is the maximum element with value 10. Output the final matrix by rows.


Task 2.
Input K real number in the vector A(К) (К<= 50) .
You have to get and output the B(K) numbers if:

B(i)=(A(i-1)^2 - 2A(i) + А(i+1)^2) / (А(i-1) - A(i+1)), if A(i) > 0,
B(i)=0, if A(i) = 0,
B(i)=(A(i-1)^2 - 2A(i) + А(i+1)^2) / (А(i+1) - A(i-1)), if A(i) < 0



Task 3.
Declare a massif with stores (50 in number) where every stores contains information for estates in NY city and has the following fields:
- mode ( up to 20 symbols)
- region ( 10 symbols)
- area ( integer )
- price ( real number)
- telephone ( up to 10 symbols)
- address of the owner ( up to 30 symbols)
From the keyboard input the data for the T estate.
Print all the information for the estates from residential district New York with price under 50 000 euro.

I will be very thankful.
closed account (48T7M4Gy)
Would that be a triple do my homework request by any chance?
Last edited on
Sorry, Did not understand what you said..
closed account (48T7M4Gy)
No need to apologize.

The point is this is not a homework site so we don't do your work for you.

We operate on the basis that if you have tried to do the exercise(s) and demonstrate that by posting your work (defects and all) then you have a very good chance of getting a lot of help. So far you'll get none simply because asking for help, is a necessary but not sufficient condition of engagement.

I hope this is not the case, but if you have absolutely no idea how or where to start or even understand a smidgin of the exercise description so that you can make an attempt then maybe you aren't yet ready to take up a computing course that puts these sort of demands on your learning experience so far.

If you still have trouble understanding me and can't or won't submit your attempts then please refer this post back to your teacher/professor. He/she will be able to explain in greater detail to remove any misunderstanding.

Cheers :)
Oh, i understand. Thank you for your comprehensive answer. I will start writing the task. And these days I will give you some tries :D

Thank you again!
closed account (48T7M4Gy)
Excellent Danna, you're a champion. Come back as you see fit. Help is here for triers :)
Okay.. I tried to write Task 2.

#include <iostream>
#include <vector>
using namespace std;

int main()
{
int v[K<=50];
if B(i)=(A(i-1)^2-2A(i)+А(i+1)^2)/(А(i-1)-A(i+1));
A(i) > 0; else
if B(i)=0;
A(i) = 0; else
if B(i)=(A(i-1)^2-2A(i)+А(i+1)^2)/(А(i+1)-A(i-1));
if A(i) < 0' else
cout << a < endl;
}
return 0;
}

But it marks that this line: if B(i)=(A(i-1)^2-2A(i)+А(i+1)^2)/(А(i-1)-A(i+1));
is wrong.. Where am I wrong?
closed account (48T7M4Gy)
Where am I wrong?


Well Danna, I'd suggest you have a face to face with your teacher/professor/tutor/mentor/counsellor if you have one. The solution to your question is not provided via compiler messages and help from anyone here. I'd make an appointment as soon as possible.

All the best :)
Danna,

The "^" is not an exponent or power function. Instead use A(i-1) * A(i-1).

As you get further into C++ you will learn about pow(), but A*A is good enough for your needs here.

Last edited on
Topic archived. No new replies allowed.