Write a user difned fuction that calculates the factorial n

Assignment Help Electrical Engineering
Reference no: EM13285538

The factorial n! of a positive number (integer) is defined by: n! = n(n-1)(n-2)...3*2*1, where 0! = 1. Write a user difned fuction that calculates the factorial n! of a number. For the function name and arguments use y = fact(x), where the input argument y is the value x!. The function display an error message if a negative or a non-integer number is entered when the function is call.

Reference no: EM13285538

Questions Cloud

What is its velocity just before it hits the ground : A catapult launches a test rocket vertically upward from a well, giving the rocket an initial speed of81.0m/sat ground level. What is its velocity just before it hits the ground
Create a table with headers indicating the level number : Construct a matlab program to import the data from Excel (data1.xls), calculate the theoretical weight of each layer of block for a pyramid and indicate which layer's weight does not math the measured value within a tolerance of %10
Determine the conduction parameter and the threshold voltage : Consider a GaAs MESFET. When the device is biased in the saturation region, we find that Id = 18.5µa and Vgs=.35 V and Id=86.2µa at Vgs=.5V. Determine the conduction parameter k and the threshold voltage Vtn.
What is the distance between the two aircraft : An air-traffic controller observes two aircraft on his radar screen. The first is at altitude 750 m, What is the distance between the two aircraft
Write a user difned fuction that calculates the factorial n : The factorial n! of a positive number (integer) is defined by: n! = n(n-1)(n-2)...3*2*1, where 0! = 1. Write a user difned fuction that calculates the factorial n! of a number. For the function name and arguments use y = fact(x)
What are risks and rewards associated with security : Discuss the various types of bonds and how they are used to raise funds by public and private institutions and why is each type of security used, and what are the risks and rewards associated with a particular security?
Compute at what position is the third bead in equilibrium : Two small beads having positive charges 2q and q are fixed at the opposite ends of a horizontal insulating rod, At what position is the third bead in equilibrium
Design power supply decoupling circuit using kemet spice : Design a 3.3V power supply decoupling circuit using Kemet Spice with the following specifications: Impedance of the decoupling circuit is less than 1 ohm between 100KHz and 10MHz and is less than 10 ohms between 10MHz and 3 GHz.
Determine the stock prices for key competitors : AirJet Best Parts, Inc. is concerned regarding recent changes in its stock prices for the company and would like to determine the stock prices for key competitors. Key competitors include Raytheon, Boeing, Lockheed Martin, and the Northrop Grumman..

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Determine the instantaneous power

RC ciruit= Current course (3u(-t) A) in parrallel to 6k ohm resistor and 5uF cap. Determine the instantaneous power absorbed by the resistor at t=(0); 30ms; and 90ms.

  Design logic circuit to detect a winning tic-tac-toe pattern

Design a logic circuit to detect a winning tic-tac-toe pattern of three in a row. The output W=1 if a winning pattern is present. (Assume the X and O circuits are separate but identical) a. Design the X circuit for the following pattern of signals ..

  Define the efficiency of the motor and drive system

If the efficiency of the motor and drive system is 80% and it is fed through a transistor regulator at 12V, what is the mean current through this regulator when the printer is working continuously?

  Calculate the minimum sampling interval

calculate the minimum sampling interval (time period for counting the pulse train) to achieve a speed resolution of 5 rpm, and the number of bits that must be there in the binary counter if the pulse train is to be sampled with this interval for a..

  What is the magnitude of the line voltage at the sending

A balanced three-phase distribution line has an impedance of 1+j8 I per phase. This line is used to supply 3 balanced three-phase loads that are connected in parallel. The 3 loads are L1= 120 kVA at 0.96 leading pf, L2= 180 kVA

  Calculate the average torque and maximum torque

When the two windings are connected to a a.c supply of 50hz, the field current is 0.1A, the armature current is 100A and the phase difference between them is 60 degree. calculate the average torque and maximum torque.

  Design a synchronous sequential circuit with one input line

Design a synchronous sequential circuit with one input line and one output line that recognizes the input string x = 1111. The circuit is also required to recognize overlapping sequence such that if the input string is x = 1101111111010

  Show the transistor level design of the sequence detector

A sequential circuit has one input X, and two outputs Z1 and Z2. The outputs represent the number of 0's that have3 appeared in the last three inputs. For example, X:0110111100001011 Z1:0000000001111100 Z2:1111110010110011

  Sketch the spectrum

sketch the spectrum

  How to add a third tone to the modulating signal

Experiment by changing the amplitudes of the modulating tones, and by adding a third tone to the modulating signal. First establish what you expect , then confirm by computer simulation.

  Calculate the fermi level on each side of the junction

An abrupt silicon pn junction at zero bias has dopant concentrations of Na = 1017/cm3 and Nd = 5 x 1015 cm-3 at T = 300K. (a) Calculate the Fermi level on each side of the junction with respect to the intrinsic Fermi level.

  Determine size of solar cell that is need to power the lamp

Assuming that solar energy is used to charge a storage battery which then in turn is to power a lamp of 40W. Solar cell obtains power at the rate of 100milliwatts per square centimeter, and the sunlight time is 12 hours.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd