Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

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

More Books

Students also viewed these Databases questions