Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #9914
| From | Chad <cdalten@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: mod calculation |
| Date | 2011-11-13 09:09 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <72e972d6-cb28-4e1c-93fb-cc58ee56673e@p7g2000pre.googlegroups.com> (permalink) |
| References | <c884824e-9b4a-4df5-8d4a-3dddd6e41bea@d37g2000prg.googlegroups.com> <h7SdnWHCRqnZZSLTnZ2dnUVZ_qqdnZ2d@earthlink.com> |
On Nov 13, 9:02 am, Patricia Shanahan <p...@acm.org> wrote: > On 11/13/2011 8:20 AM, Chad wrote: > > > > > > > I'm working on a school project. Part of the requirement is to read in > > the following data file > > > 37259 9819 > > 46363 22666 > > 46161 79934 > > 5693 31416 > > 91459 8272 > > 72792 9493 > > 83603 8372 > > 77842 64629 > > 84792 747 > > 1299 178 > > > And then calculate anyNewArrival and serviceTime based on the > > following formulas... > > > //read data1 and data2 from the file > > anyNewArrival = (((data1%100)+1)<=50); > > serviceTime = (data2%5)+1); > > > where data1 and data2 are read from the file > > > I get the following by calculating anyNewArrival > > > 37259 ----> 60 false > > 46363 -----> 64 false > > 46161 -----> 62 false > > 5693 ------>94 false > > 91459 ----> 60 false > > 72792 ----->93 false > > 83603 ----->04 true > > 77842 ----->43 true > > 84792 ----->93 false > > 1299 178 ----> 1000 false > > > That means the only two arrivals should be > > > 83603 ----->04 true > > 77842 ----->43 true > > > However, according to the output he gave us in the class, the number > > of arrivals are 4. Ideas? > > This is the sort of thing you really need to discuss with your > instructor or TA. You may be misunderstanding something in the > assignment, or have the wrong data file, or ... > I thought I had the wrong data file, so I downloaded again. However, the numbers are the same. > There is something wrong with the last line of your output. > ((data1%100)+1) is not 1000, regardless of the value of data1. > > I was copying the results from the paper. that last line should be 100 false
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
mod calculation Chad <cdalten@gmail.com> - 2011-11-13 08:20 -0800
Re: mod calculation Roedy Green <see_website@mindprod.com.invalid> - 2011-11-13 08:56 -0800
Re: mod calculation Chad <cdalten@gmail.com> - 2011-11-13 09:26 -0800
Re: mod calculation Steve Sobol <sjsobol@JustThe.net> - 2011-11-13 13:08 -0800
Re: mod calculation Chad <cdalten@gmail.com> - 2011-11-13 13:12 -0800
Re: mod calculation Patricia Shanahan <pats@acm.org> - 2011-11-13 13:49 -0800
Re: mod calculation Patricia Shanahan <pats@acm.org> - 2011-11-13 09:02 -0800
Re: mod calculation Chad <cdalten@gmail.com> - 2011-11-13 09:09 -0800
Re: mod calculation Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-13 20:20 +0000
Re: mod calculation Roedy Green <see_website@mindprod.com.invalid> - 2011-11-14 09:55 -0800
Re: mod calculation Patricia Shanahan <pats@acm.org> - 2011-11-15 13:05 -0800
Re: mod calculation Gene Wirchenko <genew@ocis.net> - 2011-11-15 14:17 -0800
Re: mod calculation Roedy Green <see_website@mindprod.com.invalid> - 2011-11-17 07:23 -0800
Re: mod calculation Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-11-17 07:51 -0800
Re: mod calculation Lew <lewbloch@gmail.com> - 2011-11-17 09:35 -0800
Re: mod calculation Gene Wirchenko <genew@ocis.net> - 2011-11-17 10:10 -0800
Re: mod calculation Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-17 19:09 +0000
Re: mod calculation Patricia Shanahan <pats@acm.org> - 2011-11-17 14:17 -0800
Re: mod calculation Arne Vajhøj <arne@vajhoej.dk> - 2011-11-19 21:11 -0500
Re: mod calculation Roedy Green <see_website@mindprod.com.invalid> - 2011-11-18 20:35 -0800
Re: mod calculation Arne Vajhøj <arne@vajhoej.dk> - 2011-11-19 21:13 -0500
Re: mod calculation Gene Wirchenko <genew@ocis.net> - 2011-11-19 23:47 -0800
Re: mod calculation Roedy Green <see_website@mindprod.com.invalid> - 2011-11-18 20:54 -0800
Re: mod calculation Lew <lewbloch@gmail.com> - 2011-11-19 08:34 -0800
Re: mod calculation Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-19 21:16 +0000
Re: mod calculation Lew <lewbloch@gmail.com> - 2011-11-19 16:11 -0800
Re: mod calculation Arne Vajhøj <arne@vajhoej.dk> - 2011-11-19 21:13 -0500
Re: mod calculation Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-20 08:45 +0000
Re: mod calculation Lew <lewbloch@gmail.com> - 2011-11-20 08:12 -0800
Re: mod calculation Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-20 19:42 +0000
Re: mod calculation spk <jhic@speak.invalid> - 2011-11-20 23:18 -0400
Re: mod calculation thoolen <th00len@th0lenbot.thorium> - 2011-11-21 02:11 -0500
Re: mod calculation Roedy Green <see_website@mindprod.com.invalid> - 2011-11-19 13:40 -0800
csiph-web