Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Learning outcome: assess student s ability to: Create a 2 D array in a program. Access data in a 2 D array. Define functions with

Learning outcome: assess students ability to:
Create a 2D array in a program.
Access data in a 2D array.
Define functions with the application of 2D array.
Generate and use random numbers.
Activity description: sum of all numbers that are multiple of three in each COLUMN of a 7-by-7 matrix (2D array).
Create a program that will sum all numbers that are multiple of three in each COLUMN of a 2-dimension array. The program will:
Set the size of an array as a global constant variable with value of 7.
define function numbers_random(). Function numbers_random() is used to randomly generate a value between -25 and 25 and return the value as an integer.
Define function populate_numbers(). Function populate_ numbers() is used to populate the 7-by-7 matrix. It means that each cell of the 7 rows and 7 columns will be populated with one random number. This random number is obtained by using function numbers_random().
define function print_number(). Function print_number() is used to print the value in each cell of the 7-by-7 array.
define function sum_mult3_col(). Function sum_mult3_col() is used to sum all numbers that are multiple of 3 in each COLUMN of a 7-by-7 array.
Define function prompt_sum_mult3_col(). The function is used to print the result of the sums as:
Sum all numbers that are multiple of three in column 1=____
Sum all numbers that are multiple of three in column 2=____
Sum all numbers that are multiple of three in column 3=____

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions