Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!p7g2000pre.googlegroups.com!not-for-mail From: Chad Newsgroups: comp.lang.java.programmer Subject: Re: mod calculation Date: Sun, 13 Nov 2011 09:09:23 -0800 (PST) Organization: http://groups.google.com Lines: 66 Message-ID: <72e972d6-cb28-4e1c-93fb-cc58ee56673e@p7g2000pre.googlegroups.com> References: NNTP-Posting-Host: 66.81.213.208 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1321204163 24134 127.0.0.1 (13 Nov 2011 17:09:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 13 Nov 2011 17:09:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p7g2000pre.googlegroups.com; posting-host=66.81.213.208; posting-account=kTs1ygoAAACgG1TSoyECpovEyy-V6_8b User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2),gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9914 On Nov 13, 9:02=A0am, Patricia Shanahan 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 =3D (((data1%100)+1)<=3D50); > > serviceTime =3D (data2%5)+1); > > > where data1 and data2 are read from the file > > > I get the following by calculating anyNewArrival > > > 37259 ----> =A060 false > > 46363 -----> =A064 false > > 46161 -----> =A062 false > > 5693 ------>94 false > > 91459 ----> =A060 false > > 72792 ----->93 false > > 83603 ----->04 true > > 77842 ----->43 true > > 84792 ----->93 false > > 1299 178 ----> =A01000 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