Hello the question is the following: Write the definitions of the functions of the class primeFactorization (Example 11-4) declared in the primeFactorization header file. Write a program that uses this class to output the prime factorization of an integer. Your program should prompt the user for an integer, determine if the input is a prime number, and display the factorization of the integer. An example of the program is shown below: Enter an integer between 2 and 270,000,000,000,000: 1005427 1005427 is a prime number. Its factorization is: 1005427 = 1005427 I need help with write three things: integerManipulationImp.cpp, primeFactorizationImp.cpp, and a main.cpp. The attached images are the .h files respective to the cpp files that are needed to answer this question. Thank you.

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

Hello the question is the following:

Write the definitions of the functions of the class primeFactorization (Example 11-4) declared in the primeFactorization header file. Write a program that uses this class to output the prime factorization of an integer. Your program should prompt the user for an integer, determine if the input is a prime number, and display the factorization of the integer.

An example of the program is shown below:

Enter an integer between 2 and 270,000,000,000,000: 1005427 1005427 is a prime number. Its factorization is: 1005427 = 1005427

I need help with write three things: integerManipulationImp.cpp, primeFactorizationImp.cpp, and a main.cpp.

The attached images are the .h files respective to the cpp files that are needed to answer this question.

Thank you.

#ifndef integerManipulation
#define integerManipulation
class integerManipulation
€
public:
void setNum(long long n);
//Function to set num.
//Postcondition: num = n;
long long getNum();
//Function to return num.
//Postcondition: The value of num is returned.
void reverseNum();
//Function to reverse the digits of num.
//Postcondition: revNum is set to num with digits in
in the reverse order.
H
H
void classifyDigits();
//Function to count the even, odd, and zero digits of num.
//Postcondition: evenCount = the number of even digits in num.
oddCount = the number of odd digits in num.
int getEvensCount();
//Function to return the number of even digits in num.
//Postcondition: The value of evensCount is returned.
int getOddsCount();
//Function to return the number of odd digits in num.
//Postcondition: The value of oddscount is returned.
int getZerosCount();
//Function to return the number of zeros in num.
//Postcondition: The value of zerosCount is returned.
int sumDigits();
//Function to return the sum of the digits of num.
//Postcondition: The sum of the digits is returned.
integerManipulation (long long n = 0);
//Constructor with a default parameter.
//The instance variable num is set according to the parameter,
//and other instance variables are set to zero.
//The default value of num is 0;
//Postcondition: num = n; zevNum = 0; evenscount = 0;
oddsCount = 0; zerosCount = 0;
private:
long long num;
long long revNum;
int evensCount;
int oddsCount;
int zerosCount;
};
#endif
Transcribed Image Text:#ifndef integerManipulation #define integerManipulation class integerManipulation € public: void setNum(long long n); //Function to set num. //Postcondition: num = n; long long getNum(); //Function to return num. //Postcondition: The value of num is returned. void reverseNum(); //Function to reverse the digits of num. //Postcondition: revNum is set to num with digits in in the reverse order. H H void classifyDigits(); //Function to count the even, odd, and zero digits of num. //Postcondition: evenCount = the number of even digits in num. oddCount = the number of odd digits in num. int getEvensCount(); //Function to return the number of even digits in num. //Postcondition: The value of evensCount is returned. int getOddsCount(); //Function to return the number of odd digits in num. //Postcondition: The value of oddscount is returned. int getZerosCount(); //Function to return the number of zeros in num. //Postcondition: The value of zerosCount is returned. int sumDigits(); //Function to return the sum of the digits of num. //Postcondition: The sum of the digits is returned. integerManipulation (long long n = 0); //Constructor with a default parameter. //The instance variable num is set according to the parameter, //and other instance variables are set to zero. //The default value of num is 0; //Postcondition: num = n; zevNum = 0; evenscount = 0; oddsCount = 0; zerosCount = 0; private: long long num; long long revNum; int evensCount; int oddsCount; int zerosCount; }; #endif
1 #ifndef primeFactorization_H
2 #define primeFactorization_H
3
4 #include "integerManipulation.h"
5
6 class primeFactorization: public integerManipulation
7 {
8 public:
9
10
11
56
12
13
14 primeFactorization (long long n = 0);
15
16
29
30
31
factorization();
//Function to output the prime factorization of num
//Postcondition: Prime factorization of num is printed;
32
33
34
35
36
void
17
18
19
20
21
22
23 private:
24
25
26
27
28
37 };
38
//Constructor with a default parameter.
//The instance variables of the base class are set according
//to the parameters and the array first125000Primes is
//created.
//Postcondition: num = n; revNum = 0; evenscount = 0;
// oddsCount = 0; zerosCount = 0;
//
first125000Primes
= first 125000 prime numbers.
long long first125000Primes [125000];
void primeFact(long long num, long long list [], int length,
int firstPrimeFact Index);
void first125000PrimeNum (long long list[], int length);
//Function to determine and store the first 125000 prime
//integers.
//Postcondition: The first 125000 prime numbers are
// determined and stored in the array first125000Primes;
void primeTest (long long num, long long list[], int length,
bool& primeNum, int& firstPrimeFact Index);
bool isPrime(long long number);
39 #endif
40
Transcribed Image Text:1 #ifndef primeFactorization_H 2 #define primeFactorization_H 3 4 #include "integerManipulation.h" 5 6 class primeFactorization: public integerManipulation 7 { 8 public: 9 10 11 56 12 13 14 primeFactorization (long long n = 0); 15 16 29 30 31 factorization(); //Function to output the prime factorization of num //Postcondition: Prime factorization of num is printed; 32 33 34 35 36 void 17 18 19 20 21 22 23 private: 24 25 26 27 28 37 }; 38 //Constructor with a default parameter. //The instance variables of the base class are set according //to the parameters and the array first125000Primes is //created. //Postcondition: num = n; revNum = 0; evenscount = 0; // oddsCount = 0; zerosCount = 0; // first125000Primes = first 125000 prime numbers. long long first125000Primes [125000]; void primeFact(long long num, long long list [], int length, int firstPrimeFact Index); void first125000PrimeNum (long long list[], int length); //Function to determine and store the first 125000 prime //integers. //Postcondition: The first 125000 prime numbers are // determined and stored in the array first125000Primes; void primeTest (long long num, long long list[], int length, bool& primeNum, int& firstPrimeFact Index); bool isPrime(long long number); 39 #endif 40
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Data members
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
  • SEE MORE 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