Question: User Write a C + + program to run a menu - driven program with the following choices: Lucas Number Sequence Prime Number Sequence Lucas

User
Write a C++ program to run a menu-driven program with the following choices:
Lucas Number Sequence
Prime Number Sequence
Lucas Prime Number Sequence
Quit
1. Write a function called getValidUserInputPosNumGT0 that allows a user to enter in an integer and validated that the number is >0. It must have a pass by reference parameter that will store the value selected by the user.
void GetValidUserInputPosNumGT0(long long &num);
2. Write a function called DisplayLucasNumberSequence that takes a number (N) as a value parameter. It displays the first N numbers in the Lucas Number Sequence
void DisplayLucasNumberSequence(long long num);
3. Write a function called IsPrime that takes a number as a value parameter. It returns true if the number is prime and false otherwise.
bool IsPrime(long long num);
4. Write a function called DisplayPrimeNumber that takes a number (N) as a value parameter. It displays the first N prime numbers.
void DisplayPrimeNumbers(long long num);
5. Write a function called DisplayLucasPrimeNumbers that takes a number (N) as a value parameter. It displays the first N Lucas prime numbers.
void DisplayLucasPrimeNumbers(long long num);
6. Add comments wherever necessary.
7. Restrict yourself to input/output statements, variables, selection statements, loops, and functions. No strings or arrays.
Sample run:
Welcome to the playing with numbers!
1) Lucas Number Sequence
2) Prime Number Sequence
3) Lucas Prime Number Sequence
4) Quit
Select an option (1..4)..5
Select an option (1..4)..-7
Select an option (1..4)..1
Enter in n
Enter in a positive number greater than 0...-8
Enter in a positive number greater than 0...5
Lucas Number Sequence
2
1
3
4
7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!