Hi guys , I would you to help me to solve this problem
First , user need to input 10 numbers
Ex : 85 11 36 174 112 24 73 52 183 149
Next , user need to input the initial number . This initial number will determine whether the program is ascending or descending order
Ex : Initial number 50 based on above input
It means that services is carried out on track requests 50 and above
50 up to 199 ( 199 is the last compulsory number we need to reach)
After reaching 199 it will go directly to 0 ( 0 is the first compulsory number we need tor reach)
The sorted number will be as follow
Hence we will be going from 50 up to 199
then we will be going down from 199 to 0 .
From 0 to the numbers before initial (50) 11 , 24 ,36
We need also to calculate the travel track
The output will be as follow
Initial Arm position: 50 Direction: OUT
Start Finished Track Travelled
50 52 2
52 73 21
73 85 .
85 112 .
112 149 .
149 174 .
174 183 .
183 199 .
199 0 ..
0 11 nn
11 24 nn
24 36 nn
Total Track Travelled : ..
I only manage to this code
#include <iostream>
using namespace std;
int main(){
int a1, a2, a3, a4,a5,a6,a7,a8,a9,a10,it;
cout<<"Enter 10 input ";
cin>>a1>> a2>>a3>> a4>>a5>>a6>>a7>>a8>>a9>>a10;
cout<<"Initial number ";
cin it;
for (int i=0;i<10;i++)
{
if (a1>a2)
int temp
}
}
11 24 36 52 73 85 112 149 174 183