How to make the value of pi a constant in the program

Assignment Help Electrical Engineering
Reference no: EM13281322

Write a complete program for Visual C++ to calculate and display the volume of a cylinder, given its radius and height. Your program must meet the following requirements:
· Your program should prompt the user to input the radius and height. The program should output the result with three digits after the decimal point. The output should include some explanatory text.
· Make the value of PI (3.14159) a constant in your program.
· The volume formula is PI * radius2 * height.
· Valid input is any real number greater than 0 for the radius and height of the cylinder. Your program should consider a negative input as an error and output an error statement. Do not do any calculations in this case.
· Make sure you use the appropriate data types for everything

Reference no: EM13281322

Questions Cloud

Find the company weighted average cost of capital : The company's cost of capital is the cost of debt is 4.61, the cost of common equity is 5.23, and cost of preferred equity is 6.67. What is the company's weighted average cost of capital?
Compare and contrast 3g wireless networks to 4g networks : Compare and contrast 3G wireless networks to 4G networks in terms of Services and applications, Network architecture, Data throughput and user perceptions
Determine the primary and secondary turns of transformer : A 2400-115V transformer has a sinusodial flux expressed by φ=0.113 sin 188.5t. determine the primary and secondary turns.
Find the option price using a replicating portfolio : We have a call option c with maturities 3,0,0,0 (respective to the stock maturities) with a .25 probability. How do we find the option price using a replicating portfolio?
How to make the value of pi a constant in the program : Valid input is any real number greater than 0 for the radius and height of the cylinder. Your program should consider a negative input as an error and output an error statement. Do not do any calculations in this case.
Explain importance of using structured innovation process : Explain the importance of using a structured innovation process in your organization to enable innovation.
Find the orbital speed of the second satellite : A satellite is in a circular orbit around an unknown planet. The satellite has a speed of 1.19 x 104 m/s, What is the orbital speed of the second satellite
Define kc for the reaction if the equilibrium concentrations : Determine the value of Kc for the following reaction if the equilibrium concentrations are as follows: [PCl5]eq = 0.56 M, [PCl3]eq = 0.23 M, [Cl2]eq = 4.4 M. PCl5(g) PCl3(g) + Cl2(g)
Describe a product ideation model or methodology : Research and describe a product ideation model or methodology. Describe the ideation approach and how you might use it in your collaboration assignment for this module.

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Determine the n-point dft of the n-point sequence

Determine the N-point DFT X[n] of the N-point sequence x[n]=sin(ωon), 0≤n≤N-1, for ωo ≠ 2∏r/N, where r is an integer in the range 0

  Calculate the value required for the resistor labeled r

On a breadboards, hook up an IR LED to provide an infrared light source for signaling the phototransistor as shown in Figure 2 below. Use a pushbutton switch to turn the IR LED on and off.

  Determine what is the maximum zener current allowed

1. What is the primary use for a Zener diode 2. Name 4 opto-electronic devices. 3. For an ideal Zener, is the Zener voltage is 15v and the power rating is 750mW, what is the maximum zener current allowed

  Estimate the number of windmills that would be required

the total amount of electricity that could potentially be generated from wind in the U S has been estimated at 10.8*10^9 Mw-hr annually , if one tenth of this potential is developed, estimate the number of 2 Mw windmills

  Find the vswr coefficient of a 50 ohm transmission line

A 50 ohm transmission line is terminated to the load (60-40j) ohm. How far from the load, a short ckt stub of a fix length of λ/8 needs to be placed so the minimum voltage standing wave ratio (VSWR) between generator and stub achieved. Find the VS..

  Determine the frequency range and tuning ratio of reciever

A superheterodyning FM receiver was originally designed and built to operate in the US only. The FM broadcasting band in the US is from 87.5 MHz to 108 MHz. The intermediate frequency of the receiver is fI = 10.7 MHz. This receiver has a poor RF B..

  Find expressions for the current-power and stored energy

The voltage across a 1-µF capacitor is given by v(t)=100 e-100t . Find expressions for the current, power, and stored energy. Sketch the waveforms to scale versus time.

  Find the mmf required to get an air gap flux of lines

The core is made of cast steel. Find the MMF required to get an air gap flux of 60,000 lines. The cross sectional area of the center section and air gaps is 4 in^2. The remaining sections have a cross sectional of 6 in^2.

  What is average value and the signal power of x

A discrete-time signal x[n] is periodic with period 8. One period of its DFT harmonic function is {X[0],...,X[7]}={3,4+ j5,- 4 - j3,1+ j5,- 4,1- j5,- 4 + j3,4 - j5}. (a) What is the average value of x[n] (b) What is the signal power of x[n]

  Calculate reactive power of motor and the net power factor

A 220V , 13.47KVA, 0.707 lagging power factor load is in parallel with a three phase wye- connected round rotor synchronous motor having a synchronous reactance of 1.27W. The motor draws 33KW at apower angle of 30 degree.

  Calculate time taken to raise temperature of one litre water

The heater element of an electric kettle has a constant resistance of 100 Ω ohm and the applied voltage is 250 V. Calculate the time taken to raise the temperature of one litre of water from 15°C to 90°C assuming that 85% of the power input

  What is the total impedance of the transmission line

The impedance of the transmission line is 2+j4 mega-ohms per kilometer. What is the total impedance of the transmission line. The solutions manual of my book has the impedance of the transmission line being 0.2+0.4j.

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