Exercise 4.2: Write a C++ program for a number Find ME game. The use will input 15 different integer numbers. The program will find the input number is already existing or inputted in the array display "The number already exists!", otherwise you program will ask another value. Then the user will input anothe number. Your program will find the nearest value/s (next an back) in the array with following criteria's • if entered number doesn't exist, display "The input numbe does not exist" and ask again to enter number. • If the entered number is the last number in the array displa

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Sample input/Output:
Input value 1: 13
Input value 2: 18
Input value 3: -9
Input value 4: 1
Input value 5: 0
Input value 6: 15
The number already exists!
Input value 6: 10
Input value 7: -34
Input value 8: 76
Input value 9: 8
Input value 10:100
The number already exists!
Input value 10: -7
Input value 11: 25
Input value 12: 37
Input value 13: 49
Input value 14: 45
Input value 15:-20
Input number to find: 17
The input number does not exist
Input number to find: 49
Back number: 37
Next number: 45
If Input number to find: -20
Back number: 45
Next number: The input number is last number so no next
number exist
If Input number to find: 13
Back number: The input number is first number so no last
number exist
Next number: 18
Transcribed Image Text:Sample input/Output: Input value 1: 13 Input value 2: 18 Input value 3: -9 Input value 4: 1 Input value 5: 0 Input value 6: 15 The number already exists! Input value 6: 10 Input value 7: -34 Input value 8: 76 Input value 9: 8 Input value 10:100 The number already exists! Input value 10: -7 Input value 11: 25 Input value 12: 37 Input value 13: 49 Input value 14: 45 Input value 15:-20 Input number to find: 17 The input number does not exist Input number to find: 49 Back number: 37 Next number: 45 If Input number to find: -20 Back number: 45 Next number: The input number is last number so no next number exist If Input number to find: 13 Back number: The input number is first number so no last number exist Next number: 18
Exercise 4.2:
Write a C++ program for a number Find ME game. The user
will input 15 different integer numbers. The program will find if
the input number is already existing or inputted in the array,
display "The number already exists!", otherwise your
program will ask another value. Then the user will input another
number. Your program will find the nearest value/s (next and
back) in the array with following criteria's
• if entered number doesn't exist, display "The input number
does not exist" and ask again to enter number.
• If the entered number is the last number in the array display
only back number and for next display "The input number
is last number so no next number exist" same like that for
first number in the array
Sample input/Output:
Input value 1: 13
Input value 2: 18
Input value 3: -9
Input value 4: 1
Input value 5: 0
Input value 6: 15
The number already exists!
Input value 6: 10
Input value 7: -34
Input value 8: 76
Input value 9: 8
Input value 10:100
The number already exists!
Input value 10: -7
Input value 11: 25
Input value 12: 37
Input value 13: 49
Input value 14: 45
Input value 15: -20
Input number to find: 17
The input number does not exist
Input number to find: 49
Back number: 37
Next number: 45
Transcribed Image Text:Exercise 4.2: Write a C++ program for a number Find ME game. The user will input 15 different integer numbers. The program will find if the input number is already existing or inputted in the array, display "The number already exists!", otherwise your program will ask another value. Then the user will input another number. Your program will find the nearest value/s (next and back) in the array with following criteria's • if entered number doesn't exist, display "The input number does not exist" and ask again to enter number. • If the entered number is the last number in the array display only back number and for next display "The input number is last number so no next number exist" same like that for first number in the array Sample input/Output: Input value 1: 13 Input value 2: 18 Input value 3: -9 Input value 4: 1 Input value 5: 0 Input value 6: 15 The number already exists! Input value 6: 10 Input value 7: -34 Input value 8: 76 Input value 9: 8 Input value 10:100 The number already exists! Input value 10: -7 Input value 11: 25 Input value 12: 37 Input value 13: 49 Input value 14: 45 Input value 15: -20 Input number to find: 17 The input number does not exist Input number to find: 49 Back number: 37 Next number: 45
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY