+ 2
Homework
The picture link is my homework from my professor at the university and I do not know how to solve the duty. All that is required is the work of the text to be answered, such as in the picture, and it must be solved because it has 5 marks - http://i.imgur.com/ynWRPL3.jpeg
22 Réponses
+ 9
It's not that difficult. No one here will write the complete code for you, we all have real lives and duties :P
But this will help you to get started:
First, how to create a matrix...
Second, how to create random int values...
Then you need to modify the values on certain conditions, that should be easy when you mastered the first two tasks.
Fourth, easy if you managed the third task, two simple nested for loops will do the trick.
Just post your code when you're stuck at any point and someone will help you.
https://code.sololearn.com/cYUipXJfwAbN/?ref=apphttps://code.sololearn.com/cU6QfO5ihO3Q/?ref=app
+ 6
You removed your old posts?
+ 6
Okay, fair enough :)
+ 6
Keep in mind plagarism is academic dishonesty, and could get you a failing grade or kicked out of university. You should not copy the solution Andrea gave.
+ 5
I'm not good in C++ but I'll try to find examples on the playground which you can use to get started.
+ 5
Rrestoring faith he should try to understand it...but if he is going to CTRLC CTRLV he won't go far away in life...programming is not copy & paste
+ 4
The instructions basically say to just iterate over each element. If an element is even, multiply it by 2. If an element is odd, multiply it by -1 (change its sign). After that, sum up each row for the answer.
For example, let's say one of your rows is [4, -1, 3]. 4 is even, so you multiply it by 2. That gives you 8. -1 is odd, so you multiply it by -1. That gives you 1. 3 is odd, so you multiply it by -1. That gives you -3. If you sum up "8 + 1 - 3", you will get 6.
You do that for each row. You can achieve this easily with a nested for-loop.
+ 2
You may want to look into using arrays and a few if statements here a link I just pulled from google on arrays also see the other stuff like working with for loops.
https://www.tutorialspoint.com/cprogramming/c_arrays.htm
may give you an idea
+ 2
Ahmad Nader I can tell that you are having some trouble with your assignment. What do you know how to do and we can go from there?
+ 2
Here it is
https://code.sololearn.com/cTQmWPF8OFFW/#cpp
+ 1
Hmm, Sorry I dont have any experience with c++. If only the question were in java
+ 1
Did you just change your profile pic xD? Also just letting you know this app can teach you c++
0
No
0
Yes, because you asked me to clarify what is required of the link, I did a new post , please if you can answer it answer it
0
You will answer it ?
0
Thank you , if you now someone good in c++ send it to him , please 😊🌸
0
All this I know It but this homework is difficult and too long and I don’t have enough time because I have exams
0
I don’t understand anything from these posts 😢
0
I just need someone answer the picture
0
Andrea Simone thank you very much 🌸