Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Write a program that outputs the difference (absolute value) between any successive (adjacent) pair of numbers in an integer list. Such a list might
C++ Write a program that outputs the difference (absolute value) between any successive (adjacent) pair of numbers in an integer list. Such a list might represent daily stock market prices or daily temperatures, so the difference is the biggest singleday change. Part I: First let the user input an integer that represents the list size. Once that is done allow the user to enter all the elements of the list without a prompt since the input has to be done inside a loop. Use the format below: (80 Points) Enter the list size: [..Q Example: If the input is: 6 then the user will have to input 6 integers such as: 60 63 53 58 62 68. For this example the output would be: Biggest difference: 10 Part II: Update the code to also output which pair of numbers in the list produce the biggest difference. Using the example from part I the output would be number 2 and number 3. Use the format below: (20 Points) Biggest pair: 2 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started