SlideShare a Scribd company logo
Hi,
Please fidn the Answer.
//////////////////Sorting,h is Header file which contians all Function decalartion
#include
#include // std::cout
#include // std::shuffle
#include // std::array
#include // std::default_random_engine
#include
using namespace std;
class Sorting
{
private:
int num;
public:
Sorting::Sorting() {
};
///Buble Sort Input array and n Number of Elemnets
void BubbleSorting(int array[], int n);
void SelectionSorting(int array[], int n);
void ShuffleArray(int array[], int n);
void DisplayArray(int array[], int n);
void displayMenu();
int choice;
};
//////////////////////////Sorting.cpp is class fuction Which Implemnets the Function
#include "Sorting.h"
#include
using namespace std;
///Sorting the Array Using Bubble Sort...
void Sorting::BubbleSorting(int Array[],int n)
{
int temp = 0;
cout << " ------------ BUBBLE SORT ------------   ";
for (int i = 1; iArray[j + 1])
{
temp = Array[j];
Array[j] = Array[j + 1];
Array[j + 1] = temp;
}
}
cout << " ------------ RESULTS BUBBLE SORT ------------   ";
DisplayArray(Array, n);
}
//////SelectionSorting input Array and n is number of Elemnets//////////////////////
void Sorting::SelectionSorting(int Array[], int n)
{
int i, n, p, k, min, loc, temp;
for (p = 1; p <= n - 1; p++) // Loop for Pass
{
min = Array[p]; // Element Selection
loc = p;
for (k = p + 1; k <= n; k++) // Finding Min Value
{
if (min > Array[k])
{
min = Array[k];
loc = k;
}
}
temp = Array[p]; // Swap Selected Element and Min Value
Array[p] = Array[loc];
Array[loc] = temp;
}
cout << " ------------ RESULTS SELECTION SORT ------------   ";
DisplayArray(Array, n);
}
//////SelectionSorting input Array and n is number of Elemnets//////////////////////
///exchange each element with a randomly chosen element. It's possible that an element will be
exchanged with itself, but there is no problem with that
void Sorting::ShuffleArray(int Array[], int n)
{
cout << " ------------ ShuffleArray SORT ------------   ";
for (int i = 0; i
#include "Sorting.h"
using namespace std;
int main()
{
bool SelectionOn = true;
Sorting Sorting;
int choice;
int n = 10;
int *Arry;
while (SelectionOn != false) {
cout << "******************************* ";
cout << " 1 - Enter User Input Array of Elements. ";
cout << " 2 - Display User Input. ";
cout << " 3 - Shuffle User Input the Elements i. ";
cout << " 4 - Bubble Sorting. ";
cout << " 5 - Selection Sorting. ";
cout << " 6 - Exit. ";
cout << " 7 - Display Menu Again.  ";
cout << " Enter your choice and press return: ";
cin >> choice;
switch (choice)
{
case 1:
cout << "Enter User Input Array of Elements ";
cout << "Enter No. of Elements=";
cin >> n;
Arry = new int[n];
cout << " Enter Elements= ";
for (int i = 1; i <= n; i++)
{
cin >> Arry[i];
}
break;
case 2:
cout << "DISPLAY OF ARRAY ";
if (Arry != NULL)
{
Sorting.DisplayArray(Arry, n);
}
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 3:
cout << "SHUFFLE OF ARRAY ";
if (Arry != NULL)
Sorting.ShuffleArray(Arry, n);
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 4:
cout << "BUBBLE SORTING OF ARRAY ";
if (Arry != NULL)
Sorting.BubbleSorting(Arry, n);
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 5:
cout << "SELCTION SORTING OF ARRAY ";
if(Arry != NULL)
Sorting.SelectionSorting(Arry, n);
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 6:
cout << "EXIT PROGRAM ";
SelectionOn = false;
break;
case 7:
cout << "GO TO MAIN MENU ";
cout << "Choose again. ";
cin >> choice;
break;
default:
cout << "Not a Valid Choice.  ";
cout << "Choose again. ";
cin >> choice;
break;
}
}
return 0;
}
Solution
Hi,
Please fidn the Answer.
//////////////////Sorting,h is Header file which contians all Function decalartion
#include
#include // std::cout
#include // std::shuffle
#include // std::array
#include // std::default_random_engine
#include
using namespace std;
class Sorting
{
private:
int num;
public:
Sorting::Sorting() {
};
///Buble Sort Input array and n Number of Elemnets
void BubbleSorting(int array[], int n);
void SelectionSorting(int array[], int n);
void ShuffleArray(int array[], int n);
void DisplayArray(int array[], int n);
void displayMenu();
int choice;
};
//////////////////////////Sorting.cpp is class fuction Which Implemnets the Function
#include "Sorting.h"
#include
using namespace std;
///Sorting the Array Using Bubble Sort...
void Sorting::BubbleSorting(int Array[],int n)
{
int temp = 0;
cout << " ------------ BUBBLE SORT ------------   ";
for (int i = 1; iArray[j + 1])
{
temp = Array[j];
Array[j] = Array[j + 1];
Array[j + 1] = temp;
}
}
cout << " ------------ RESULTS BUBBLE SORT ------------   ";
DisplayArray(Array, n);
}
//////SelectionSorting input Array and n is number of Elemnets//////////////////////
void Sorting::SelectionSorting(int Array[], int n)
{
int i, n, p, k, min, loc, temp;
for (p = 1; p <= n - 1; p++) // Loop for Pass
{
min = Array[p]; // Element Selection
loc = p;
for (k = p + 1; k <= n; k++) // Finding Min Value
{
if (min > Array[k])
{
min = Array[k];
loc = k;
}
}
temp = Array[p]; // Swap Selected Element and Min Value
Array[p] = Array[loc];
Array[loc] = temp;
}
cout << " ------------ RESULTS SELECTION SORT ------------   ";
DisplayArray(Array, n);
}
//////SelectionSorting input Array and n is number of Elemnets//////////////////////
///exchange each element with a randomly chosen element. It's possible that an element will be
exchanged with itself, but there is no problem with that
void Sorting::ShuffleArray(int Array[], int n)
{
cout << " ------------ ShuffleArray SORT ------------   ";
for (int i = 0; i
#include "Sorting.h"
using namespace std;
int main()
{
bool SelectionOn = true;
Sorting Sorting;
int choice;
int n = 10;
int *Arry;
while (SelectionOn != false) {
cout << "******************************* ";
cout << " 1 - Enter User Input Array of Elements. ";
cout << " 2 - Display User Input. ";
cout << " 3 - Shuffle User Input the Elements i. ";
cout << " 4 - Bubble Sorting. ";
cout << " 5 - Selection Sorting. ";
cout << " 6 - Exit. ";
cout << " 7 - Display Menu Again.  ";
cout << " Enter your choice and press return: ";
cin >> choice;
switch (choice)
{
case 1:
cout << "Enter User Input Array of Elements ";
cout << "Enter No. of Elements=";
cin >> n;
Arry = new int[n];
cout << " Enter Elements= ";
for (int i = 1; i <= n; i++)
{
cin >> Arry[i];
}
break;
case 2:
cout << "DISPLAY OF ARRAY ";
if (Arry != NULL)
{
Sorting.DisplayArray(Arry, n);
}
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 3:
cout << "SHUFFLE OF ARRAY ";
if (Arry != NULL)
Sorting.ShuffleArray(Arry, n);
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 4:
cout << "BUBBLE SORTING OF ARRAY ";
if (Arry != NULL)
Sorting.BubbleSorting(Arry, n);
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 5:
cout << "SELCTION SORTING OF ARRAY ";
if(Arry != NULL)
Sorting.SelectionSorting(Arry, n);
else
{
cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 ";
}
break;
case 6:
cout << "EXIT PROGRAM ";
SelectionOn = false;
break;
case 7:
cout << "GO TO MAIN MENU ";
cout << "Choose again. ";
cin >> choice;
break;
default:
cout << "Not a Valid Choice.  ";
cout << "Choose again. ";
cin >> choice;
break;
}
}
return 0;
}

More Related Content

Similar to Hi,Please fidn the Answer.Sorting,h is Header .pdf

2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
kinan keshkeh
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
HIMANSUKUMAR12
 
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdfC++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
rohit219406
 
#include iostream #include deque #include stdio.h   scan.pdf
#include iostream #include deque #include stdio.h   scan.pdf#include iostream #include deque #include stdio.h   scan.pdf
#include iostream #include deque #include stdio.h   scan.pdf
anandmobile
 
Kotlin
KotlinKotlin
Kotlin
BoKaiRuan
 
C programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfC programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdf
flashfashioncasualwe
 
VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab Manual
AkhilaaReddy
 
Please find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdfPlease find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdf
premkhatri99
 
write the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdfwrite the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdf
jyothimuppasani1
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
BackPack3
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
BackPack3
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
BackPack3
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
BackPack3
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
ssuseraef9da
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
BackPack3
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
ssuseraef9da
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
arwholesalelors
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
BackPack3
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
BackPack3
 

Similar to Hi,Please fidn the Answer.Sorting,h is Header .pdf (20)

2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
 
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdfC++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
C++, Implement the class BinarySearchTree, as given in listing 16-4 .pdf
 
#include iostream #include deque #include stdio.h   scan.pdf
#include iostream #include deque #include stdio.h   scan.pdf#include iostream #include deque #include stdio.h   scan.pdf
#include iostream #include deque #include stdio.h   scan.pdf
 
Kotlin
KotlinKotlin
Kotlin
 
C programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfC programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdf
 
C# labprograms
C# labprogramsC# labprograms
C# labprograms
 
VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab Manual
 
Please find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdfPlease find my solution.Please let me know in case of any issue..pdf
Please find my solution.Please let me know in case of any issue..pdf
 
write the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdfwrite the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 
#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf#include algorithm #include vector #include iostream usi.pdf
#include algorithm #include vector #include iostream usi.pdf
 

More from anandf0099

Riboflavin is required in the conversion of carbo.pdf
                     Riboflavin is required in the conversion of carbo.pdf                     Riboflavin is required in the conversion of carbo.pdf
Riboflavin is required in the conversion of carbo.pdf
anandf0099
 
PbS,Ag2O and CaSO4 are stable as they are insolub.pdf
                     PbS,Ag2O and CaSO4 are stable as they are insolub.pdf                     PbS,Ag2O and CaSO4 are stable as they are insolub.pdf
PbS,Ag2O and CaSO4 are stable as they are insolub.pdf
anandf0099
 
Optio D is the correct one. .pdf
                     Optio D is the correct one.                      .pdf                     Optio D is the correct one.                      .pdf
Optio D is the correct one. .pdf
anandf0099
 
Image not seenfound .pdf
                     Image not seenfound                             .pdf                     Image not seenfound                             .pdf
Image not seenfound .pdf
anandf0099
 
If multiple orbitals of the same energy are avail.pdf
                     If multiple orbitals of the same energy are avail.pdf                     If multiple orbitals of the same energy are avail.pdf
If multiple orbitals of the same energy are avail.pdf
anandf0099
 
What is a Distributed System Compare it with a computer network sys.pdf
What is a Distributed System Compare it with a computer network sys.pdfWhat is a Distributed System Compare it with a computer network sys.pdf
What is a Distributed System Compare it with a computer network sys.pdf
anandf0099
 
USES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdf
USES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdfUSES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdf
USES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdf
anandf0099
 
The movement of watersolvent across the osmotic gradient takes plac.pdf
The movement of watersolvent across the osmotic gradient takes plac.pdfThe movement of watersolvent across the osmotic gradient takes plac.pdf
The movement of watersolvent across the osmotic gradient takes plac.pdf
anandf0099
 
These groups are closely related not only is SO(2) a subgroup of O(.pdf
These groups are closely related not only is SO(2) a subgroup of O(.pdfThese groups are closely related not only is SO(2) a subgroup of O(.pdf
These groups are closely related not only is SO(2) a subgroup of O(.pdf
anandf0099
 
The probability of atom has zero quanta of energy is      P=Number.pdf
The probability of atom has zero quanta of energy is      P=Number.pdfThe probability of atom has zero quanta of energy is      P=Number.pdf
The probability of atom has zero quanta of energy is      P=Number.pdf
anandf0099
 
Copper turns green because it oxidizes. Coppe.pdf
                     Copper turns green because it oxidizes. Coppe.pdf                     Copper turns green because it oxidizes. Coppe.pdf
Copper turns green because it oxidizes. Coppe.pdf
anandf0099
 
CO2 and NO2 are acidic oxides as non-metal form a.pdf
                     CO2 and NO2 are acidic oxides as non-metal form a.pdf                     CO2 and NO2 are acidic oxides as non-metal form a.pdf
CO2 and NO2 are acidic oxides as non-metal form a.pdf
anandf0099
 
Ques-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdf
Ques-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdfQues-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdf
Ques-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdf
anandf0099
 
Program.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdfProgram.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdf
anandf0099
 
package chegg;import java.util.ArrayList; import java.util.List;.pdf
package chegg;import java.util.ArrayList; import java.util.List;.pdfpackage chegg;import java.util.ArrayList; import java.util.List;.pdf
package chegg;import java.util.ArrayList; import java.util.List;.pdf
anandf0099
 
B. propene. Solution B. p.pdf
                     B. propene. Solution                     B. p.pdf                     B. propene. Solution                     B. p.pdf
B. propene. Solution B. p.pdf
anandf0099
 
L{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdf
L{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdfL{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdf
L{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdf
anandf0099
 
Issue of Equity or Debt are commonly used methods for business finan.pdf
Issue of Equity or Debt are commonly used methods for business finan.pdfIssue of Equity or Debt are commonly used methods for business finan.pdf
Issue of Equity or Debt are commonly used methods for business finan.pdf
anandf0099
 
In probability we have two types of eventsIndependent Events who.pdf
In probability we have two types of eventsIndependent Events who.pdfIn probability we have two types of eventsIndependent Events who.pdf
In probability we have two types of eventsIndependent Events who.pdf
anandf0099
 
i have written ths code as per your requirements with clear comments.pdf
i have written ths code as per your requirements with clear comments.pdfi have written ths code as per your requirements with clear comments.pdf
i have written ths code as per your requirements with clear comments.pdf
anandf0099
 

More from anandf0099 (20)

Riboflavin is required in the conversion of carbo.pdf
                     Riboflavin is required in the conversion of carbo.pdf                     Riboflavin is required in the conversion of carbo.pdf
Riboflavin is required in the conversion of carbo.pdf
 
PbS,Ag2O and CaSO4 are stable as they are insolub.pdf
                     PbS,Ag2O and CaSO4 are stable as they are insolub.pdf                     PbS,Ag2O and CaSO4 are stable as they are insolub.pdf
PbS,Ag2O and CaSO4 are stable as they are insolub.pdf
 
Optio D is the correct one. .pdf
                     Optio D is the correct one.                      .pdf                     Optio D is the correct one.                      .pdf
Optio D is the correct one. .pdf
 
Image not seenfound .pdf
                     Image not seenfound                             .pdf                     Image not seenfound                             .pdf
Image not seenfound .pdf
 
If multiple orbitals of the same energy are avail.pdf
                     If multiple orbitals of the same energy are avail.pdf                     If multiple orbitals of the same energy are avail.pdf
If multiple orbitals of the same energy are avail.pdf
 
What is a Distributed System Compare it with a computer network sys.pdf
What is a Distributed System Compare it with a computer network sys.pdfWhat is a Distributed System Compare it with a computer network sys.pdf
What is a Distributed System Compare it with a computer network sys.pdf
 
USES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdf
USES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdfUSES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdf
USES OF FINANCIAL STATEMENT ANALYSISFINANCIAL STATEMENT ANALYSIS .pdf
 
The movement of watersolvent across the osmotic gradient takes plac.pdf
The movement of watersolvent across the osmotic gradient takes plac.pdfThe movement of watersolvent across the osmotic gradient takes plac.pdf
The movement of watersolvent across the osmotic gradient takes plac.pdf
 
These groups are closely related not only is SO(2) a subgroup of O(.pdf
These groups are closely related not only is SO(2) a subgroup of O(.pdfThese groups are closely related not only is SO(2) a subgroup of O(.pdf
These groups are closely related not only is SO(2) a subgroup of O(.pdf
 
The probability of atom has zero quanta of energy is      P=Number.pdf
The probability of atom has zero quanta of energy is      P=Number.pdfThe probability of atom has zero quanta of energy is      P=Number.pdf
The probability of atom has zero quanta of energy is      P=Number.pdf
 
Copper turns green because it oxidizes. Coppe.pdf
                     Copper turns green because it oxidizes. Coppe.pdf                     Copper turns green because it oxidizes. Coppe.pdf
Copper turns green because it oxidizes. Coppe.pdf
 
CO2 and NO2 are acidic oxides as non-metal form a.pdf
                     CO2 and NO2 are acidic oxides as non-metal form a.pdf                     CO2 and NO2 are acidic oxides as non-metal form a.pdf
CO2 and NO2 are acidic oxides as non-metal form a.pdf
 
Ques-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdf
Ques-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdfQues-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdf
Ques-1 Development of tube feet of CRINOIDEADevelopment of tube f.pdf
 
Program.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdfProgram.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdf
 
package chegg;import java.util.ArrayList; import java.util.List;.pdf
package chegg;import java.util.ArrayList; import java.util.List;.pdfpackage chegg;import java.util.ArrayList; import java.util.List;.pdf
package chegg;import java.util.ArrayList; import java.util.List;.pdf
 
B. propene. Solution B. p.pdf
                     B. propene. Solution                     B. p.pdf                     B. propene. Solution                     B. p.pdf
B. propene. Solution B. p.pdf
 
L{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdf
L{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdfL{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdf
L{e^{-t}} = int _0 to infinty [e^{st}e^{2-t} dt = int _0 to infinty.pdf
 
Issue of Equity or Debt are commonly used methods for business finan.pdf
Issue of Equity or Debt are commonly used methods for business finan.pdfIssue of Equity or Debt are commonly used methods for business finan.pdf
Issue of Equity or Debt are commonly used methods for business finan.pdf
 
In probability we have two types of eventsIndependent Events who.pdf
In probability we have two types of eventsIndependent Events who.pdfIn probability we have two types of eventsIndependent Events who.pdf
In probability we have two types of eventsIndependent Events who.pdf
 
i have written ths code as per your requirements with clear comments.pdf
i have written ths code as per your requirements with clear comments.pdfi have written ths code as per your requirements with clear comments.pdf
i have written ths code as per your requirements with clear comments.pdf
 

Recently uploaded

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 

Recently uploaded (20)

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 

Hi,Please fidn the Answer.Sorting,h is Header .pdf

  • 1. Hi, Please fidn the Answer. //////////////////Sorting,h is Header file which contians all Function decalartion #include #include // std::cout #include // std::shuffle #include // std::array #include // std::default_random_engine #include using namespace std; class Sorting { private: int num; public: Sorting::Sorting() { }; ///Buble Sort Input array and n Number of Elemnets void BubbleSorting(int array[], int n); void SelectionSorting(int array[], int n); void ShuffleArray(int array[], int n); void DisplayArray(int array[], int n); void displayMenu(); int choice; }; //////////////////////////Sorting.cpp is class fuction Which Implemnets the Function #include "Sorting.h" #include using namespace std; ///Sorting the Array Using Bubble Sort... void Sorting::BubbleSorting(int Array[],int n) {
  • 2. int temp = 0; cout << " ------------ BUBBLE SORT ------------ "; for (int i = 1; iArray[j + 1]) { temp = Array[j]; Array[j] = Array[j + 1]; Array[j + 1] = temp; } } cout << " ------------ RESULTS BUBBLE SORT ------------ "; DisplayArray(Array, n); } //////SelectionSorting input Array and n is number of Elemnets////////////////////// void Sorting::SelectionSorting(int Array[], int n) { int i, n, p, k, min, loc, temp; for (p = 1; p <= n - 1; p++) // Loop for Pass { min = Array[p]; // Element Selection loc = p; for (k = p + 1; k <= n; k++) // Finding Min Value { if (min > Array[k]) { min = Array[k]; loc = k; } } temp = Array[p]; // Swap Selected Element and Min Value Array[p] = Array[loc]; Array[loc] = temp; } cout << " ------------ RESULTS SELECTION SORT ------------ "; DisplayArray(Array, n);
  • 3. } //////SelectionSorting input Array and n is number of Elemnets////////////////////// ///exchange each element with a randomly chosen element. It's possible that an element will be exchanged with itself, but there is no problem with that void Sorting::ShuffleArray(int Array[], int n) { cout << " ------------ ShuffleArray SORT ------------ "; for (int i = 0; i #include "Sorting.h" using namespace std; int main() { bool SelectionOn = true; Sorting Sorting; int choice; int n = 10; int *Arry; while (SelectionOn != false) { cout << "******************************* "; cout << " 1 - Enter User Input Array of Elements. "; cout << " 2 - Display User Input. "; cout << " 3 - Shuffle User Input the Elements i. "; cout << " 4 - Bubble Sorting. "; cout << " 5 - Selection Sorting. "; cout << " 6 - Exit. "; cout << " 7 - Display Menu Again. "; cout << " Enter your choice and press return: "; cin >> choice; switch (choice) {
  • 4. case 1: cout << "Enter User Input Array of Elements "; cout << "Enter No. of Elements="; cin >> n; Arry = new int[n]; cout << " Enter Elements= "; for (int i = 1; i <= n; i++) { cin >> Arry[i]; } break; case 2: cout << "DISPLAY OF ARRAY "; if (Arry != NULL) { Sorting.DisplayArray(Arry, n); } else { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 3: cout << "SHUFFLE OF ARRAY "; if (Arry != NULL) Sorting.ShuffleArray(Arry, n); else { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 4: cout << "BUBBLE SORTING OF ARRAY "; if (Arry != NULL) Sorting.BubbleSorting(Arry, n); else
  • 5. { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 5: cout << "SELCTION SORTING OF ARRAY "; if(Arry != NULL) Sorting.SelectionSorting(Arry, n); else { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 6: cout << "EXIT PROGRAM "; SelectionOn = false; break; case 7: cout << "GO TO MAIN MENU "; cout << "Choose again. "; cin >> choice; break; default: cout << "Not a Valid Choice. "; cout << "Choose again. "; cin >> choice; break; } } return 0; }
  • 6. Solution Hi, Please fidn the Answer. //////////////////Sorting,h is Header file which contians all Function decalartion #include #include // std::cout #include // std::shuffle #include // std::array #include // std::default_random_engine #include using namespace std; class Sorting { private: int num; public: Sorting::Sorting() { }; ///Buble Sort Input array and n Number of Elemnets void BubbleSorting(int array[], int n); void SelectionSorting(int array[], int n); void ShuffleArray(int array[], int n); void DisplayArray(int array[], int n); void displayMenu(); int choice; }; //////////////////////////Sorting.cpp is class fuction Which Implemnets the Function #include "Sorting.h" #include using namespace std; ///Sorting the Array Using Bubble Sort... void Sorting::BubbleSorting(int Array[],int n)
  • 7. { int temp = 0; cout << " ------------ BUBBLE SORT ------------ "; for (int i = 1; iArray[j + 1]) { temp = Array[j]; Array[j] = Array[j + 1]; Array[j + 1] = temp; } } cout << " ------------ RESULTS BUBBLE SORT ------------ "; DisplayArray(Array, n); } //////SelectionSorting input Array and n is number of Elemnets////////////////////// void Sorting::SelectionSorting(int Array[], int n) { int i, n, p, k, min, loc, temp; for (p = 1; p <= n - 1; p++) // Loop for Pass { min = Array[p]; // Element Selection loc = p; for (k = p + 1; k <= n; k++) // Finding Min Value { if (min > Array[k]) { min = Array[k]; loc = k; } } temp = Array[p]; // Swap Selected Element and Min Value Array[p] = Array[loc]; Array[loc] = temp; } cout << " ------------ RESULTS SELECTION SORT ------------ ";
  • 8. DisplayArray(Array, n); } //////SelectionSorting input Array and n is number of Elemnets////////////////////// ///exchange each element with a randomly chosen element. It's possible that an element will be exchanged with itself, but there is no problem with that void Sorting::ShuffleArray(int Array[], int n) { cout << " ------------ ShuffleArray SORT ------------ "; for (int i = 0; i #include "Sorting.h" using namespace std; int main() { bool SelectionOn = true; Sorting Sorting; int choice; int n = 10; int *Arry; while (SelectionOn != false) { cout << "******************************* "; cout << " 1 - Enter User Input Array of Elements. "; cout << " 2 - Display User Input. "; cout << " 3 - Shuffle User Input the Elements i. "; cout << " 4 - Bubble Sorting. "; cout << " 5 - Selection Sorting. "; cout << " 6 - Exit. "; cout << " 7 - Display Menu Again. "; cout << " Enter your choice and press return: "; cin >> choice; switch (choice)
  • 9. { case 1: cout << "Enter User Input Array of Elements "; cout << "Enter No. of Elements="; cin >> n; Arry = new int[n]; cout << " Enter Elements= "; for (int i = 1; i <= n; i++) { cin >> Arry[i]; } break; case 2: cout << "DISPLAY OF ARRAY "; if (Arry != NULL) { Sorting.DisplayArray(Arry, n); } else { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 3: cout << "SHUFFLE OF ARRAY "; if (Arry != NULL) Sorting.ShuffleArray(Arry, n); else { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 4: cout << "BUBBLE SORTING OF ARRAY "; if (Arry != NULL) Sorting.BubbleSorting(Arry, n);
  • 10. else { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 5: cout << "SELCTION SORTING OF ARRAY "; if(Arry != NULL) Sorting.SelectionSorting(Arry, n); else { cout << "ENTER ELEMENTS TO ARRAY BY SELCTING CHOICE 1 "; } break; case 6: cout << "EXIT PROGRAM "; SelectionOn = false; break; case 7: cout << "GO TO MAIN MENU "; cout << "Choose again. "; cin >> choice; break; default: cout << "Not a Valid Choice. "; cout << "Choose again. "; cin >> choice; break; } } return 0; }