User-specified values of resistances connected

Assignment Help Basic Computer Science
Reference no: EM131944857

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].

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

7. 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: EM131944857

Questions Cloud

Explain the concept of ip addresses : What is the relationship between this setup and the concept of IP addresses with TCP port numbers?
Introduction to computer programming : Why is a case structure an alternative to nested decisions? If possible include photo (flowchart).
What systems does your organization utilize : What systems does your organization utilize, either as a whole or per department? Is this solution effective? Why or why not? Is there a solution that would.
Research - Challenges of Accounting in Global Organizations : HI6008 Business Research Assignment - Please find below the potential business research topic - Challenges of Accounting in Global Organizations
User-specified values of resistances connected : Consider the problem of a user-specified number N of resistors with user-specified values of resistances connected in series across a battery
Find the cost of capital for delphi automotive plc : Delphi Automotive PLC has a beta of 2. and the expected market return is 0.1. find the cost of capital for Delphi Automotive PLC.
E-commerce multivendor website from scratch : How much time & money to spend in creating an e-commerce multivendor website from scratch?
Describe an efficient algorithm : Describe an efficient algorithm for determining whether there are two equal elements in S.
Briefly describe how cryptography is applied in atm : Briefly describe how cryptography is applied in ATM, SSL, digital signatures, hashes and drive encryption.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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