[solved] – Question 99614

“DESIGN and implement a function that takes an amount of money in UAE dirhams and return the same amount in US dollars and EUROS.research today exchange rate from the internet.If the rate are not passed to the function,use 3.68 for US dollars and 4.20 for Euros

Expert Answer


[solved] – Question 99627

Computing Distance
Consider the radius or circumference of the wheel(s) mounted to the motor(s), how can this information be used in combination with encoder info to accurate move a specified distance? (Show your calculations)

Expert Answer


[solved] – Question 9966

Write a program using pseudocode and C++ to let a user to accept qualification & number of employees experience depending with a following:
Qualification is Bachelors and experience more than or equal to 2 then print Lecture
Qualification is Master and experience more than 6 then print Assoc Prof
Qualification is PHD and experience more than 10 then print Prof
If not, it will print Invalid Data.

Expert Answer


[solved] – Question 99660

Hi, I had a homework to do which I don’t quiet understand. It’s this
Write a function approx_ln(x,n) that approximates the logarithm by n steps
of the above algorithm

with these information
It is based of computing the arithmetic and geometric mean of two values ai, gi
For a given value x > 0, initialize a_0 =(1+x)/2 , g_0 =√x,
• Iterate a_(i+1) =(a_i+g_i)2 and g_(i+1) =√ai+1gi
• Consider ( x−1)/a_i as an approximation to ln(x).

and after trying a lot I came up with this

def arithmetic_geometric_mean(a, g):
while True:
a= (a+g)/2
g=sqrt(a*g)
yield a, g

tol= 1e-5
def approx_ln(x, maxit=500):
a_0= (1+x)/2
g_0=sqrt(x)
for a,b in islice(arithmetic_geometric_mean(a_0, g_0), maxit):
if abs(a-b)<tol:
return (x-1)/a

which works but the question asks for different values of n and idk what to do

Expert Answer


[solved] – Question 99682

Describe the difference between a chained conditional and a nested conditional. Give your own example of each.

Deeply nested conditionals can become difficult to read. Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent single conditional.

Expert Answer


[solved] – Question 99683

Write your own unique Python program that has a runtime error. Provide the following.

The code of your program.
Output demonstrating the runtime error, including the error message.
An explanation of the error message.
An explanation of how to fix the error.

Expert Answer


[solved] – Question 99684

1. Copy the countdown function from Section 5.8 of your textbook.

def countdown(n):
if n <= 0:
print(‘Blastoff!’)
else:
print(n)
countdown(n-1)

Write a new recursive function countup that expects a negative argument and counts “up” from that number. Output from running the function should look something like this:

>>> countup(-3)
-3
-2
-1
Blastoff!

Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.)

If the number is positive, the program should call countdown. If the number is negative, the program should call countup. Choose for yourself which function to call for input of zero.

Provide the following.

  • The code of your program.
  • Output for the following input: a positive number, a negative number zero.
  • An explanation of your choice for what to call for input of zero.

2. Write your own unique Python program that has a runtime error. Do not copy the program from your textbook or the Internet. Provide the following.

  • The code of your program.
  • Output demonstrating the runtime error, including the error message.
  • An explanation of the error message.
  • An explanation of how to fix the error.

Expert Answer


Answer to 1. Copy the countdown function from Section 5.8 of your textbook. def countdown(n):……

[solved] – Question 99686

Question No..1
Convert a decimal number 724 into its equivalent binary numbers. You are required to show the complete steps of conversion and also write the final answer in its equivalent binary number.

Question No.2

Complete the following truth table by using the stated Boolean logical operations.

ABCA + BA . C(A + B) ⊕ C
000
001
010
011
100
101
110
111

Expert Answer


[solved] – Question 99712

write a C++ program to calculate the sum &
average of an array

Expert Answer


[solved] – Question 99713

write a C++ program to perform various matrix
operations

Expert Answer