18
26
wmi-parprog/01_Python_C_C++_Java/ex1.md
2025-03-03 13:27:47 +01:00

926 B
Raw Permalink Blame History

In the file is_prime there are a few numbers.

  1. Write a Python, C/C++ and Java programs and check whether it is a prime number of not.

Remark 1: There are some algorithms which can simplify this task, like MillerRabin. Please, do not use them. The goal is to compare the code from different programming paradigms.

Remark 2: Please, do not use external libraries.

  1. Using a graphical debugger is crucial in programming. Use graphical debugger to stop your program in the exact moment when the code finds out whether the given number is indeed prime or not.

Remark 3: If it is really needed one can use arbitrary precision arithmetic libraries: https://en.wikipedia.org/wiki/List_of_arbitrary-precision_arithmetic_software for different programming languages

  1. Finish this classes by writing the check for the third number using MillerRabin alorithm (or any other) to find out whether the number is prime or not.