Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

1. Read in a parameter value n which will indicate how many terms should be analyzed. This will be followed by n groups of data each containing information about 1 product. Each group of information will contain the name of the item and then 4 numbers indicating the profit (or loss) made on that item during the 4 quarterly reporting periods. For example, one data group could be: Diskettes 32 63 -12 84 or Printers -23 564 45 75

OpenStudy (farmdawgnation):

So, I'm not going to do your assignment for you - but if you have specific questions about the assignment, I will answer those for you.

OpenStudy (anonymous):

That's not nearly the whole assignment; that's one of 6 parts, plus I've got to make up all the data myself. What I need is guidance, yes, thank you very much. So n will be the number of products, each having its own set of data. I need you to fill in the gaps, basically. The data is to be read from an external file, so how do I do that? Then how do I print the data as it is read in, in the form of a table with one row for each item and one column for each reporting period?

OpenStudy (anonymous):

What's the programming language you're supposed to use? You'll likely want to put the data in a text file so you can easily read it from your program. You could use spaces to separate the individual pieces of data, as shown above. When reading the data, you're reading a text file, so the data is going to come in as strings that you can then readily print. I'd use a 2-dimensional array to store the data in when reading it - you could then store the data in the array in the same order as they're in the file, and simply iterate over the array with two nested loops to print it.

OpenStudy (anonymous):

C++ I guess. That's what I was going to do (read in from text file). Then the parameter value n should be read in from the beginning of the text file, right? I already wrote out the text file with the data separated as in the example...

OpenStudy (anonymous):

Here's the entire assignment http://www.webdeveloper.com/forum/showthread.php?p=1190886#post1190886

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!