Write a program that generates a random number

Assignment Help Electrical Engineering
Reference no: EM13268717

An integer is said to be prime if it is divisible by only 1 and itself. Write a function called prime() that takes in one integer number, and returns 1 (true) if the number is prime and 0 (false) otherwise. Write a program that generates a random number between 1 to 100 and calls function prime() to determine if it is prime or not. (You will need to have the program print out the number, and print out whether it is prime or not).

Reference no: EM13268717

Questions Cloud

Find load current in amps current through transmission line : b. To maintain one per unit voltage at rated load, find the per unit generator voltage needed. c. Find load current in amps, current through the transmission line in amps, generator current in amps, and the genertor voltage in volts.
Find the length of a simple pendulum with the same period : A particle with a mass of 0.420 kg is attached to a horizontal spring with a force constant of 34.02 N/m. At the moment t = 0, Find the length of a simple pendulum with the same period
Explain tris to tris-hcl in the resulting buffer solution : After you have added 1 N HCl to adjust the pH of the Tris solution to 8.1, what is the ratio (in mmols) of Tris to Tris-HCl in the resulting buffer solution
What is the range of aperture diameters for the camera : A certain camera has f-numbers that range from 1.1 to 28. If the focal length of the lens is 40 mm, what is the range of aperture diameters for the camera
Write a program that generates a random number : An integer is said to be prime if it is divisible by only 1 and itself. Write a function called prime() that takes in one integer number, and returns 1 (true) if the number is prime and 0 (false) otherwise. Write a program that generates a random ..
Calculate the proper amount of voltage would need to achieve : Suppose you have a 2 kW electric heater rated for 220 volt operation, which you intend to operate at a reduced power dissipation of 1kW. Calculate the proper amount of voltage you would need to achieve this reduced power dissipation
Estimate the damping constant : A vertical spring of spring constant 140N/m supports a mass of 80g. The mass oscillates in a tube of liquid. Estimate the damping constant b
Explain how many mmols of tris would need : How many mmols of Tris would you need to prepare 100 mL of a 100 mM Tris solution
Explain the dilation-erosion-closing and opening operations : explain the dilation, erosion, closing, and opening operations on a binary image B with a structured element S. ( you need to use the symbolic notion for the operators, but need not provide the precise mathematical definitions

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Determine the power factor of the load and the line current

An idustrial plant uses two pieces of equipment. A) A lightining element that comsumes 10 kw when supplied at 100v, 60Hz; and B) A furnance consuming 360 kw and 400 KVAR when supplied at 2000v, 60Hz.

  Define multiplexer with an active low enable

(c) Use a single 4-to-1 multiplexer with an active low enable and an active high output and a minimum of additional gates. Show the function expansion both algebraically and on a Karnaugh map.

  Find the total voltage drop in 200 twisted pair wire

A proportional controller for a rotating antenna has a gain Kp of 5 in-oz/deg. The antenna was initially pointing due south, but was then commanded to point southeast. Find the initial torque supplied to the antenna.

  What two points associated with the load line

Discuss the steps required in calculating the collector-emitter voltage in a VDB circuit. Why does this circuit have a very stable Q point Discuss whether transistors being used as switching circuits should be biased in the active region.

  Determine the magnitude of the armature current

A 440-V three-hase Y-connected synchronous motor has a synchronous reactance of 1.5 ohms per phase. The field current has been adjusted so that the torque angle is 28 degrees when the supplied power to the motor is 90kW.

  At what frequency or frequencies does the maximum gain occur

If a system has a unit-impulse-response of h(t) = 100t * e^(-20t) u(t) , where u(t) is the standard unit step function, then determine the transfer function H(f) for the system. What type of filter is this system (high-pass, low-pass, band-pass, ..

  Write the vbc1 assembly code that resembles behavior

1.)Using the SR0 instruction write the vbc1 assembly code that displays the One-Hot counter from left to right. 2.)Write the VBC1 assembly code that resembles the following behavior

  What are the distinctions between the ways each one is used

explain the use of the Op Amp as a difference amplifier and as a comparator. What are the distinctions between the ways each one is used.

  Design an analog computer circuit to obtain the summing

Design an analog computer circuit (using minimum resistor values of 10 k ohms ) to obtain the summing (adder) function. Vo = -v1 -v2 +v3

  Explain under what conditions ts makes the x is periodic

Consider an analog periodic sinusoid x(t)=cos (3*pi*t +pi/4) being sampled using a sampling period Ts to obtain a discrete time signal x(n)=x(t)|t=nTs = cos(3*oi*Ts*n+pi/4). Choose a value of Ts for which the discrete time signal is x(n)

  Design op amp circuit to produce output vout

design op amp circuit to produce output vout which is related to inputs v1, v2 and v3 by expression vout= -(3v1+5v2+8v3). assume max permitted resistor value= 200k. use only one op amp

  Determine which lead is the gate and which lead is the body

Draw up a flow chart for testing any four-terminal MOSFET with an ohmmeter which can be used to conclusively determine which lead is the gate, which lead is the body, whether the device is an n-channel or p-channel, and whether the device is a D-m..

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