Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Array Searching Game You must use a single-dimensional array for this program. You must write a sequential search method to search for the number

C++ Array Searching Game

You must use a single-dimensional array for this program. You must write a sequential search method to search for the number requested by the user.

The following is a sample test, which must be your test case #1. You must also do test case #2 and test case #3 with a different set of data. Each test case must accept at least two lists of integers from the user, and must search at least 3 numbers for each list.

Welcome to play this wonderful number searching game!

Please enter how many integers you would like to play (up to 20, 0 to stop) > 5

Please enter 5 integers in any order> 2 5 3 4 1

Your 5 integers are: 2 5 3 4 1

The largest integer is 5, the smallest integer is 1, the sum of all integers is 15, & the average is 3

Please enter a number to search (-1 to end the search)> 4

The number 4 is found at the position 4

Please enter a number to search (-1 to end the search)> 44

The number 44 is not found.

Please enter a number to search (-1 to end the search)> 1

The number 1 is found at the position 5

Please enter a number to search (-1 to end the search)> -1

Please enter how many integers you would like to play (up to 20, 0 to stop) > 6

Please enter 6 integers in any order> 9 20 5 3 34 18

Your 6 integers are: 9 20 5 3 34 18

The largest integer is 34, the smallest integer is 3, the sum of all integers is 89, & the average is 14

Please enter a number to search (-1 to end the search)> 34

The number 34 is found at the position 5

Please enter a number to search (-1 to end the search)> 19

The number 19 is not found.

Please enter a number to search (-1 to end the search)> 3

The number 3 is found at the position 4

Please enter a number to search (-1 to end the search)> 20

The number 20 is found at the position 2

Please enter a number to search (-1 to end the search)> -1

Please enter how many integers you would like to play (up to 20, 0 to stop) > -1

Please enter how many integers you would like to play (up to 20, 0 to stop) > -4

Please enter how many integers you would like to play (up to 20, 0 to stop) > 0

Thank you for playing this wonderful number searching game. Hope to see you again!

===================================================================.

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

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago