Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

How will the product affect the stores' overall image?

Answered: 1 week ago