Bir bir kısmını burada anlatıyorum. Ödevi yapacak kişiyle ayrıntıları paylaşacağım.
you are going to write a cipher stack machine which inserts bizarre numbers, e.g. prime,
perfect square, abundant, deficient, and perfect, after applying some operations on them. Your program
should also recover the inserted numbers. Please follow the steps given below in order to prevent any point
reduction from your grade.
First of all, let’s try to understand our bizarre number types. In this program, we will have five types of numbers, namely:
• Prime: a natural number that cannot be formed by multiplying other two whole numbers. • Perfect square: result of squaring an integer.
• Abundant: a positive number whose proper divisors’s sum is greater than the number itself. o E.g. 12. Divisors are 1,2,3,4,6. Total sum:
16. 16 > 12 o Abundance (difference in between the sum and the number):
• Deficient: a positive number whose proper divisors’s sum is less than the number itself. o E.g. 8 (1,2,4. Total sum: 7 < 8) o It is clear that all prime numbers are also deficient numbers. • Perfect: a positive number whose proper divisors’s sum is equal to the number itself. o E.g. 28 = 1+2+4+7+14
You can find the push rules here. If the user enters a….
• prime number: push its square to the stack.
• perfect square number: take its square root until no more whole number root is found and increment the number of operations (nrOfOpr) by one each time. Push the last square root to the stack. (E.g. for 625, push 5 and increment the nrOfOpr of the node to 2)
• perfect number: directly push to the stack.
• deficient number: do not push it to the main stack but push it to a second – so called helper – stack.
• abundant number: push abundance amount to the helper stack and (number-abundance) to the main stack (e.g. for 12, sum is 16, abundance is 4. Push 8 to main, 4 to helper stack)
İşin Yapılacağı Konum: ONLINE
Görevin Başlangıç Tarihi: 02-05-2020
Görevin Bitiş Tarihi: 07-05-2020