Designing and testing the functionality of the programs

Assignment Help Electrical Engineering
Reference no: EM131217514

Designing and testing the functionality of the following four programs:

Program 1:

Design a program in C which, when executed, will do the following in the indicated sequence:

1. Ask the user to type on the keyboard a user-supplied value of a positive integer number n.

2. The program will then compute, for one time only, using the "for" looping command, the value of what is called here the zNo(n) defined as the series
zNo(n) = 1x2 + 2x3 + 3x4 + ...+ (n-1)xn.

3. The program is then to display on the console the user-supplied value of nas well as the corresponding value of tNo(n) in the format shown below:
n=3===>zNo(3)=20.
Produce two sample outputs, one for n=3 and the other for n=5.

Program 2:
Modify program 1 above using "while" looping so that it computes and then displays on the console computations of zNo(n) for auser-specified value of n as in Program 1 but now in an infinite loop. Your sample output is to display values of n and zNo in the same format as in Program 1 but for the following 5 values of n:
n=2, 3, 4, 5, and 6.

Program 3:
Modify program 1 above using "while" looping so that it computes and then displays on the console computations of zNo(n) for a user-specified valueof n as in Program 1 but now for a user-specified number of timescalled ntimes. Your sample output is to display values of n and zNo in the same format as in Program 1 for the same 5 values of n as in Program 2.

Program 4:
Modify program 1 above using "while" looping so that it computes and then displays on the console computations ofzNo(n) for equally spaced values of n from and including a user-specified starting value of n called nstart to a user-specified ending value of n called nstop, with user-specified equal increment from one value of n to the next value of n called nstep. The output in the present program is to be displayed as a 2-column table with the first column being n and the second column being zNo. The two columns in this table are to be 16 digits wide and the values of n and zNo are to be left justified within the columns. In your computations, use nstart=3, nstop=8 and nstep=2.

Reference no: EM131217514

Questions Cloud

Journal entries to record these transactions and adjustments : Journal Entries for Plant Assets - Stellar Delivery Service had the following transactions related to its delivery truck: Stellar's depreciation policies include (1) using straight-line depreciation, (2) recording depreciation to the nearest whole mo..
Inverse of the elasticity : Own-price elasticity of demand (dQ/dP) P/Q or (dy/dp) p/y. The important point dQ/dP
What is the payback period of the project? what is the profi : What is the payback period of the project? What is the profitability index of the project? What is the IRR of the project? What is the NPV of the project? How sensitive is the NPV to changes in the price of the new smart phone? How sensitive is the N..
Second order condition for profit maximization : Second Order Condition for profit maximization when the output y is the decision variable dMR/dy-dMC/dy
Designing and testing the functionality of the programs : Designing and testing the functionality of the following programs:-  Design a program in C which, when executed, will do the following in the indicated sequence:
Define protected health information : Differentiate between the privacy rule and the security rule as it applies to actual use in the laboratory. Differentiate between identifiable and unidentified information and their uses.
Prepare the journal entry to record the interest received : On January 1, 2013, Hi and Lois Company purchased 13% bonds having a maturity value of $346,400, for $372,004.85. The bonds provide the bondholders with a 11.00% yield. Prepare the journal entry at the date of the bond purchase. Prepare a bond amorti..
Aggregate demand-aggregate supply : The AD-AS (Aggregate Demand/Aggregate Supply) model of GDP (Gross Domestic Product) can help us understand business cycles or fluctuations in economic activity.
What is your recommendation to the board of directors : Through your contacts in the Malaysian financial market, you have managed to obtain the following information: Given the above information, what is your recommendation to the Board of Directors of Lu Bang Gali and why?

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Calculate the required thickness in x-direction of a

calculate the required thickness in x-direction of a silicon wafer in nm to create an 0.2 ev energy difference

  Explain what is the equivalent input noise resistance

What is the equivalent input noise resistance of an amplifier known to produce 20 V of equivalent input noise over a bandwidth of 750 kHz

  Show graphically the gaussian probability density

Show graphically the Gaussian probability density and the corresponding cummulative probability function.- Also give the equation related to it.

  Determine the region of operation

The threshold voltage of each transistor in the figure below is VTn = 0.4V. Determine the region of operation of the transistor in each circuit.

  What is the minimum time between bursts

Assume that the information rate out of the coder is equal to the information rate into the coder. What is the minimum time between bursts if your system is to operate properly?

  What is the probability that it destroys the target

A bombing target is in the center of a circle with a radius of 1 mile. A bomb falls at a randomly selected point inside that circle. If the bomb destroys everything within mile of its landing point, what is the probability that it destroys the tar..

  Design the circuit and select the appropriate components

Design the circuit and select the appropriate components for that circuit to fulfill the requirements of the device. Verify your design by MATLAB simulations

  What potential will be required to reduce photocurrent

The work function of platinum is 4.09ev what retarding potential will be required to reduce the photocurrent to zero in a photoelectric experiment with Pt electrodes if the wavelength of the incident light is 2440 angstrom

  Design a synchronous 0-to-4 binary counter

Draw a timing diagram for your circuit (consider that the propagation delays are negligible).

  Find unit vector that is directed from the midpoint of sides

The three vertices of a triangle are located at A ( -1, 2, 5) , B( -4 , -2 , -3), and C( 1 , 3 , -2) . find a unit vector that is directed from the midpoint of the side AB to the midpoint of the side BC.

  Determine the lump sum amount so that pay back is compled

you borrowed $10000 from a local bank with the agreement that you will pay back the loan in five years the pay back plan includes two parts: a graduated payment plan with the first payment set at 1500 at year 1 and a gradient of $600 afterward

  Find the terminal voltage of the motor and power factor

A three phase synchronous motor has the synchronous reactance of 2.1 Ohm and draws 250 A with a lagging power factor for an excitation voltage of 1327 -15 degree per phase. Find the terminal voltage of the motor and power factor of the motor.

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