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

  What is the overall gain if amplification factors given

an amplifier has three amplification stages and a 1-dB attenuator in cascade. Assuming that all the impedances are properly matched, what is the overall gain if the amplification factors are 5, 10, and 6 dB

  Determine what is the frequency of the waveform

the signal shown below is a sine wave as it might be displayed on an oscilloscope. If it takes 40 msec. for the waveform to travel between the points shown by the arrow "B" below, what is the frequency of the waveform

  Determine the frequency/frequencies of aliasing noise

Determine the frequency/frequencies of aliasing noise.

  Difference between the treated side and the control side

In one test, the experimenter obtained a specimen of connective tissue (collagen) from the steak and determined the temperature at which the tissue would shrink; a tender piece of meat tends to yield a low collagen shrinkage temperature.The data a..

  Calculate the internal resistance

the output voltage of battery drop from 6V .With no load to 5.2V with a load current of 400mA. calculate the internal resistance.

  How to implement 4-to-1 multiplexer with active high output

a) Show how to implement a 4-to-1 multiplexer with an active high output and no enable using two of the 2-to-1 MUXes and a minimum number of additional gates. b) Repeat part (a) for a 4-to-1 multiplexer with an active low output.

  Find the exit velocity of an adiabatic nozzle

Steam enters an adiabatic nozzle at 3.5Mpa and 300C with a low velocity and leaves at 1.6Mpa and 250C at a rate of 0.4kg/s. If the surrounding is 10 at 100Kpa and 18C, find A) The exit velocity B)The 2Nd law efficiency

  List the three mitigation types

In the presentation, the presenter, Mr. Rob Tucker discussed three types of disturbance mitigation responses or measures. List the three mitigation types and give a short definition of each of the mitigation type.

  Find an xc value to put in parallel with the motor

A P=900W electric motor with pf=0.82 lagging is connected to a 240 Vrms 60 hertz source. a) Draw an equivalent circuit showing impedance and phasor values for Vs, R and X. b) Find an Xc value to put in parallel with the motor which corrects the pf to..

  Explain why are differential inputs used in electronics

For pulse oximeter signals for heart rates less than 240 beatsper minute, what do you expect will be the important spectral andother signal characteristics that need to be preserved in an electronic system.

  What should be the value of r to establish 5 ma in circuit

What should be the value of R to establish 5 mA in the circuit?

  Find what is the input power to the transmitter

A collector modulated transmitter has a supply voltage of 48 V and an average collector current of 600 mA. What is the input power to the transmitter. How much modulating signal power is needed to produce 100 percent modulation.

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