MATCH OUTPUT WITH QUESTION OUTPUT AS IT IS --------------------------------------------- Write a C++ program to input N integer numbers into a single dimension array, sort them in ascending order, and print both the given array and the sorted array with suitable headings. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. Define the sort method in the Sort class. Input Format: The first input consists of an integer which corresponds to the number of elements present in the single dimension array. The next 'n' inputs are the elements in the array. Output Format: The first line output consists of array elements before sorting and the next line of the output consists of array elements after sorting the elements in ascending order. Refer to sample input and output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output: Enter the number elements in the array : 5 Enter the elements of the array : 9 6 5 8 3 Before sorting the array : 9 6 5 8 3 After sorting the array : 3 5 6 8 9 -----------STRICTLY USE BELOW TEMPLATE IN YOUR SOLUTION-------- MAIN.CPP #include #include #include #include #include"Sort.cpp" using namespace std; int main() { //Fill your code here } SORT.CPP #include using namespace std; class Sort { public: void sort(int a[], int n) { //Fill your code here } };
MATCH OUTPUT WITH QUESTION OUTPUT AS IT IS
---------------------------------------------
Write a C++ program to input N integer numbers into a single dimension array, sort them in ascending order, and print both the given array and the sorted array with suitable headings.
Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.
Define the sort method in the Sort class.
Input Format:
The first input consists of an integer which corresponds to the number of elements present in the single dimension array.
The next 'n' inputs are the elements in the array.
Output Format:
The first line output consists of array elements before sorting and the next line of the output consists of array elements after sorting the elements in ascending order.
Refer to sample input and output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output:
Enter the number elements in the array :
5
Enter the elements of the array :
9
6
5
8
3
Before sorting the array :
9 6 5 8 3
After sorting the array :
3 5 6 8 9
-----------STRICTLY USE BELOW TEMPLATE IN YOUR SOLUTION--------
MAIN.CPP
#include<cstring> #include<iostream> #include<queue> #include<string> #include"Sort.cpp" using namespace std; int main() { //Fill your code here } |
SORT.CPP
#include <bits/stdc++.h> class Sort { |
Step by step
Solved in 2 steps with 3 images