subject
Computers and Technology, 23.03.2021 20:50 61497

Create a function that takes a list containing more than one sublists as an argument or parameter. Each sublist has 2 elements. The first element is the numerator and the second element is the denominator. Return the sum of the fractions rounded to the nearest whole number.

Step 1: First, consider the sublist [18, 13]. Divide the first number in this list i. e. 18 by the second number in this list i. e. 13 using list indexing method.

Step 2: Next, consider the second sublist [4, 5]. Divide the first number in this list i. e. 4 by the second number in this list i. e. 5 using list indexing method. There can be more than two sublists. So, perform Step 1 and Step 2 using for loop.

Step 3: Calculate the sum of fractions by adding the results obtained in Step 1 and Step 2.

Step 4: Round off the result to the nearest whole number using the round() function. The syntax of round() function is:

Syntax: round(float_num, num_of_decimals)

where,

float_num is the number to be rounded.
num_of_decimals is the number of decimal places to be considered while rounding. If not specified, number will be rounded to nearest whole number.
For example:

round(2.18,1) will give 2.2
round(2.18) will give 2
Please help!!!

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:40
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Now you’re on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx,fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx,fs) does automatic scaling and then calls sound(xx,fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
You know the right answer?
Create a function that takes a list containing more than one sublists as an argument or parameter. E...
Questions