Author 
Message 
jeffrey p. war #1 / 15

Help...college student needs help w/cobol prgm.
HELP!!!!! I am a college student very new to programming. I have been working on a program that I have previouly written in C and now need to write in COBOL. The program is very simple and is 90% done but I cannot make it do an average of two values! Is there someone who might be willing to take a look at it and tell me why it is not working? I would be very greatful! Please email me if you would be good enough to look at it for me! Thank you!

Wed, 12 Dec 2001 03:00:00 GMT 


James J. Gava #2 / 15

Help...college student needs help w/cobol prgm.
Quote:
> HELP!!!!! > I am a college student very new to programming. I have been working on > a program that I have previouly written in C and now need to write in > COBOL. The program is very simple and is 90% done but I cannot make it > do an average of two values! > Is there someone who might be willing to take a look at it and tell me > why it is not working? I would be very greatful! > Please email me if you would be good enough to look at it for me! > Thank you!
How's about : add a to b giving c ( or add a, b giving c) divide c by 2 giving d OR compute average = ( a + b ) / 2

Thu, 13 Dec 2001 03:00:00 GMT 


JC #3 / 15

Help...college student needs help w/cobol prgm.
Quote:
>How's about : add a to b giving c > ( or add a, b giving c) > divide c by 2 giving d OR > compute average = ( a + b ) / 2
He's probably doing it in integer arithmetic & can't work out whi there's no fractional part to the average!!! John

Thu, 13 Dec 2001 03:00:00 GMT 


William M. Klei #4 / 15

Help...college student needs help w/cobol prgm.
Quote:
> > HELP!!!!! > > I am a college student very new to programming. I have been working on > > a program that I have previouly written in C and now need to write in > > COBOL. The program is very simple and is 90% done but I cannot make it > > do an average of two values! > > Is there someone who might be willing to take a look at it and tell me > > why it is not working? I would be very greatful! > > Please email me if you would be good enough to look at it for me! > > Thank you! > How's about : add a to b giving c > ( or add a, b giving c) > divide c by 2 giving d OR > compute average = ( a + b ) / 2
How about Compute averagevalue = Function Mean (a b) (which would also allow a and b to be values in a table  so you could expand the calculation to) Compute averagevalue = Function Mean (eachinputvalue (all))  Bill Klein wmklein <at> ix dot netcom dot com

Thu, 13 Dec 2001 03:00:00 GMT 


Jerry Peacoc #5 / 15

Help...college student needs help w/cobol prgm.
Quote: > Compute averagevalue = Function Mean (eachinputvalue (all))
Oops! Average isn't the Mean. Function Mean (1 2 99) is "2" and the average is "34".

Thu, 13 Dec 2001 03:00:00 GMT 


William M. Klei #6 / 15

Help...college student needs help w/cobol prgm.
Quote:
> > Compute averagevalue = Function Mean (eachinputvalue (all)) > Oops! Average isn't the Mean. Function Mean (1 2 99) is "2" and > the average is "34".
Maybe in mathematics (and/or statistics) the MEAN is not the "average" in this sense, but the following is (verbatim  from the draft of the next Standard  which does match the current Standard for this) what it says about FUNCTION MEAN: "The equivalent arithmetic expression shall be as follows: a) For one occurrence of argument1, (argument1) b) For two occurrences of argument1, ((argument1 sub1 + argument1 sub2 ) / 2) c) For n occurrences of argument1, ((argument1 sub1 + argument1sub2 +... + argument1 subn ) / n)" (I have used "sub1" "sub2" and "subn" where the text of the Standard uses subscript. Unfortunately, actual "subscripts"  of this type  don't show up well in NGs.) FYI, if you want a COBOL function that will return "2" from the list (1 2 99), then you need to use the FUNCTION MEDIAN.  Bill Klein wmklein <at> ix dot netcom dot com

Thu, 13 Dec 2001 03:00:00 GMT 


Leif Svalgaar #7 / 15

Help...college student needs help w/cobol prgm.
there is even something called the harmonic mean (also not supported by Cobol). It is the mean obtained by taking the reciprocal of the arithmetic mean of the reciprocals of a set of nonzero numbers.
Quote:
> Miller) illuminated comp.lang.cobol thusly:
> > +
> > + > > +> Compute averagevalue = Function Mean (eachinputvalue (all)) > > + > > +Oops! Average isn't the Mean. Function Mean (1 2 99) is "2" and > > +the average is "34". > > + > > Oops, yourself. 2 is the *median* of (1,2,99) and 34 is the mean. > > Average and mean are the same thing. > FYI, the Cobol function MEAN is the arithmetic mean, which is the same as > average. But there is another kind of mean, the geometric mean (which is > not provided by Cobol). The geometric mean of 1, 2, and 99 is > 5.828476683251. >  > R B \ Randall Bart, Pedant
> n r \ 16143089307 Please reply without spam I Love You > d t \ Have you solved http://users.aol.com/PanicYr00/Sequence.html ? > a / MS^7=6/28/107 Let's sing about the Year 2000 Bugs: > l \ http://users.aol.com/PanicYr00/SongMiscellany.html > l / Has anyone in Washington DC read the US Constitution?

Thu, 13 Dec 2001 03:00:00 GMT 


Doug Mill #8 / 15

Help...college student needs help w/cobol prgm.
+
+ +> Compute averagevalue = Function Mean (eachinputvalue (all)) + +Oops! Average isn't the Mean. Function Mean (1 2 99) is "2" and +the average is "34". + Oops, yourself. 2 is the *median* of (1,2,99) and 34 is the mean. Average and mean are the same thing.  dlmiller/at/netdirect/dot/net

Fri, 14 Dec 2001 03:00:00 GMT 


Randall Ba #9 / 15

Help...college student needs help w/cobol prgm.
Miller) illuminated comp.lang.cobol thusly: Quote:
> +
> + > +> Compute averagevalue = Function Mean (eachinputvalue (all)) > + > +Oops! Average isn't the Mean. Function Mean (1 2 99) is "2" and > +the average is "34". > + > Oops, yourself. 2 is the *median* of (1,2,99) and 34 is the mean. > Average and mean are the same thing.
FYI, the Cobol function MEAN is the arithmetic mean, which is the same as average. But there is another kind of mean, the geometric mean (which is not provided by Cobol). The geometric mean of 1, 2, and 99 is 5.828476683251.  R B \ Randall Bart, Pedant
n r \ 16143089307 Please reply without spam I Love You d t \ Have you solved http://users.aol.com/PanicYr00/Sequence.html ? a / MS^7=6/28/107 Let's sing about the Year 2000 Bugs: l \ http://users.aol.com/PanicYr00/SongMiscellany.html l / Has anyone in Washington DC read the US Constitution?

Fri, 14 Dec 2001 03:00:00 GMT 


Doug Mill #10 / 15

Help...college student needs help w/cobol prgm.
+there is even something called the harmonic mean (also not supported by +Cobol). +It is the mean obtained by taking the reciprocal of the arithmetic mean of +the +reciprocals of a set of nonzero numbers. The original post in this thread requested a method of calculating the average of a set of numbers. And in statistics the term "mean" is understood to refer to the arithmetic mean; "mean" by itself *never* refers to either the harmonic or the geometric mean. +
+> Miller) illuminated comp.lang.cobol thusly: +>
+> > +
+> > + +> > +> Compute averagevalue = Function Mean (eachinputvalue (all)) +> > + +> > +Oops! Average isn't the Mean. Function Mean (1 2 99) is "2" and +> > +the average is "34". +> > + +> > Oops, yourself. 2 is the *median* of (1,2,99) and 34 is the mean. +> > Average and mean are the same thing. +> +> FYI, the Cobol function MEAN is the arithmetic mean, which is the same as +> average. But there is another kind of mean, the geometric mean (which is +> not provided by Cobol). The geometric mean of 1, 2, and 99 is +> 5.828476683251. +>  +> R B \ Randall Bart, Pedant
+> n r \ 16143089307 Please reply without spam I Love You +> d t \ Have you solved http://users.aol.com/PanicYr00/Sequence.html ? +> a / MS^7=6/28/107 Let's sing about the Year 2000 Bugs: +> l \ http://users.aol.com/PanicYr00/SongMiscellany.html +> l / Has anyone in Washington DC read the US Constitution? + +  dlmiller/at/netdirect/dot/net

Fri, 14 Dec 2001 03:00:00 GMT 


Michael Mattia #11 / 15

Help...college student needs help w/cobol prgm.
Can you use this to double a recipe for a batch of cookies?  Michael Mattias Tal Systems Racine WI USA
Quote:
>there is even something called the harmonic mean (also not supported by >Cobol). >It is the mean obtained by taking the reciprocal of the arithmetic mean of >the reciprocals of a set of nonzero numbers.

Fri, 14 Dec 2001 03:00:00 GMT 


James J. Gava #12 / 15

Help...college student needs help w/cobol prgm.
Quote:
> Can you use this to double a recipe for a batch of cookies? > and others .......
You all got off on this one didn't you ? If Jeff is looking at your responses you've choked him to death with detail beyond his ken. My reply to him triggered him sending to me his DEC PC program, which was complete, and not a comeon where somebody wanted us to do his homework. Don't believe we should be poring over others code like a tutor  so rewrote it using NetExpress illustrating how to get the average. Agreed the average I gave wasn't to sufficient decimal places  but I doubt very much that's what his tutor was after. It's important I know, but so many of the messages in this forum get stuck in the nittygritty  all the poor kid wanted was help finishing off an assignment he had coded. Jimmy, Calgary AB

Fri, 14 Dec 2001 03:00:00 GMT 


Michael Mattia #13 / 15

Help...college student needs help w/cobol prgm.
I guess I am just amazed at the tangential directions and velocity prevalent in this NG. Heck, just saying "boo" can generate three weeks of passionate postings...  Michael Mattias Tal Systems Racine WI USA
Quote:
>You all got off on this one didn't you ? If Jeff is looking at your >responses you've choked him to death with detail beyond his ken.

Fri, 14 Dec 2001 03:00:00 GMT 


donald tee #14 / 15

Help...college student needs help w/cobol prgm.
Quote:
>You all got off on this one didn't you ? If Jeff is looking at your >responses you've choked him to death with detail beyond his ken. >My reply to him triggered him sending to me his DEC PC program, which >was complete, and not a comeon where somebody wanted us to do his >homework. Don't believe we should be poring over others code like a >tutor  so rewrote it using NetExpress illustrating how to get the >average. Agreed the average I gave wasn't to sufficient decimal places  >but I doubt very much that's what his tutor was after. >It's important I know, but so many of the messages in this forum get >stuck in the nittygritty  all the poor kid wanted was help finishing >off an assignment he had coded.
Poor kid? I sent him a complete example too ... written in Fujitsu. But like you, only after I saw his code. I also wrote him a page of tips about the code he had written. He did OK by the NG, whatever anyone thinks. <S>

Fri, 14 Dec 2001 03:00:00 GMT 


Thane Hubbe #15 / 15

Help...college student needs help w/cobol prgm.
On Mon, 28 Jun 1999 18:13:59 GMT, "Michael Mattias" Quote:
>I guess I am just amazed at the tangential directions and velocity >prevalent in this NG. >Heck, just saying "boo" can generate three weeks of passionate postings...
This is because COBOL programmers  especially those that frequent this group  have vast, and varied, experience as more than just programers. We are analysts. We analyze everything to death. Once a problem is dead, it's easy to code. All puns intended.

Sat, 15 Dec 2001 03:00:00 GMT 

