Write a c++ program that accepts a positive integer N greater than zero from the keyboard. in your main program, create an integer of size N and populate the array. from main, the program then calls the following functions: 1. Array calculation: the purpose of the function is to find the smallest number and the largest number in the array. the function will return the values back to the main program. 2.Currency Calculation: Assuming that the number N represents the number of pennies, the function computes the number of quarters, dimes, nickels, and pennies to be displayed.D displaying as many quarters as possible, then dims then nickels, and pennies in that order. 3.Person age : Assuming that the number N represents a person age. the function then calculates and displays statistics about age. assuming that there are 365 days in a year, the program displays the following information: Number of months, days, hours, minutes. 4-Number separation: The function should separate the numbers N into its individual digits and display on a screen the digits separated from one another by three spaces each. the function then displays each digit of the integer in English. For example, if the number is 1234 the output should be " 1 2 3 4 one Two Three Four 5.Number Sequence: For the integer N, the sequence starting at n is obtained as follows. you write a sequence of numbers, one after another. Start by writing n. If n is even then the next number is n/2. if n is odd then the next number is 3n+1.continue in this way until you write the number 1. For example, the number sequence starting at 6 is (6,3,10,5,16,8,4,2,1). 6.Prime numbers: Function that indicates whether or not the integer N that was entered is prime. The function also displays all the prime numbers between 1 and that number. For example, if the number is 4, the output should be: 4 is not prime All primes between 1 and 4 are 2 number is prime 3 number is prime
Write a c++ program that accepts a positive integer N greater than zero from the keyboard.
in your main program, create an integer of size N and populate the array.
from main, the program then calls the following functions:
1. Array calculation: the purpose of the function is to find the smallest number and the largest number in the array. the function will return the values back to the main program.
2.Currency Calculation: Assuming that the number N represents the number of pennies, the function computes the number of quarters, dimes, nickels, and pennies to be displayed.D displaying as many quarters as possible, then dims then nickels, and pennies in that order.
3.Person age : Assuming that the number N represents a person age. the function then calculates and displays statistics about age. assuming that there are 365 days in a year, the program displays the following information: Number of months, days, hours, minutes.
4-Number separation: The function should separate the numbers N into its individual digits and display on a screen the digits separated from one another by three spaces each. the function then displays each digit of the integer in English.
For example, if the number is 1234 the output should be "
1 2 3 4
one Two Three Four
5.Number Sequence: For the integer N, the sequence starting at n is obtained as follows.
you write a sequence of numbers, one after another. Start by writing n. If n is even then the next number is n/2. if n is odd then the next number is 3n+1.continue in this way until you write the number 1. For example, the number sequence starting at 6 is (6,3,10,5,16,8,4,2,1).
6.Prime numbers: Function that indicates whether or not the integer N that was entered is prime. The function also displays all the prime numbers between 1 and that number. For example, if the number is 4, the output should be:
4 is not prime
All primes between 1 and 4 are
2 number is prime
3 number is prime
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images