0
C++ program assignment
Write a program which 1. Reads the size of a list of characters 2. Reads the list of characters 3. Prints the list of characters in the opposite order read in 4. Prints the list of characters in the order read in 5. Sorts the list 6. Prints the sorted list example: Size = 4 alphabet = a albhabet =b alphabet = c alphabet = d In reverse order d c b a In normal order a b c d In sorted form c d b a
16 Respostas
+ 9
Your welcome, sure happy to help you.
+ 8
1) You need to make a dynamic array of size N+1.
N will be inputted by the user.
2) After creating array of size N+1,
+1 is an extra slot for null/string terminating character. Run a loop from 0 to less than N-1 and keep taking inputs.
3) Now print the array from 0 to less than N-1, it will print the array in the way it is.
4) Then print the array from N-1 to 0, it will print the array in reverse order the array is filled.
5) Then apply any sorting algorithm on the array and then repeat steps 3 and 4
+ 8
Then you can make three functions
1) void PrintArray() ;
2) void PrintReverseArray() ;
3) void SortArray() ;
+ 7
Where is your try?
+ 7
You can post a link to your code
+ 7
Ok, but let me ask some thing so that I can help you better.
What's the size of list? I mean if we input 6 then do we have to input 6 alphabets?
Then we need to print the alphabets in the same way the alphabets are inputted?
+ 7
It depends, if you need the snippet of code again and again then you can make your own functions or you can do whole thing in the main function.
I would suggest you to make a separate functions for printing the array in normal way and in the reverse order because you'll be needing them at least twice
+ 1
okay ill start working on it and will seek for your assistance if needed in between...thanks man
0
how do i write in my code?? here in the comments??
0
i have done the program in laptop btw.....so i dunno how that works
0
could you look at the instructions and just give me few steps and guides? i'll just pick it from there....i wanna do it myself but just so utterly lost how to
0
the size of the list is said to be set for 1000 thats the limit
0
it says to keep it 1000 in a manner that it can be changed whenever we like....i believe its something like const int SIZE = 1000
0
and we need to display the alphabets in three manners, one in the reverse order of what we input i.e if a b c d then d c b a , next is in normal order the same way we input like a b c d into a b c d itself and finally sorting the alphabets we input in ascending descending or alphabetical way
0
okay i got the basic structure of the program....to print the array....what should i be using? like i need to have a separte void function of any sort?
0
im asking because the instructions had one other condition....it said to use atleast 3 other functions so i believe i need to use void and stuffs