Find Jobs
Hire Freelancers

Array and Pointers

$10-30 USD

Ολοκληρώθηκε
Αναρτήθηκε πάνω από 9 χρόνια πριν

$10-30 USD

Πληρωμή κατά την παράδοση
My redid is 817218071. The sub-functions you write will have the following prototypes and perform the operations described: int sum(int array[], int asize); /* returns the sum of the elements of a one dimensional array.*/ int swap( int *pA, int *pB ); /* returns a 1 if the integer stored at *pA is greater then the integer stored at *pB and swaps the two integers. returns 0 otherwise.*/ int sort_1pass(int array[], int asize ; /* makes one pass through the array, swapping pairs of values that are not in ascending order, using the swap() function above. Returns a 1 if any values were swapped and returns 0 otherwise.*/ void sort(int array[], asize); /* sorts the values in array in ascending order using sort_1pass() */ void printarray(int array[], asize); /* prints the contents of the array on one line*/ Use a preprocessor #define directive before main() to set the array size to 9 elements. . The main() function should perform the following actions, and call the sub-functions above where appropriate: Declare and initialize the int array[] so that each array element contains one digit of your Red ID number, so if your Red ID was 876543210, the value of the first few elements in the array would be array[0]=8, array[1]=7, array[2]=6, and so on. The array declaration and initialization should look like this: int array[] = {8,7,6,...}; Next main() should print all 9 array values in the array on a single line prior to processing. Print the sum of the the digits in the array using the sum() function above. Call function sort(), which then calls sort_1pass(), which calls swap() to swap individual pairs. Print the 9 values in the array on one line after each sort_1pass() through the array. The last line printed should be the 9 digits of your Red ID, sorted in ascending order. Print the median (middle) digit in the sorted array. Print the average of the digits in the array, accurate to 2 decimal places.
Ταυτότητα εργασίας: 6779269

Σχετικά με την εργασία

15 προτάσεις
Απομακρυσμένη Εργασία
Ενεργός/ή 9 χρόνια πριν

Ψάχνεις τρόπο για να κερδίσεις μερικά χρήματα;

Πλεονεκτήματα πλειοδοσίας στο Freelancer

Καθόρισε τον προϋπολογισμό σου και το χρονοδιάγραμμα
Πληρώσου για τη δουλειά σου
Περίγραψε την πρόταση σου
Η εγγραφή και η πλειοδοσία σε εργασίες είναι δωρεάν
Βραβεύτηκε στον/στην:
Avatar Χρήστη
** Solution in 1 hour ** HI Contact me for an efficient, perfect, well documented development of your project according to 100% accuracy and requirements, with dedicated support. Thanks Farah Saif
$12 USD σε 1 ημέρα
5,0 (91 αξιολογήσεις)
5,4
5,4
15 freelancers δίνουν μια μέση προσφορά $21 USD για αυτή τη δουλειά
Avatar Χρήστη
Hello. I am C and C++ expert, it looks as pretty easy assignment for me, can be done in few hours ........
$15 USD σε 1 ημέρα
4,9 (956 αξιολογήσεις)
7,5
7,5
Avatar Χρήστη
Hi, I am placing my bid on your project because I have read the requirements and I am confident enough with my C++ and algorithm skills. I am focused mostly on doing computer science work here in freelancer.com and I would like to help you get this project done if you would give me the opportunity. I am a computer science professor and practitioner and this assignment is one of the fields that I teach very well so I can assure you an accurate result. Let me know if you are interested so I can stat. Thanks.
$30 USD σε 1 ημέρα
5,0 (538 αξιολογήσεις)
7,2
7,2
Avatar Χρήστη
may send me more info about the task. . . . .
$40 USD σε 3 ημέρες
5,0 (29 αξιολογήσεις)
5,3
5,3
Avatar Χρήστη
hi I can start now and finish in a few hours please reply .
$13 USD σε 1 ημέρα
5,0 (33 αξιολογήσεις)
4,7
4,7
Avatar Χρήστη
I am very confident about your project. I have two years experience in C\C++ and I can easily done this. You can trust me and I will provide your project with in time in complete form with accuracy. You consider it done from my side. Thanks
$15 USD σε 1 ημέρα
4,7 (7 αξιολογήσεις)
3,4
3,4
Avatar Χρήστη
A proposal has not yet been provided
$25 USD σε 1 ημέρα
4,8 (5 αξιολογήσεις)
2,5
2,5
Avatar Χρήστη
Hi, I can solve your problem. I would start working on it ASAP. I know this stuff already. Cheers, Maciek :)
$20 USD σε 1 ημέρα
4,7 (2 αξιολογήσεις)
1,9
1,9
Avatar Χρήστη
A proposal has not yet been provided
$30 USD σε 1 ημέρα
4,9 (2 αξιολογήσεις)
1,7
1,7
Avatar Χρήστη
A proposal has not yet been provided
$30 USD σε 2 ημέρες
0,0 (0 αξιολογήσεις)
0,0
0,0
Avatar Χρήστη
Hello, I have a long experience in algorithm and performance. I have been working in auto-parallelization of algorithms in C for 2 years. I will do the project parallelized in OpenMP(Threads) or MPI(cores) (depends on the computer where it will be executed) to obtain a great speedup. I can develop it in C or even C++, reading the description I think that C would be enough. Kind Regards, Alberto.
$13 USD σε 2 ημέρες
0,0 (0 αξιολογήσεις)
0,0
0,0
Avatar Χρήστη
A proposal has not yet been provided
$20 USD σε 1 ημέρα
0,0 (0 αξιολογήσεις)
0,0
0,0
Avatar Χρήστη
A proposal has not yet been provided
$25 USD σε 1 ημέρα
0,0 (0 αξιολογήσεις)
0,0
0,0
Avatar Χρήστη
I can do it, I know the way around arrays and pointers. I would just need a little time to do this.
$16 USD σε 2 ημέρες
0,0 (0 αξιολογήσεις)
0,0
0,0
Avatar Χρήστη
I can finish the work within 2 days. Most likely earlier. If you have any questions, feel free to send me a message! //Linus
$12 USD σε 2 ημέρες
0,0 (0 αξιολογήσεις)
0,0
0,0

Σχετικά με τον πελάτη

Σημαία της UNITED STATES
San Diego, United States
4,9
3
Επαληθευμένη μέθοδος πληρωμής
Μέλος από Νοε 24, 2014

Επαλήθευση Πελάτη

Ευχαριστούμε! Σου έχουμε στείλει ένα email με ένα σύνδεσμο για να διεκδικήσεις τη δωρεάν πίστωση σου.
Κάτι πήγε στραβά κατά την προσπάθεια αποστολής του email σου. Παρακαλούμε δοκίμασε ξανά.
Εγγεγραμμένοι Χρήστες Συνολικές Αναρτημένες Δουλειές
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Φόρτωση προεπισκόπησης
Δόθηκε πρόσβαση για Geolocation.
Η σύνδεση σου έχει λήξει και τώρα έχεις αποσυνδεθεί. Παρακαλούμε συνδέσου ξανά.