Question: Instruction : One is a word file or pdf file (both is okay). This file consists of your explanation of solution. The explanation should be

 Instruction : One is a word file or pdf file (both

is okay). This file consists of your explanation of solution. The explanation

should be given using narrative or pseudocode, and flowchart for better explanation.

Instruction :

  1. One is a word file or pdf file (both is okay). This file consists of your explanation of solution. The explanation should be given using narrative or pseudocode, and flowchart for better explanation. A detailed explanation of your solutions such as reasoning of algorithm of choice will give better score.
  2. Another file is .c files of your solution that represent each question.

PLEASE USE C PROGRAMMING AND USE HEADER INCLUDE STDIO.H

MAKE THE CODE AS SIMPLE AS U CAN

1. (30 point) Suppose that you have a 2D array (matrix) of integer with size N*N with values of 0 (N> 2). Several elements of this matrix are inserted with another value, and the middle of this matrix is also guaranteed to have a value other than 0. Make a program to get where is (are) the nearest element(s) with same value as matrix's centroid. If more than 1 position exists near the centroid, print all the nearest elements. If no nearest element exists that has the same value with the centroid, print: "No nearest element exists". The assumption is that position 0,0 start from top leftmost matrix. For example: Input: 0020 0 0 1 ololo 00105 ooooo 0 00101 (centroid at 2.2) Output: Nearest same element is at: 1,1 Another example: Input: 0 0 2100 0 101010 0|1115 0 0000 010 007 (centroid at 2.2) Output: Nearest same elements is at: (2,3) and (2,1) Input: 00210 0 0 0 0 0 0 10 010 010 (centroid at 2,2) Output: Nearest same elements is at: no nearest element. 2. (35 point). Suppose Riri is your neighborhood. She wants to make an application to store his Friends data with data: Name, Phone Number, Address. She also want to print datas based on name column. If the data not exists, then print out: Data not exist". Help Riri create the program. Example Data: Name Address Phone Number (13 Digit) 081225224336 Dini Noviani Dini Marvati 081225224337 Fahri Fabruc 081225224338 081227224336 Pekalongan, Jawa Tengah Semarang, Jawa Tengah Jayapura, Papua Sintang, Kalimantan Barat Samarinda, Kalimantan Timur Malang, Jawa Timur Bandung, Jawa Barat Zafir 081235294339 Ruben 081205220336 Tria 081225224336 If riri input "Dini, then the program will give output: Dini Noviani 081225224336 w Pekalongan, Jawa Tengah Semarang, Jawa Tengah Dini Marvati 081225224337 If rici input "Fah", then program will give output: , Fahri Fahrur 081225224338 081227224336 Jayapura, Papua Sintang, Kalimantan Barat If rici input X, then program wil give output: "Data Not Exist" 3. (35 point) Given two 2D array of O with size N*N. There are some positions in the matrix that have value of 1. These values of 1 will create objects. Check which object has bigger Area (not circumference). If it has the same size print: object 1 and 2 has the same size For example: Input: Matrix 1 00 100 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 Matrix 2 0 0 1 0 0 01010 0 1010 0 1 0 1 0 0 0 1 0 0 Output: object 2 is bigger Input: Matrix 1 0 1 1 1 0 01 0 1 0 010 0 1 0 1 110 0 0 000 Matrix 2 0 1 110 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 0 0 000 Output: object 1 and 2 has the same size

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!