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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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 

 

Each Step must be implemented in a separat
-
function.
Must pass integers or arrays to functions in
each step.
You are not allowed to use global arrays /
global variables.
- Include The Following Libraries
:
#include <iostream>
#include <time.h>
#include <stdlib.h>
Transcribed Image Text:Each Step must be implemented in a separat - function. Must pass integers or arrays to functions in each step. You are not allowed to use global arrays / global variables. - Include The Following Libraries : #include <iostream> #include <time.h> #include <stdlib.h>
Enter a Positive integer Number > 0
--> X
*** Error
invalid input
X
---
re-run the app & use a positive number > 0
Transcribed Image Text:Enter a Positive integer Number > 0 --> X *** Error invalid input X --- re-run the app & use a positive number > 0
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education