C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 2.6, Problem 3E
(a)
Program Plan Intro
- linesis aninteger type variable used to store lines required for the number of telephones calculated using the formula.
- nis aninteger type variable used for the number of telephones.
Program Description:The main purpose of the program is to find the number of lines required to directly connect the number of telephones. The given formula to calculate the number of lines required is shown below:
(b)
Program Plan Intro
Program Plan:The following variables are used in this program:
- linesand nare two integer type variables used in this program.
Program Description:The main purpose of the program is to compile and run the program written in the (a) part.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
kh
12
Example 2: find y for the following values of x= 5,3,7 and d=4,7,12
y = x² +
+ 5xd
sin(5d)
Sol1:
[Job sequencing using deadlines]Let us suppose that there are n jobs (J1, J2, … Jn) each of which takes a unit oftime to be processed by a machine and there is just one single machine to processthe jobs. Let us suppose that (d1, d2, d3, …dn) are the deadlines in units of times to complete the jobs and (p1, p2, p3, …pn) are the profits earned if the jobs are processed within the deadline. The objective is obviously to select those jobs and complete them within their deadlines so that maximum profit is earned.Design a greedy method to obtain the optimal sequence of jobs that will earnmaximum profits. Demonstrate it on the case where there are four jobs, with n = 4,deadlines given by (d1 = 2, d2 = 1, d3 = 3, d4 = 1) and profits earned as (p1 = 100,p2 = 20, p3 = 50, p4 = 40).
Chapter 2 Solutions
C++ for Engineers and Scientists
Ch. 2.1 - (Practice) State whether the following are valid...Ch. 2.1 - Prob. 2ECh. 2.1 - Prob. 3ECh. 2.1 - (Practice) Determine names for functions that do...Ch. 2.1 - (Program) a. Using cout, write a C++ program that...Ch. 2.1 - (Program) a. Write a C++ program to display the...Ch. 2.1 - (Program) a. How many cout statements would you...Ch. 2.1 - (Program) a. Assuming your compiler isn’t case...Ch. 2.1 - (Practice) You’re given the task of wiring and...Ch. 2.1 - (Practice) You’re given the job of preparing a...
Ch. 2.1 - (Practice) You’re a sophomore in college and are...Ch. 2.1 - (Practice) You’re given the job of planting a...Ch. 2.1 - (Practice) You’re responsible for planning and...Ch. 2.1 - (Data processing) a. A national medical testing...Ch. 2.2 - (Debug) a. Will the following program work?...Ch. 2.2 - (Modify) Rewrite the following programs to conform...Ch. 2.2 - (For thought) a. When used in a message, the...Ch. 2.2 - (For thought) a. A token of a computer language is...Ch. 2.3 - (Practice) Determine data types appropriate for...Ch. 2.3 - (Practice) Compile and run Program 2.5.Ch. 2.3 - Prob. 3ECh. 2.3 - (Practice) Show how the name KINGSLEY is stored in...Ch. 2.3 - Prob. 5ECh. 2.3 - Prob. 6ECh. 2.3 - Prob. 7ECh. 2.3 - (For thought) Although you have concentrated on...Ch. 2.3 - (Practice) Although the total number of bytes...Ch. 2.4 - (Practice) For the following correct algebraic...Ch. 2.4 - (Practice) Determine the values of the following...Ch. 2.4 - (Practice) Determine the value of the following...Ch. 2.4 - (Practice) Evaluate the following mixed-mode...Ch. 2.4 - Prob. 5ECh. 2.4 - Prob. 6ECh. 2.4 - Prob. 7ECh. 2.4 - Prob. 8ECh. 2.4 - Prob. 9ECh. 2.4 - (Program) Write a C++ program that displays the...Ch. 2.4 - Prob. 11ECh. 2.5 - (Practice) State whether the following variable...Ch. 2.5 - Prob. 2ECh. 2.5 - (Practice) a. Write a declaration statement to...Ch. 2.5 - Prob. 4ECh. 2.5 - Prob. 5ECh. 2.5 - Prob. 6ECh. 2.5 - Prob. 7ECh. 2.5 - Prob. 8ECh. 2.5 - (Practice) a. Using Figure 2.14 and assuming the...Ch. 2.5 - Prob. 10ECh. 2.5 - Prob. 11ECh. 2.6 - (Modify) a. Modify Program 2.11 to calculate the...Ch. 2.6 - (Modify) a. Modify Program 2.11 to determine the...Ch. 2.6 - Prob. 3ECh. 2.6 - Prob. 4ECh. 2.6 - (Conversion) a. Design, write, compile, and run a...Ch. 2.6 - (Hydraulics) a. Write, compile, and run a C++...Ch. 2.6 - (Thermodynamics) a. Design, write, compile, and...Ch. 2.6 - Prob. 8ECh. 2 - (General math) a. Design, write, compile, and run...Ch. 2 - (General math) a. Design, write, compile, and run...Ch. 2 - (Physics) a. Design, write, compile, and run a C++...Ch. 2 - Prob. 4PPCh. 2 - (Hydraulics) a. Design, write, compile, and run a...Ch. 2 - Prob. 6PPCh. 2 - (Physics) a. The weight of an object on Earth is a...Ch. 2 - (Modify) a. Modify the program you wrote for...Ch. 2 - (Civil eng.) The maximum load that can be placed...Ch. 2 - (Civil eng.) Modify the program written for...Ch. 2 - (Mechanical eng.) The minimum radius required for...
Knowledge Booster
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
- 3- Simplify the following equation: f(4, B,C,D) = E(0,3,4,6,10,11,14,15) dm(2,7,8,12) where dm is denoted for don't care.arrow_forwardComputer Science An IT company has branches in 10 cities. In each of the cities, it employs 5 employees. The company carries out 10 different projects and employs 5 employees in each of the projects (not necessarily from the same city). Each employee works in exactly one of the projects. Show that one can choose a group of 10 employees so that there is one employee from each city and one employee from each project in this group.arrow_forwardf(x)=x^2(x-4)(x+2)^2 Bounce(B) or Cross(C) (in ascending order of zeros): Incorrect (So type CBC or BBB or...)arrow_forward
- Build the following function using only 8x1 Mux: F(a,b,c,d,e) = ∑ (0, 4, 8, 16, 17, 20, 22, 24, 25, 31) [NB: Must show MSB & LSB] [NB: The circuit should be cost efficient. Meaning, try to use lowest number of ICs possible for an optimum design]arrow_forward[12] Express the following functions as CSOP and CPOS expressions: (a) F(x,y,z) = (x+y+z)(x+z') + yz (b) F(w, x, y, z)=xy(wz+wz) (w+xz) in terms of x, y, and z in terms of w, x, y, and z [13] Given the following pulse trains for A, B and C, draw the pulse trains for F₁ and F2. B ED F₁ Draw the answers here F₂ B F1 A 1 F2 0 C 0 1 0 1 1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1arrow_forwardsolve pls in excelarrow_forward
- 1- The function F (x,y,z) = x'y' + yz is equivalent to: a ) Ση(2,3 ,4) b) Σm(2,3 ,5) C) Σm(1,2 ,5) d) Σm( 0,1,3,7)arrow_forward(8) Discrete Structure: Please solve it on urgent basis: Question # 8 : Prove that n2−1 is divisible by 8 whenever n is an odd positive integer.arrow_forward4- The function F(A,B,C)=AB + AC is equivalent to: a) [m(2,3,4,6) b) [m(2,3,6,7) c) [m(1,2,5) d) {m(1,5) 5- The function represented by the following 4X1 Multiplexer is a. F=xy+xyz + xz b. F=xy+yz+xz c. F = xy + xyz + xyz d. F=xy+yz+xz NÍN02 10 II 12 13 4X1 Mux 81 80 x y Farrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education