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

  Lithium ion battery technology

The paper includes Lithium ion battery technology with its advantages and disadvantages. The paper discusses about the Lithium air battery in which detailed reactions of Lithium with air including nonaqueous as well as aqueous are given.

  Power transformers and tariffs

Construction of different types of power transformer, significant energy savings

  Paper on orthogonal frequency-division multiplexing

This document is shown a paper on Orthogonal frequency-division multiplexing with advantages, disadvantages and uses.

  Function of the hmi in a scada system

This assignment contains electronics engineering questions like State the commonly found components of a SCADA (Supervisory control and data acquisition) system. and decribe the function of the HMI in a SCADA system.

  Resultant waveform of the odd harmonic series

Prepare an Excel graph showing the individual components and summated resultant waveform of the odd harmonic series resulting in an approximate square wave.

  Explain scada system

Explain the function of the HMI in a SCADA system.

  Design a 2-digit 24 second shot-clock

Design a 2-digit 24 second "shot-clock" countdown timer with pushbutton controller.

  Model a discrete-time system

To understand di erent signal models To be able to model a discrete-time system and design simple signal processing algorithms.

  Draw a relay construction diagram

Draw a relay construction diagram and briefly explain the operation of a relay.

  Frequency division multiplexing

Write a short technical report on Frequency Division Multiplexing

  Impact of electron energy

Briefly discuss the impact of electron energy, electron current and target on the Bremsstrahlung generated.

  Traffic light controller

The schematic of the traffic light controller

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