Hey. Thank you so much, you've been very helpful. That wan instantaneous fix.
The Matrix works fine. But Still don't know how to deal with CMD arguments (Error handling Section) and Finding the largest product. It's like I know what to do but I don't know how to express it. Basically what I'm trying to say is that I went over all the posts you sent me. Tried to do functions on my own. But it is intimidating
Can you please help me with those two functions. This homework assignment is due tomorrow and I'm overwhelmed.
You already have a function that creates an array. You just need to modify it to return the array, so that main can use the array whenever main needs to call other functions. Earlier I suggested doing something like making a function that can print the array. I shall give you an example here. Give me about an hour to get it ready, because I am about to eat dinner.
I have pasted something I did several years ago in an introductory class that shows how to read an array in one function and then print it in another.
The same technique can be used in your program, but with an added function that can find the largest product of adjacent entries in an array. http://pastebin.com/xi1reeyd
#include <stdlib.h>
int main(int argc, char * argv[])
{
//check to see that argc is correct
//if it is not correct, print error and return 0
//if it is correct then you would need to check each string from argv
//argv[0] is the name of the command typed
//argv[1] is the first argument
//argv[2] is the second argument
//argv[3] is the third argument... etc.
return 0;
}
So if you were to type: int kappa = atoi(argv[2]);
That would take the second argument and convert it to an integer and store it to a variable called kappa.
Hey thank you. but I have a hard time writing the conditions (for the commented lines) I know what to print out but how do I use if else statements? I mean how do i write the conditions in C++. that is the major problem I have. Not knowing how to write. I'm really sorry for all this trouble.
I've got an exam tomorrow and also this is due tomorrow. Can you write the actual code for me?
Maybe you could check out the tutorial. I suggest paying closer attention in lecture and reading all the assigned reading in the course. Read extra if you have to until you understand it. There are several C++ tutorials on the Internet. http://www.cplusplus.com/doc/tutorial/
If I was to simply write the code for you I would be depriving you of learning this.
Hey, I'd really love to learn these stuff by myself and actually understand them. But the problem is I have very limited time to finish this and prepare for my test tomorrow.
I totally understand where you're coming from and really do appreciate that you think that way. I know this is asking too much, but as of now I really don't have any other choice.
If you have time please help me out with the code?? I really don't want to get a low grade.
Summer classes are fast paced. Welcome to university level. I highly recommend reading more of the course material or tutorials before typing any more programs. I wish you luck on your exam tomorrow. Try to get a good night sleep. Maybe your professor will be generous enough to accept a late submission? I recommend visiting either the professor or one of the TAs as soon as you have trouble on the next assignment. When you have no code at all and are completely lost, they have the ability to sit with you in person and explain things really well. This forum on the other hand is for help with any problems that can be stated as specific questions. Anyway, I do wish you luck in your studies.
I initially posted this on Friday and the homework was actually assigned on Thursday.
Posting your assignment with no attempt to even start it is not likely to garner help. 3 days later, you worked up 20ish lines of code. Still, not showing much effort.
When I said "You could've worked on it when you still had time to do it" the emphasis should've been: "You could've worked on it when you still had time to do it."
"I asked for someone else to supply with me with code a week ago" is not work.
it is not about creating the array. Array works fine. I need help with linking finding_greatest_production function to create_array function. greatest product function is supposed to find the largest product of any four adjacent numbers in the array. That's what I need help with.
You don't create proper array; your create_array() does have a local variable, but you cannot use that anywhere else because it is destroyed when the function call ends.
In other words: your Array does not "work fine" -- it does not do what it is supposed to do.