Description
Project One: Integers!
Introduction
Integers have many properties. For example, they can be odd, even, prime, or composite. In this project, we will test the following four properties of a given integer:
- Armstrong number: a positive integer n is called an Armstrong number if for all posi-
tive integers b that are smaller than n, ๐๐๐๐ ๐๐๐๐๐๐ ๐๐ = ๐๐. For example, 3 is Armstrong number since 13 ๐๐๐๐๐๐ 3 = 1, 23 ๐๐๐๐๐๐ 3 = 2.
- Cyclone Jet: an integer is called a cyclone jet if the number reads the same both ways. For example, 121 and 4334 are cyclone jet.
- Black Premium Car number: an integer n is called a black premium car number if ๐ฅ๐ฅ is an integer. The number 6 is not a black premium car number because
๐ฅ๐ฅ is not an integer.
- Auspicious number: an integer is called an auspicious number if the sum of its proper divisors exceeds the integer. Note that a proper divisor of an integer n is a positive divisor of n, excluding n Thus, 12 is an auspicious number, because the sum of its proper divisors is 1+2+3+4+6 = 16 > 12. However, 28 is not, since 1+2+4+7+14 = 28.
ย
Programming Assignment
You will implement a program that tests whether a given integer has a specific property.
ย
Input/Output
Your program should first prompt:
โPlease enter the integer and the test number: โ
You must use exactly this prompts. Donโt forget the trailing single space! We recommend you use the function provided in starter file to avoid potential error.
Then your program will take two integers as inputs, separated by a white space. The first one is an integer to be tested and the second one is an integer between 1 and 4, denoting one of the above properties to be tested for. The first integer should be a positive integer and be no larger than 10 million. The second input should be in the range between 1 and 4, inclusively. If either input entered is outside its range, your program should prompt the above statement and take the inputs again. (You should not prompt anything other than the above statement.) You can assume that the user always enters integral values, not any other erroneous inputs (i.e., you can always read the value into a variable of int type). Assume the entered values are within the range from -20,000,000 to 20,000,000.
Your output will be either 0 or 1, where 1 indicates that the test succeeds and 0 indicates that the test fails.
Thus, the input and output will look like:
Please enter the integer and the test number: 3 1
1
ย
Below is a situation where the first input attempt fails.
Please enter the integer and the test number: -1 1 Please enter the integer and the test number: 3 1
1



