I have most of the code for this program but I was looking for help on the rest
ID: 3631739 • Letter: I
Question
I have most of the code for this program but I was looking for help on the rest of these methods for a few classes. The program I am working on is a simulation for wait times in a line.
USE THE CODE I HAVE PROVIDED. Just fill in the empty methods. I'm also getting errors for WaitingCustomerQueue (the methods are finished but I get errors on lines 34, 38, 46)
If you need to see all my code for the whole program it is posted here on pastebin: http://pastebin.com/k1XMXkGT
---------------------------------------------------------------------------------
Explanation / Answer
/* prime2.C only worked for primes less than 10. An undetected overflow caused the program to give bogus answers. We must fix that by computing a^b % n without actually calculating a^b. The idea is to use the following property: (a * b) % n = ((a % n) * (b % n)) % n */ #include #include #include int fermatTest (int n) { int a, result, i; a = rand() % n; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.