(Electrical eng.) You’ve been asked to write a C++ program to calculate the total resistance of a series circuit. In this circuit, the total resistance is the sum of all individual resistance values. The circuit consists of a number of 56-ohm, 33-ohm, and 15-ohm resistors.
a. For this
b. How many inputs does this problem have?
c. Determine a formula for converting input items into output items. The number of 56-ohm resistors is m, the number of 33-ohm resistors is n, and the number of 15-ohm resistors is p.
d. Test the formula written for Exercise 1c using the following sample data:
Trending nowThis is a popular solution!
Chapter 1 Solutions
C++ for Engineers and Scientists
- In matlab code Find the velocity of mars, earth, venus. In the descent phase of an extraterrestrial space mission, a spacecraft free falls through the planet's atmosphere. As it falls, it will reach a constant or terminal velocity when the air resistance force balances the gravitational attraction force. The terminal velocity is given by V₁ = where m is the spacecraft's mass [m], g is the acceleration due to gravity on the planet, p is the atmosphere's density [kg/m³], Cp is the spacecraft's drag coefficient, and A is the spacecraft's cross-sectional area [m²]. a) Write a function named terminalVelocity which calculates the terminal velocity an object. The function should . 2mg pCDA input m, g, p, CD, and A output the terminal velocity b) Write a program named q03.m which calculates the terminal velocity of a spacecraft at 10 km above the surface of various planets. The spacecraft's properties are m = 240 [kg], A= 15 [m²], and Cp = 0.5. The program should use the gravity and terminal…arrow_forward(c program only) 2. Jack `N Poyby CodeChum Admin Jack `N Poy is a very common game since our childhood days. Just thinking about it makes me reminisce how I crushed my cousin in this game until he cried ? I want to feel the glory again of being very good at something. Could you help me recreate the game? It's really simple. In Jack `N Poy, there are two players who both select either one of the following options: RockPaperScissors The winner is selected depending on the following rules: Rock beats ScissorsScissors beats PaperPaper beats RockIf both players chose the same option, then it's a tie Instructions: In the code editor, you are provided with an enum called option which contains three possible named values:ROCK - 'r'PAPER - 'p'SCISSORS - 's'Your task is to ask two users for there chosen options. And then based on their options, determine the winner.Input 1. Option selected by Player 1 2. Option selected by Player 2 Output If Player 1 wins, print the message "Player 1…arrow_forwardI need help with Problem 4 using C++. Thanksarrow_forward
- Question The refractive index of Sodium Chloride is 1.54. Make a function by which user can Find the critical angle of diamond by taking Air as a rare medium (Refractive index of Air is 1). Note: (User Take different incident Angles as a Input)arrow_forwardEXAMPLE: The sum of any two even integers is even. Answer: Proof. (direct) Suppose x and y are even integers. By definition of even, let x = 2k and y = 2j for some integers j and k. Then, x+y=2k+2j = 2(k + j) Note that k+j is an integer because it is the sum of integers. Therefore, by definition of even, x + y is even.arrow_forward---BOOLEAN FORMULAS TO CIRCUITS--- The following question requires you to draw circuit diagrams. Draw these out, for each of these problems, translate the given formula directly, without any simplifcation. 5.) Write `AB + C` as a circuit.arrow_forward
- use c++.arrow_forward(Heat transfer) The energy radiated from the surface of the sun or a planet in the solar system can be calculated by using Stefan-Boltzmann's Law: E = o x T4 E is the energy radiated. o is Stefan-Boltzmann's constant (5.6697 x 10-8 watts/m2K4). Tis the surface temperature in degrees Kelvin (°K = °C + 273). a. Determine the units of E by calculating the units resulting from the right side of the formula. b. Determine the energy radiated from the sun's surface, given that the sun's average temperature is approximately 6000°K.arrow_forward(b) Write down a Boolean formula for the function f, given the following truth table. [You may use any reasonable notation, but you must be consistent.] a b с f(a,b,c) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1arrow_forward
- (C PROGRAMMING ONLY!) Your task is to fill in the blank with the correct condition. 5. Finding the Impostorby CodeChum Admin There's this Dog game I played where a group of Dogs gather together and complete missions. One of them though is an impostor because it is not a real dog; its breed is not a dog breed. Your task is to find that impostor. To do this, you need to check Instructions: In the code editor, you are provided with the enum, DogBreed. Furthermore, an initial main() code is provided for you where the user is asked for what the breed of the Dog.Then, in lines 18 - 22, a partial code to check if the breed is valid or not is given.Your task is to fill in the blank with the correct condition. Make sure to use the values of the enum, DogBreed in checking. Input 1. Dog Breed Output Input the breed of the dog: 2Yup, the breed is validarrow_forward: Practical questiod 1. Write a C program for Arduino thar controls a set of two traffic lights A & B at a crossmadk. Assume that: When the traffic lighus (A) are green or amber, the traffic lights (B) are red. • When the traffic lights (B) are green or amber, the raffic lights (A) are red. Green lights must stay on for 15 seconds, amber lights for 5 seconds and red lights for 20 seconds. 2. Sketch the circuit diagram to wire the Arduina to the two traffic lights. O COr cone COn cone O csea csas ca R/W? RIW /N RIN N bits TOVO Mode ТОР OCRO COne 2:0 Set bits HGO Under Fast PWM 00 Normal immediate 00 K11 Normal operation, ocer disconnected 001 Phase Correct PWM on TOP OXFF Normal operation, OCcBA disconnected, 01 011 Clear Timer n Compee match ICTO 010 OCROA immediate aFF Ocen reserved OCBA toggles on Compare match, 011 Fast PWM exFF 01 111 ocon reserved 100 Reserved Clear OCex on Compare Match, Set OCex at ex0. inon-inverting mode) 10 101 Phase Correct PWM OCROA on TOP exee 110 Reserved…arrow_forwardPlease type itarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr