Find Jobs
Hire Freelancers

Array Duplicate Numbers

$30-5000 USD

Cerrado
Publicado hace más de 21 años

$30-5000 USD

Pagado a la entrega
Title: Eliminating duplicates Objectives: To introduce the concept of passing arrays to functions as parameters; create modular programs to process arrays. Description: Part 1. Write a C function that deletes all occurrences of an element from an array starting from a given index. The prototype of the function is as follows: //Preconditions: The first parameter is an integer array; the second parameter is an integer representing the number of elements in the array; the third parameter is the number that is to be deleted from the array; and the fourth parameter is the index from which the search for deletion should start. //Postconditions: The function deletes all elements whose value is equal to item starting from the index loc. The size of the array will decrease if one or more copies of item existed in the array. Therefore function changes the number of elements in the array as well. The function also returns the number of deleted items. int delete_elemet(int a[], int *n, int item, int loc); Part 2. Write a program that reads a sequence of unknown number of integers into an array. There may be a maximum of 20 integers in the input, so you should define the size of the array to be 20. Your program should then remove duplicates of all numbers in the array using the function that you wrote in part 1. After deleting the duplicates, your program should also print how many copies are deleted for each number having duplicates. Restrictions You must write the function delete_element() as described in part 1 and you must call it in your main function appropriately to perform the task described in part 2. Your main function should call the function delete_element() properly so that it can use the value that the function returns to print the number of copies deleted from the array. This printing must be done in the main function, not in the function delete_element() . Output Specification: Sample Run 1: Enter some integers (maximum of 20): 10 25 38 25 40 10 10 50 38 25 10 Value 10 : 3 copies are deleted. Value 25 : 2 copies are deleted. Value 38 : 1 copy is deleted. The resulting array is: 10 25 38 40 50 Sample Run 2: Enter some integers (maximum of 20): 21 21 21 21 21 21 21 Value 21: 6 copies are deleted. The resulting array is: 21 ## Deliverables 1) Complete and fully-functional working C program in executable form as well as complete source code of all work done. ## Platform Windows
ID del proyecto: 2877578

Información sobre el proyecto

5 propuestas
Proyecto remoto
Activo hace 21 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
5 freelancers están ofertando un promedio de $13 USD por este trabajo
Avatar del usuario
See private message.
$8,50 USD en 14 días
5,0 (1 comentario)
0,5
0,5
Avatar del usuario
See private message.
$8,50 USD en 14 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
See private message.
$25 USD en 14 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
See private message.
$17 USD en 14 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
See private message.
$6,72 USD en 14 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
United States
5,0
3
Miembro desde oct 19, 2002

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.