Write a user-defined function that calculates the factorial

Assignment Help Electrical Engineering
Reference no: EM13268585

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-defined function that calculates the factorial n! of a number. For function name and arguments use y=fact(x), where the input argument x is the number whose factorial is to be calculated, and the output argument y is the value x!. The function displays an error message if a negative or non-integer number is entered when the function is called. Use fact with the following numbers: 12! 0! -7! 6.7!

Reference no: EM13268585

Questions Cloud

Calculate the value of inverter output voltage vo : A CMOS inverter has its nMOS transistor in non-saturation and its pMOS transistor in saturation. Kn = 50A/V2, Kp = 25 ?A/V2, Vtn = 0.5 V, Vtp = -0.6 V, (W/L)n = 2, (W/L)p = 4, IDD = 11 A, and VDD = 2 V. Calculate the inverter output voltage VO.
Explain resulting in a change of pressure : If a temperature of a gas at 1.00atm and 8.00C is increased, resulting in a change of pressure, which equation would you use to calculate the new pressure.
Calculate the present value of each dividend for years : Company is growing quickly. Dividends are expected to grow at 20 percent per year during the next three years, 10 percent over the following year, and then 6 percent per year thereafter. The required rate of return on this stock is 12 percent. The..
What force does the tractor exert on the trailer : A farm tractor tows a 4830 kg trailer up a 15.5° incline at a steady speed of 2.0 m/s. What force does the tractor exert on the trailer
Write a user-defined function that calculates the factorial : 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-defined function that calculates the factorial n! of a number. For function name and arguments use y=fact(x)
Determine the radius of the smallest possible circle : A small 0.280-kg object moves on a frictionless horizontal table in a circular path of radius 4.30 m. The angular speed is 8.02 rad/s.what is the radius of the smallest possible circle on which the object can move
which suffers the least percentage price decline : Which bond suffers the greatest percentage price decline? Why? Which suffers the least percentage price decline? Why?
Explain how many more liters of water in a gallon : if a container can hold 2.0 gallons and 5.0 liters of water are added, how many more liters of water can be added to completely fill the 2.o gallon container? [ 1 gallon = 4 qts]
Plot the time path of the prices for each of the two bonds : Plot the time path of the prices for each of the two bonds (x-axis = years to maturity; y-axis = bond value)

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Lithium ion battery technology

The paper includes Lithium ion battery technology with its advantages and disadvantages. The paper discusses about the Lithium air battery in which detailed reactions of Lithium with air including nonaqueous as well as aqueous are given.

  Power transformers and tariffs

Construction of different types of power transformer, significant energy savings

  Paper on orthogonal frequency-division multiplexing

This document is shown a paper on Orthogonal frequency-division multiplexing with advantages, disadvantages and uses.

  Function of the hmi in a scada system

This assignment contains electronics engineering questions like State the commonly found components of a SCADA (Supervisory control and data acquisition) system. and decribe the function of the HMI in a SCADA system.

  Resultant waveform of the odd harmonic series

Prepare an Excel graph showing the individual components and summated resultant waveform of the odd harmonic series resulting in an approximate square wave.

  Explain scada system

Explain the function of the HMI in a SCADA system.

  Design a 2-digit 24 second shot-clock

Design a 2-digit 24 second "shot-clock" countdown timer with pushbutton controller.

  Model a discrete-time system

To understand di erent signal models To be able to model a discrete-time system and design simple signal processing algorithms.

  Draw a relay construction diagram

Draw a relay construction diagram and briefly explain the operation of a relay.

  Frequency division multiplexing

Write a short technical report on Frequency Division Multiplexing

  Impact of electron energy

Briefly discuss the impact of electron energy, electron current and target on the Bremsstrahlung generated.

  Traffic light controller

The schematic of the traffic light controller

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