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

  Find the starting torque of the motor

A 460-V, four-pole, 75-hp, 60-Hz, Y connected, three phase induction motor develops its full load induced torque at 1.2 percent slip when operating at 60 Hz and 460 V. The per phase circuit model impedances of the motor are

  How the resistors can be fabricated to non-standard values

You must design a three axis position indicator for the latest robot arm. Using no more than two operational amplifiers, design a circuit that uses three inputs, v1, v2, and v3 to produce an output signal vo=3 v1-2 v2-5 v3.

  Why can''t a video signal such as an ntsc analog television

Why can't a video signal such as an NTSC analog television signal be transmitted over a two km length of loaded twisted pair cable with a frequency range 300 Hz to 3,400 Hz? What is the bandwidth occupied by an NTSC video signal?

  What is average transmitted power and modulation index

What is the bandwidth required so that the modulated signal contains atheist 90% of the power of the unmodulated carrier. A carrier signal c(t) = 10 cos(2pifct) is modulated using a message signal m(t) cos(20pit). The modulation is FM, with kf = 50.

  List the names of the active filters by the voltage gain

List the characteristics of an ideal op-amp. An amplifier has cutoff frequencies fc1 =1.2 kHz and fc2 = 16.4 kHz. Calculate the Bandwidth. List the names of the active filters by their voltagegain(dB) vs frequency graphs.

  What changes should be made to the input to the modulator

When a sinusoidal signal is used to frequency modulate a VHF carrier, the required bandwidth is 200 kHz. It is desired to retain the same modulation index while reducing the necessary bandwidth to 100 kHz.

  Find out the minimum signal to noise ratio

Determine the minimum signal to noise ratio (s/n) in dB required in each communication channel to achieve a data rate of 270 kbps?

  Calculate critical frequency for the input low pass network

Calculate: Critical frequency for the input low pass network, and the output low pass network, estimate the values for Cbe, Cjc, Cbc, and Cje. Concider the resistance of the signal sourceRs to be equal to the 1 ohm resister in series with the source.

  List first three and last two valid network id and address

The building has 49 stories and there are up to 600 devices on each floor. To alleviate traffic on the fiber backbone, you want each floor to be its own subnet. Just list the first three and last two valid network ID's & address ranges

  What would the receiver do to the received bit sequence

(a) Identify the problem with this data. (b) How would the transmitter fix the problem. (Write down the sequence as it would be transmitted.) (c) What would the receiver do to the received bit sequence

  State whether power factor is lagging or leading

The generator is delivering 48 MW to the bus bar at the rated voltage with its field current adjusted for a generated emf of 46 kV per phase. Determine the armature current and the power factor. State whether power factor is lagging or leading

  Design a circuit that lets exactly one full negative pulse

Design a circuit that lets exactly one full negative pulse (from an input train of pulses) pass through to the output, after a button is pushed.

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