Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a function named isAscendingList that reads in from the user a list of numbers until the user enters 0. It will return true

C++

Write a function named "isAscendingList" that reads in from the user a list of numbers until the user enters 0. It will return true if the list of number is in ascending or descending order and false otherwise. In addition, it also returns the how many numbers that the user has entered.

For example, if the user enters 10, 30, 40, 0, it will return true and 3 for three numbers. If the user enters 50, 10, 40, 30, 0, it will return false and 4 for four numbers. If the user enters 0 immediately, it will return true and 0.

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

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions