C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
bartleby

Videos

Textbook Question
Book Icon
Chapter 3, Problem 8PP

(Electrical eng.) a. The voltage gain of an amplifier is given by this formula:

v o l t a g e   g a i n = [ 275 23 2 + 0.5 f 2 ] n

f is the frequency in Hz.

n is the number of stages in the amplifier.

Using this formula, write, compile, and run a C++ program to determine the value of the voltage gain for a four-stage amplifier operating at a frequency of 120 Hz. Your program should produce the following display:

At a frequency of xxxxx hertz, the voltage gain is yyyyy

Your program should replace xxxxx with the frequency and yyyyy with the voltage gain.

b. Manually check the value your program produces. After verifying that your program is working correctly, modify it to determine the voltage gain of a 12-stage amplifier operating at a frequency of 9500 Hz.

(a)

Expert Solution
Check Mark
Program Plan Intro

Program Plan:

  • The variable vgis usedto store the voltage gain
  • The variable nis used to storethe number of stages
  • The variable fis used to storethe frequency (in Hertz)
  • A pre-defined function sqrt() is used to find the square root of an argument given.
  • A pre-defined function pow() is used to give a mathematical power to a variable.

Program Description:

The C++ program finds the voltage gain using following formulae:

  voltagegain=[ 275 23 2 +0.5× 120 2 ]4=[ 275 23 2 +0.5×14400 ]4=[ 275 529+7200 ]4=[ 275 7729 ]4=[ 275 87.91]4=[3.12]4=95.802

A formula of a voltage gain is used to find the voltage gain at the stage of four and a frequency of 120 Hz.

Explanation of Solution

Program:

#include <iostream>
#include <math.h>
using namespace std;

int main()
{
float vg; // voltage gain
int n = 4; // number of stages
float f = 120; // frequency(Hz)

// formula
    vg = pow((275/(sqrt(pow(23,2)+(0.5*(f * f))))),4);

    cout <<"At a frequency of "<< f
<<" hertz, the voltage gain is "<< vg;

return 0;
}

Sample Output:

When f = 120 Hz and number of stages = 4

C++ for Engineers and Scientists, Chapter 3, Problem 8PP

(b)

Expert Solution
Check Mark
Program Plan Intro

To check manually if the above program works correctly using the given values.

Explanation of Solution

Given:

Frequency (f) = 120 Hz

Stages (n) = 4

Explanation:

  voltagegain=[ 275 23 2 +0.5× 120 2 ]4=[ 275 23 2 +0.5×14400 ]4=[ 275 529+7200 ]4=[ 275 7729 ]4=[ 275 87.91]4=[3.12]4=95.802

The answer is close to the above output produced by the program.Hence the program is working correctly.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
(java programming language) Given f(x) = x+ x2/2+ x3/3+…… xn/n. Using do-while, write a program to compute f(x) for given x andn. The user should enter x and a positive integer n. Save your file as Q3.Java
( C PROGRAMMING ONLY) 5. Simplicity is Beautyby CodeChum Admin In life, simplicity is beauty. Let's try creating something so simple. Let's create a function that accepts the address of an integer and prints n number of asterisks out of it. For example, if the value of the address passed is 5, then the output would be five asterisks in one line. Instructions: In the code editor, you are provided with a main() function that asks the user for an integer and passes the address of this integer to a function call of the simple() function.This simple() function hasn't been implemented yet so your task is just that, to implement it. This has the following description:Return type - voidName - simpleParameter - address of an integerDescription - prints a line of asterisksDO NOT EDIT THE MAIN FUNCTIONInput 1. An integer Output Enter·n:·5*****
(CANNOT USE ARRAY AND ONLY CAN USE WHILE LOOPS) Write a C++ program that asks the user to enter a positive integer n and then that reads nuser input integers and finally prints the message The numbers you entered are in increasing order if they are in increasing order or the message The numbers you entered are NOT in increasing order if they are not. See the remark below.Remark:- Remember given the numbers a1, a2, a3, ..., an; we say they are in increasing order if a1 ≤ a2 ≤ a3 ≤ .... ≤ an. Moreover remember that if you have only one number from the user input then the number automatically is in increasing order.

Chapter 3 Solutions

C++ for Engineers and Scientists

Ch. 3.1 - (Debug) Determine and correct the errors in the...Ch. 3.1 - Prob. 12ECh. 3.1 - Prob. 13ECh. 3.1 - (General math) The area of an ellipse (see Figure...Ch. 3.1 - Prob. 15ECh. 3.2 - Prob. 1ECh. 3.2 - Prob. 2ECh. 3.2 - (Practice) Write a C++ program that displays the...Ch. 3.2 - Prob. 4ECh. 3.2 - Prob. 5ECh. 3.2 - Prob. 6ECh. 3.2 - Prob. 7ECh. 3.2 - Prob. 8ECh. 3.2 - (Electrical eng.) The combined resistance of three...Ch. 3.2 - Prob. 10ECh. 3.2 - Prob. 11ECh. 3.2 - (Civil eng.) Write a C++ program to calculate and...Ch. 3.3 - Prob. 1ECh. 3.3 - Prob. 2ECh. 3.3 - (Practice) Write C++ statements for the following:...Ch. 3.3 - Prob. 4ECh. 3.3 - (General math) Write, compile, and run a C++...Ch. 3.3 - (General math) If a 20-foot ladder is placed on...Ch. 3.3 - (Physics) The maximum height reached by a ball...Ch. 3.3 - (Transportation) Road construction requires...Ch. 3.3 - Prob. 9ECh. 3.3 - Prob. 10ECh. 3.3 - Prob. 11ECh. 3.3 - Prob. 12ECh. 3.4 - Prob. 1ECh. 3.4 - (Practice) a. Write a C++ program that first...Ch. 3.4 - Prob. 3ECh. 3.4 - Prob. 4ECh. 3.4 - Prob. 5ECh. 3.4 - Prob. 6ECh. 3.4 - (General math) a. Write, compile, and run a C++...Ch. 3.4 - Prob. 8ECh. 3.4 - Prob. 9ECh. 3.4 - (Electrical eng.) For the series circuit shown in...Ch. 3.4 - Prob. 11ECh. 3.4 - Prob. 12ECh. 3.4 - Prob. 13ECh. 3.5 - Prob. 1ECh. 3.5 - Prob. 2ECh. 3.5 - Prob. 3ECh. 3.5 - Prob. 4ECh. 3.5 - Prob. 5ECh. 3.6 - Prob. 1ECh. 3.6 - (General math) The value of p can be approximated...Ch. 3.6 - Prob. 3ECh. 3.6 - (General math) The volume of oil stored in an...Ch. 3.6 - Prob. 5ECh. 3.6 - (General math) The perimeter, approximate surface...Ch. 3.6 - Prob. 7ECh. 3.6 - Prob. 8ECh. 3.6 - Prob. 9ECh. 3 - (General math) a. Write a C++ program to calculate...Ch. 3 - General math) a. Write a C++ program to calculate...Ch. 3 - (General math) Modify the program written for...Ch. 3 - (Biology) The number of bacteria, B, in a culture...Ch. 3 - Prob. 5PPCh. 3 - (Heat transfer) The formula developed in Exercise...Ch. 3 - Prob. 7PPCh. 3 - (Electrical eng.) a. The voltage gain of an...Ch. 3 - (Electrical eng.) a. Write, compile, and run a C++...Ch. 3 - (Electrical eng.) The amplification of electronic...Ch. 3 - (Acoustics) The loudness of a sound is measured in...Ch. 3 - (General math) a. A balance has the following...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Boolean Algebra - Digital Logic and Logic Families - Industrial Electronics; Author: Ekeeda;https://www.youtube.com/watch?v=u7XnJos-_Hs;License: Standard YouTube License, CC-BY
Boolean Algebra 1 – The Laws of Boolean Algebra; Author: Computer Science;https://www.youtube.com/watch?v=EPJf4owqwdA;License: Standard Youtube License