rite a program that examines each element of a vector using a for loop. If the element is positive its value is doubled. If the element is negative its value is tripled. Use the ctor v given: = [11 -10 -2 -9 -7 15 11 -1 19 -9 31 13 14 -553 10 11]

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.6: The Standard Template Library (stl)
Problem 8E
icon
Related questions
Question
the variable name v = vNew =
Write a program that examines each element of a vector using a for loop. If the element is positive its value is doubled. If the element is negative its value is tripled. Use the
vector v given:
v = [11 -10 -2 -9 -7 15 11 -1 19 -9 3 1 13 14 -5 53 10 11]
Transcribed Image Text:Write a program that examines each element of a vector using a for loop. If the element is positive its value is doubled. If the element is negative its value is tripled. Use the vector v given: v = [11 -10 -2 -9 -7 15 11 -1 19 -9 3 1 13 14 -5 53 10 11]
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr