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

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 5.4, Problem 3E

(Desk check) Determine the value in total after each of the following loops is executed:

a .   t o t a l   =   0 ; f o r   ( i   =   1 ;   i   < =   10 ;   i   =   i   +   1 ) t o t a l   =   t o t a l   +   1 ; b .   t o t a l   =   1 ; f o r   ( c o u n t   =   1 ;   c o u n t   < =   10 ;   c o u n t   =   c o u n t   +   1 ) t o t a l   =   t o t a l   *   2 ; c .   t o t a l   =   0 ; f o r   ( i   =   10 ;   i   < =   15 ;   i   =   i   +   1 ) t o t a l   =   t o t a l   +   i ; d .   t o t a l   =   50 ; f o r   ( i   =   1 ;   i   < = 10 ;   i   =   i   +   1 ) t o t a l   =   t o t a l     i ; e .   t o t a l   =   1 ; f o r   ( i c n t   =   1 ;   i c n t   < =   8 ;   + + i c n t ) t o t a l   =   t o t a l   *   i c n t ; f .   t o t a l   =   1.0 ; f o r   ( j   =   1 ;   j   < =   5 ;   + + j ) t o t a l   =   t o t a l   /   2.0 ;

Blurred answer
Students have asked these similar questions
(python) Study the following code, specifically the loop.  _sum = 10 for k in range (2, 20, 3):      _sum = _sum + (2*k)      if _sum > 100:          print("exceeded 100")   Now, rewrite the for loop (for k in range(2, 20, 3):)to be a while loop that accomplishes the same objective.  You don't need to show/use the other lines.
5. (Algebra: solve 2 X 2 linear equations) You can use Cramer's rule to solve the following 2 X 2 system of linear equation: ax + by = e cx + dy = f ● x = ed - bf bc ad y = af - ec ad bc - Write a program that prompts the user to enter a, b, c, d, e, and f and display the result. If ad- bc is 0, report that The equation has no solution. Enter a, b, c, d, e, f: 9.0, 4.0, 3.0, -5.0, -6.0, -21.0 Enter x is -2.0 and y is 3.0 Enter a, b, c, d, e, f: 1.0, 2.0, 2.0, 4.0, 4.0, 5.0 Enter The equation has no solution
Need help with this while loop question: (Please do this in Python programming)   Using while True loop that: Prompts the user to enter a word; may use one input statement in function Calculates the number of words entered with an upper case first letter Presses (hits) the Enter/Returns key on the keyboard, without typing anything to signal the end of the loop Once the loops end, the function should return (not print) one of the following messages: "0 words were entered" "Words with upper case first letter = x', where x is the number of words maybe 0 if no words entered had an upper case first letter      The output needs to look like this: (see image attached)

Chapter 5 Solutions

C++ for Engineers and Scientists

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
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Control Structures - while loop - do-while loop - for loop - Goto - break - continue statements; Author: EzEd Channel;https://www.youtube.com/watch?v=21l11_9Osd0;License: Standard YouTube License, CC-BY