1. Define an array. [3 marks]2. Distinguish between a regular variable and an array. [2 marks]3. The ages of 10 students are to be collected. Write a pseudocode program to do the following:a. Accept...

1. Define an array. [3 marks]2. Distinguish between a regular variable and an array. [2 marks]3. The ages of 10 students are to be collected. Write a pseudocode program to do the following:a. Accept and store the ages into an array called stu_ages [5 marks]b. Find and print the sum of odd ages and the average of the ages in the array stu_ages [5 marks]c. Find and print the average of the even ages in the array stu_ages [5 marks]
Given that an array called “demo_values” contains the following 7 elements: {44, 75 ,56, 38, 83, 10, 37}Complete the following tasks (Each task does NOT require a new program to be written): 4. Write a C program (Use for loops) to:a. calculate and print the sum of all values in the arrayb. calculate and print the sum and average of all even numbersc. calculate and print the sum of values whose index is an odd number



Vocational Training Development Institute School of Applied Technology ICT Introduction to Programming II – CS162 Module No. 1 & 2 In class Test Date of Examination: March 2, 2021 Total Marks: 53. Lecturer: Kenardo Smith Time: 1.5 hours Instructions: This paper contains two sections. Answer ALL questions. MODULE 1 - Pseudocode: Total marks possible [20 marks] 1. Define an array. [3 marks] 2. Distinguish between a regular variable and an array. [2 marks] 3. The ages of 10 students are to be collected. Write a pseudocode program to do the following: a. Accept and store the ages into an array called stu_ages [5 marks] b. Find and print the sum of odd ages and the average of the ages in the array stu_ages [5 marks] c. Find and print the average of the even ages in the array stu_ages [5 marks] MODULE 2 – C Programming Total marks possible [33 marks] Given that an array called “demo_values” contains the following 7 elements: {44, 75 ,56, 38, 83, 10, 37} Complete the following tasks (Each task does NOT require a new program to be written): 4. Write a C program (Use for loops) to: a. calculate and print the sum of all values in the array b. calculate and print the sum and average of all even numbers c. calculate and print the sum of values whose index is an odd number [33 marks]
Mar 03, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here