Its an introductory programming class assingment

Completado Publicado Mar 18, 2015 Pagado a la entrega
Completado Pagado a la entrega

Modify has hired you to create a program that shuffles playlists[2]. Try your

program with your own playlist that has some of your favorite songs.

Add the titles of your favorite songs in a text file “[url removed, login to view]” (one song per line

and up to 5000 songs). Write a program that creates a different shuffled playlist

of “[url removed, login to view]”. Create seven different shuffled playlists of “[url removed, login to view]” (one for

each day of the week) and save these playlists in a text file named

“shuffle[DayOfWeek].txt” (one song per line), where [DayOfWeek] is Monday to

Sunday.

To solve that problem do the following:

a. Read and store the song titles in a dynamic string array playlist the i-th song

is in the (i-1)-th position. Assume you have n (<=5000) songs.

b. Implement a function that does the shuffling of favorites. This function should

be based on the modern version of the Knuth/Fisher-Yates algorithm for

shuffling [1].

The algorithm looks like that:

To shuffle an array a of n elements (indices 0..n-1):

for i from n-1 downto 1 do

j is a random integer within 0 ≤ j < i

swap(a[j],a[i])

The generated random numbers are really pseudo-random numbers. To create

random numbers in C you have to set initially the seed of the random number

generator only once (srand(time(0))) and include the appropriate library time.h.

The rand() function can be used afterwards as many times as needed and

returns a random integer x that is greater than or equal to 0 and less than

RAND_MAX. Use the x%k operation to get a number greater or equal to 0 and

less than k.

c. Traverse favorites, and write them in the text file “[url removed, login to view]” (one

song per line).

d. Repeat steps a-c, six more times for the rest of the week days.

Requirements:

Create a Makefile. The input file and the output file are command line arguments.

Output the performance of your implementation. Count the time of each shuffle,

Note: To count the time you can use clock_t and divide by

(double)CLOCKS_PER_SEC to get time in seconds

Create a zip file that contains your source code and the text files (total 8)

Programación en C

Nº del proyecto: #7332317

Sobre el proyecto

6 propuestas Proyecto remoto Activo Mar 18, 2015

Adjudicado a:

it2051229

Hi, I have read the requirements and I would like to do this project. Let me know if you are interested so I can start. Thanks.

$30 USD en 1 día
(142 comentarios)
5.7

6 freelancers están ofertando un promedio de $56 por este trabajo

vietcompro

A proposal has not yet been provided

$30 USD en 0 días
(42 comentarios)
4.6
itachi23

A proposal has not yet been provided

$148 USD en 3 días
(3 comentarios)
2.7
tzzcl

experienced C programmer. can complete this work fast. Write some computation code. Matlab/Mathematica.

$30 USD en 1 día
(1 comentario)
1.4
Asad257

I can help you, i have command on C programming ............................................................................................................

$30 USD en 3 días
(0 comentarios)
0.0
Softeria

A proposal has not yet been provided

$70 USD en 3 días
(0 comentarios)
0.0