# I need very fast help, like within the hour, please!

Show 50 post(s) from this thread on one page
Page 1 of 5 1234 ... Last
• January 16th, 2013, 07:04 AM
I need very fast help, like within the hour, please!
I need to make a programm (probably childs play to most of u)
But i have no clue how to do it, so please help, i need it done really fast.

The prgoramm is:
Write a programm in C++ that finds a matrixs A[4][7], then the sums (by adding them togeter) of all the positive elements of the numbers in the matrix from the third column and all the columns to the right of it(one sum for each column). And the shows it on the screen.

If anyone could quicky make me the programm i would be very greatfull.
It is a part of my homework that i have to send in with in the hour AT max 2 hours and i have no clue how to do that part. Really need help

Well i think i even got the matix down form this part, but i got no clue how to axess a column, so start multiplying them......

right now form this part this is what i manuaged to make, but.. i can only make it get some random diagonal? i got no idea how to get to a column and sum the numbers up there?

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

#define RIDU 4
#define VEERGE 7
#define MAX 150
#define MIN 10

int main (void)

{

int maatriks [RIDU] [VEERGE];
int i,j;

srand(time(NULL));

for(i=0; i<RIDU; i++)

{
for(j=0; j<VEERGE; j++)
{

maatriks[i][j]=rand()%(MAX-MIN)+MIN;
}
}

printf("Generated maatrx on:\n\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
printf("%4d", maatriks[i][j]);
}
printf("\n\n");
}

printf("third column?\n\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (i>=j) printf("%4d", maatriks[i][j]);
}
printf("\n");
}

return 0;
}
• January 16th, 2013, 07:37 AM
Philip Nicoletti
Re: I need very fast help, like within the hour, please!
The third column corresponds to j = 2

so there is no need to a a for loop with j in your code to print out the 3rd column.
• January 16th, 2013, 07:39 AM
Re: I need very fast help, like within the hour, please!
still dont understand how do i write a code that for example will that the third colum and sum up all the numbers there? Very greatfull for any help, i need to despretly get it done.
• January 16th, 2013, 07:53 AM
Re: I need very fast help, like within the hour, please!
With that i manuaged to get the last column of my matrix on the screen... (no clue how to generate anything in the middle on the screen alone), but how on earth can i get the programm to sum up all the numbers from that column now?

printf("Last column\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (j>5) printf("%4d", maatriks[i][j]);
}
printf("\n");
}
• January 16th, 2013, 08:00 AM
2kaud
Re: I need very fast help, like within the hour, please!
Please use the code tags when posting code so that it is easier to read and understand. Also you have posted to the wrong forum. This forum is regarding visual c++ programming where as your question relates to just c++ - which is for the 'c++ (non visual c++) forum'.
Also as your question relates directly to homework, I would suggest that you read the FAQ

http://forums.codeguru.com/showthrea...ork-assignment

I doubt that any member will write the code for you. I did for one query before and was politely rebuked by other members!

If you write the code yourself and then have a specific question about what you have written then you will probably receive help.

To quote from the above FAQ

Quote:

The very purpose of your homework is to verify that you have understood a subject and are able to apply the learned knowledge to solving specific problems. By having someone else do the assignment for you, you are not only cheating at your teachers, but also at yourself, since you pretend (and perhaps even believe) to have acquainted knowledge and skills that you actually don't have.
• January 16th, 2013, 08:03 AM
Re: I need very fast help, like within the hour, please!
i am not asking your to write my entire code i am asking for help how to get over obsicales, and this whole thing i asked is just a tiny bit of it, i dont have any clue how i can add up the column numbers.
And sry about the wrong place, i dont really know whats visual or none visual c++ coding.

Also i dunno where your from, but where i live it is perfectly fine to get your code done using internet and finding or getting help from anywhere. We can even do it on our programming exam.

Also, this is right now the last day i can do it, and i am NOT doing it at home, it is like an extra assigmnet to my homework, to get it done, i am in my class and my teacher is almost literally next to me, what our teacher says to that is basically " it dosnt matter if you KNOW how to do it right that second, what matters is that u can find out how from anywhere you like, and u will learn how to do it from that,
• January 16th, 2013, 08:10 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Quote:

i am not asking your to write my entire code i am asking for help how to get over obsicales, and this whole thing i asked is just a tiny bit of it, i dont have any clue how i can add up the column numbers.
And sry about the wrong place, i dont really know whats visual or none visual c++ coding.

Also i dunno where your from, but where i live it is perfectly fine to get your code done using internet and finding or getting help from anywhere. We can even do it on our programming exam.

The policy of this forum is not to write homework code for people. You don't learn anything by having somebody do your work for you, and where most of us are from, it would be regarded as cheating and dishonest.

To add all numbers in a column, you need a loop and a counter.
Initialize the counter to 0;
Write a loop incrementing from 0 through the number of rows - 1.
Use the incrementing variable for the to access the row of the matrix, and keep the column number constant.
Inside the loop, add the value found at the row and column of your matrix to your counter.
• January 16th, 2013, 08:11 AM
Philip Nicoletti
Re: I need very fast help, like within the hour, please!
Basically, you ignored what I said. To get a particular column, you do not need
to loop on j.

j = 0 ... gives the first column
j = 1 ... gives the second column

etc.

Code:

```j = 2; for(i=0; i<RIDU; i++) {   printf("%4d", maatriks[i][j]); } printf("\n");```
• January 16th, 2013, 08:13 AM
Re: I need very fast help, like within the hour, please!
not ignored, just coulnt understand....
• January 16th, 2013, 08:15 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Quote:

not ignored, just coulnt understand....

Replace j with a number. If you want the third column, maatriks[i][2]
• January 16th, 2013, 08:23 AM
Re: I need very fast help, like within the hour, please!
wow that was soo simple, cant imagine how basic my questions must look to you..... i was experimenting with massive ammounts of code to try to generate it somehow.

But how can i make 1 colum sum up all its numbers?
• January 16th, 2013, 08:24 AM
GCDEF
Re: I need very fast help, like within the hour, please!
• January 16th, 2013, 08:26 AM
Re: I need very fast help, like within the hour, please!
ouuuu

u mena this part

j = 2;
for(i=0; i<RIDU; i++)
{
printf("%4d", maatriks[i][j]);
}
printf("\n");
• January 16th, 2013, 08:27 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Quote:

ouuuu

u mena this part

j = 2;
for(i=0; i<RIDU; i++)
{
printf("%4d", maatriks[i][j]);
}
printf("\n");

http://forums.codeguru.com/showthrea...99#post2100899
• January 16th, 2013, 08:37 AM