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

  What is the concentration of holes in the piece of silicon

If a silicon diffusion is doped with phosphorus (donors) at a concentration of 0.6 x 10^17/cm^3, what is the concentration of holes in this piece of silicon per cm^3 Assume ni = 1.45 x 10^10/cm^3, n = 1000 cm^2/V-s, p = 400 cm^2/V-s

  How much charge flows through the battery in the interval

A typical "deep-cycle" battery (used for electric trolling motors for fishing boats) is capable of delivering 12.6 V and 10 A for a period of 10 hours. How much charge (in columbs) flows through the battery in this interval. How much energy does t..

  Why the ic was pretty much constant for first ohms values

The Ic was measured for different values of a load resistance. It was noticed that Ic was pretty much constant for the first 1900 ohms values, but then it suddenly decreased. Why did that happen

  Compute the complex power for each source and the line loss

The voltage magnitude of source 2 and the phase angles of the two sources is to be kept constant. Compute the complex power for each source and the line loss. Tabulate the reactive powers and plot Q1, Q2, and QL versus voltage magnitude jV1j.

  Determine what is the sampling frequency in a dsp system

The sampling frequency in a DSP system is fs=8 kHz. Anti-aliasing filter used in the system is the second-order Butterworth filter with cutoff frequency of fc=3.4 kHz. What is the percentage of aliasing level at the frequency f=2.5 kHz

  Show the permissible area for the poles of t

A second-order control system has the closed-loop transfer function T(s)=Y(s)/R(s). The system specifications for a step input follow. Show the permissible area for the poles of T(s) in order to achieve the desired response.

  Determine what is the transmission angle

A 5 GHz parallel polarized wave with amplitude 5 V/m is oblique incident from an air of (z 0. The angle of incidence is 53.13 deg. What is the transmission angle

  Determine a three-tap adaptive linear equalizer

assume single pulse of ampltude (+1) transmitted through a band-limited noise free channel.The sampled output of the reciever filter is y y= [0.32 0.98 0.25] Determine a three-tap adaptive linear equalizer when the recieved power is 0.15W.

  What are the majority and minority carrier concentrations

Assume the temperature is 300K and mobilities are u_n = 1300 cm^2/Vs and u_p = 450 cm^2/Vs. a. What are the majority and minority carrier concentrations b. What is the resistivity of the sample c. What is the resistance (end-to-end) of the sample

  Find the equivalent e-field and the implied flux

The solar constant at Earth orbit (1 AU = 1 Astronomical Unit - Sun-Earth distance) is ~1400 Watts/m2. Assuming that this Poynting flux magnitude can be associated with a single E- and Hfield (i.e., E × H ),

  Design a synchronous counter with a count sequence

Design a synchronous counter with a count sequence of all prime numbers between 3 and 15. Give the excitation equations. Map any unused counter states into the state whose output is the largest prime number output by this counter q.

  Estimate the worst-case varation in film thickness

A wafer 100mm in diameter is mounted in an electron-beam evaporation system in which the spherical radius is 40cm. Use Eq. 6.7 to estimate the worst-case varation in film thickness between the center and edges

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