Find Jobs
Hire Freelancers

Array Duplicate Numbers

$30-5000 USD

Đã đóng
Đã đăng vào hơn 21 năm trước

$30-5000 USD

Thanh toán khi bàn giao
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
Mã dự án: 2877578

Về dự án

5 đề xuất
Dự án từ xa
Hoạt động 21 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
5 freelancer chào giá trung bình $13 USD cho công việc này
Avatar người dùng
See private message.
$8,50 USD trong 14 ngày
5,0 (1 nhận xét)
0,5
0,5
Avatar người dùng
See private message.
$8,50 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
See private message.
$25 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
See private message.
$17 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
See private message.
$6,72 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0

Về khách hàng

Cờ của UNITED STATES
United States
5,0
3
Thành viên từ thg 10 19, 2002

Xác thực khách hàng

Các công việc khác từ khách hàng này

Big Numbers
$30-5000 USD
Sales Data
$30-5000 USD
Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.