Course Programming Fundamentals (C language) 1 LAB 8 – Arrays Main content 1 Get used to array declarations 2 Get used to element accesses in arrays 3 Get used to array passing in function calls 4 Che[.]
Course: Programming Fundamentals (C language) LAB – Arrays Main content: Get used to array declarations Get used to element accesses in arrays Get used to array passing in function calls Check coding styles Practice: Get used to array declarations 1.1 Write a C program to generate and print the following arrays of integer numbers where N is given by a user from the keyboard: 1.1.1 N first even numbers greater than 1.1.2 The 50 random numbers less than N 1.1.3 The first prime numbers less than N 1.2 Given a C program as follows Describe the property of each array on line and then describe the property of each parameter passing in the function call isMember() on line 11 1.3 Write a C program to calculate the percentage of the tourists whose fees are greater than 13 and also calculate the percentage of the tourists who start their first visiting location at L1 It is required that the information of the tourists given below needs organizing properly Given the information of the tourists as follows: Full name John Smith Peter Brown Alice Depp March Carter Tony Stark Conan May Passport Nationality Fee Starting date Ending date First location Name X Last location Name X Y Y B1203457 English 15.3 13/2/2017 18/2/2017 L1 2.4 L2 5.2 8.3 SPECIAL A3910385 English 13.2 23/12/2016 03/1/2017 L1 2.4 L3 4.8 7.5 NORMAL B2384021 English 13 23/12/2016 03/1/2017 L2 5.2 8.3 L4 6.2 8.9 NORMAL A3830291 English 10.5 28/12/2016 04/1/2017 L3 4.8 7.5 L5 6.5 9.2 SALE D3870294 American 20 28/12/2016 04/1/2017 L1 2.4 L5 6.5 9.2 SPECIAL D4911356 American 20 28/12/2016 04/1/2017 L1 2.4 L5 6.5 9.2 SPECIAL Get used to element accesses in arrays 2.1 Complete the following code to obtain a C program that can insert a new element iNew into the b array with no impact on the ascending order from the left to the right of the array int b[10] = {-2, 0, 2, 4, 9, 10, 13, 19}; int n = 8, iNew = 11, i, j; for (i=0; b[i]