Tasks
You are required to complete both task ONE and TWO and any of the elective tasks (total of THREE).
Task 1
Write a program that generates every prime number between two given numbers.
Input
There are two numbers m and n. The user must be able to key in the range. Appropriate prompts are needed.
Output
Print all prime numbers p such that m <= p <= n. Numbers must be separated using space or one number should be printed per line.
Example
Input:
1 10
Output:
2
3
Task 2
Write a program that get the user’s birthday (two numbers - month and day) and prints his/her zodiac sign.
Input
Two numbers:
1. Number of the month (Jan = 1, Feb = 2, …., Dec = 12)
2. Day of the month (1, 2, …., 31)
Output
The corresponding zodiac sign for the user input. Refer to the table below:
Symbol / Sign Name / English Name / Period/ Capricorn / The Goat / December 22 - January 20
/ Aquarius / The Water-Bearer / January 21 - February 18
/ Pisces / The Two Fish / February 19 - March 20
/ Aries / The Ram / March 21 - April 20
/ Taurus / The Bull / April 21 - May 20
/ Gemini / The Twins / May 21 - June 21
/ Cancer / The Crab / June 22 - July 22
/ Leo / The Lion / July 23 - August 22
/ Virgo / The Virgin / August 23 - September 22
/ Libra / The Scales / September 23 - October 22
/ Scorpio / The Scorpion / October 23 - November 21
/ Sagittarius / The Archer/Centaur / November 22 - December 21
Example
Please enter the day of your birthday: 1
Please enter the month of your birthday 12
You are a Capricorn (The Goat).
Elective Tasks (choose one only)
Task 1
Write a program a program that reads a number (integer) and prints the reversed number.
Input
A number. Must be integer.
Output
The reversed number.
Example
Please enter an integer value: 987654321
The reversed value is: 123456789
Task 2
Write a program that gets an integer as input and determines whether the number entered is a palindrome. Numeral palindrome is a 'symmetrical' number like 16461.
Input
A number. Must be integer.
Output
The output must indicate if the number entered was a palindrome
Example
Please enter an integer: 1234566
The number entered is NOT an palindrome.
Please enter an integer: 12344321
The number entered is an palindrome.
Important Note: Your programs should allow the user to repeat the sequence of the application without exiting the program. For instance, after completing the required task, the program should ask the user if they want to continue. If yes, the program must repeat. If no, the application exits.
● Algorithms and pseudo codes (bonus)
● Work distribution (who did what)
● References (if any)
Source codes