Question: Part(a) Write a function and call it Problem 4Function that receives a number as its input argument and has the following output argument: . If

 Part(a) Write a function and call it Problem 4Function that receives

Part(a) Write a function and call it Problem 4Function that receives a number as its input argument and has the following output argument: . If the input argument is a positive integer between 1000 and 9999, it should return the number of its digits that are even numbers. For example, Problem 4Function(4238) should have 3 as its output argument since the number 4238 has three even digits (i.e. 4, 2, and 8). If the number is not a positive integer between 1000 and 9999, it should return -1. For example, Problem4Function(269) or Problem4Function(-6.3) should return -1. Part(b) Write a script file that Asks the user for a positive number n. Generates a matrix A that has n rows and 2n columns with random integer elements between -10000 and 10000. Generates a new matrix B with the same size as A for which, the value of each element is the Problem 4 Function value of its corresponding element on Matrix A. Displays the new matrix, B

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!