Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a program that uses a recursive function to check whether a number is in a list of Sorted numbers. In order to understand recursion

Create a program that uses a recursive function to check whether a number is in a list of

Sorted numbers.

In order to understand recursion read your note from pre-requisite course (district math)

Specifications

The program should begin by generating list of 10 random numbers from 1 to 100.

The program should allow the user to enter a number from 1 to 100. Then, it should display whether that number is or isnt in the list of random numbers.

Use binary search algorithm to search the list of random numbers

Sample console output

Binary Search

Enter 'x' to exit

Random numbers: [13, 16, 18, 29, 32, 71, 71, 77, 78, 90]

Enter a number from 1 to 100: 1

1 is NOT in random numbers.

Enter a number from 1 to 100: 32

32 is in random numbers.

Enter a number from 1 to 100: 100

100 is NOT in random numbers.

Design: Draw an UML class diagram for the class and coding

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions