Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

D) Answer the following i. Create the following matrix A: 3.2 2.1 0.5 6.5 4.2 A= 4.2 7.7 3.4 4.5 3.9 8.9 8.3 1.5 3.4

image text in transcribed
image text in transcribed
D) Answer the following i. Create the following matrix A: 3.2 2.1 0.5 6.5 4.2 A= 4.2 7.7 3.4 4.5 3.9 8.9 8.3 1.5 3.4 3.9 ii. Create a Matrix B by extracting the first column of matrix A Create a Matrix C by extracting the second row of matrix A. iv. Use the colon operator to create a matrix D by extracting the first through third column of matrix A. Q4. A) Write a python function that accepts a variable n and returns numbers from 1 to n. However, if a number is divisible by 3, the function should return 'Computer' instead of the number. If a number is divisible by 5, Programming' should be returned instead. And if the number is divisible by both 3 and 5, *Computer Programming' should be returned. B) Define a function called 'wage' that calculates your daily wage. a i. Say you use working hours as parameter, and you are paid N35000 per hour. ii. When you do well in a day, your boss will be very happy to give a bonus of N5000 added to your salary. iii. Define a "with bonus" function. And as a parameter, you will take again the working hours. But this time, you will allow yourself to return directly the wage with working hours as an output, which would be the value obtained after the wage function has been run, plus the extra N5000 you've earned

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

Students also viewed these Databases questions