Type on the keyboard a value for the number

Assignment Help Basic Computer Science
Reference no: EM131943400

PROGRAM A:

Consider the problem of a user-specified number N of resistors with user-specified values of resistances connected in series across a battery whose terminal voltage VB is also user-specified. The N resistances are represented by a one-dimensional array R[N]. Design a program in C which will compute in an infinite loop the following:

  1. the equivalent resistance req to the N series-connected resistors,
  2. the current I in the circuit,
  3. the voltage array V[N] representing the voltage across the N resistors, and
  4. the power array P[N] representing the powers dissipated in the N resistors.
  5. The problem is to be solved using the method of call by value in which the calculation and outputting of req, I, V[N] and P[N] is to be performed from within a prototype function called "series" placed after the main function. Note that the formula for the voltage across resistance R[i] is V[i] = R[i] * I, and the power dissipated in resistance R[i] is P[i] = R[i] * I2.

When executed, the program will do the following in the indicated sequence:

1. Ask the user to type on the keyboard a value for the number N of resistors connected in series.

2. Ask the user to type on the keyboard the values R[0], R[1], R[2],.., R[N-1] of these N resistors.

3. Compute and display on the console the value of the equivalent resistance req to the N resistors connected in series which is given by the formula

req = R[0] + R[1] + R[2] + ... + R[N-1.

4. Compute and display on the console the value of the current I in the circuit given by the formula I=VB/req.

5. Compute and display on the console the values of the elements of the voltage array V[N].

5. Compute and display on the console the values of the elements of the power array P[N].

6. Go back to step 1 and repeat the process ad infinitum.

PROGRAM B:

Modify PROGRAM A so that the N resistors are now connected in parallel across the battery. In the present program, the calculation is to be of the equivalent resistance req to the N resistors connected in parallel, the current I supplied by the battery, the current array I[N] representing the currents in the N resistors, and the power array P[N] representing the powers dissipated in the N resistors.

Reference no: EM131943400

Questions Cloud

Protected him or herself from theft : How could the victim have protected him or herself from this theft? What might they consider doing to prevent it from happening again
Compute the anticipated value of the dividends : Compute the anticipated value of the dividends for the next four years. (Do not round intermediate calculations. Round your final answers to 2 decimal places.)
Introduction to computer programming : Introduction to Computer Programming. Why is a case structure an alternative to nested decisions?
What circumstances a record of advice : Under what circumstances a Record of Advice (ROA) can be used instead of a Statement of Advice (SOA)?
Type on the keyboard a value for the number : Consider the problem of a user-specified number N of resistors with user-specified values of resistances connected in series across a battery
How many shares are needed to elect under cumulative voting : How many shares (or proxies) are needed to elect nine directors under cumulative voting? (Do not round intermediate calculations).
How to create a website like flipkart : How to create a website like Flipkart.com? Is wordpress secure enough?
What is the running time of algorithm : Describe an efficient algorithm for determining whether there are two equal elements in S. What is the running time of your algorithm?
Find expected annual incremental after-tax free cash flows : A beauty product company is developing a new fragrance named Happy Forever. There is a probability of 0.52 that consumers will love Happy Forever.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Collect scientific published papers from any digital library

Collect 3 scientific published papers from any digital library, or more but no less. The writer need to read the papers carefully prepare her/his own report.

  Ways of getting employees to implement change

It is stated in the chapter that the three ways of getting employees to implement change are: Tell them what to do; Sell them on what must be done; and Involve them in determining the substance and direction of the change.

  What is the upper bound on efficiency for this formulation

What is the upper bound on efficiency for this formulation as a function of tw and tc?

  Examine-an array definition reserves space for the array

To refer to a particular location or element within an array, we specify the name of the array and the value of the particular element.

  Construct a structure chart, as well as a flowchart

Construct a structure chart, as well as a flowchart and pseudocode,for the following problem. Assume that input record contains a taxpayer's name, the value of personal property belonging to taxpayer, and a code defining the type of a personal ..

  Diagrams to model the system

1. Use entity relationship and use case diagrams to model the system. a) Identify at least four entities. b) Identify the relationships among the entities

  Idle code and results and demonstrate

You can use the Snipping tools or screen print (ctrl + Print Screen) to show the IDLE code and results and demonstrate that your program executed correctly.

  Telecommunication''s impact on business

The objective of this project is to allow you to select an area of telecommunications and evaluate its impact on a particular business. The purpose is to evaluate how a company uses telecommunications to improve its strategic or competitive advantage..

  Network components with access to the user database

As your network grows and security items are assessed, other network components need to access the same database of users. What strategies can you employ to provide the other network components with access to the user database?

  Computer name, domain, and workgroup settings

Create RAID 1 array for DC1 a. Open "Disk Management"

  Withdraw annually in equal beginning of year

How much could he withdraw annually in equal beginning of year amounts starting at the time he makes his last deposit and continuing for a total of 20 years

  How it is related to recursion

find out what the Droste effect is, how it is related to recursion, and why it's called the Droste effect.

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