A. Read a sequence of integers up from std input such that: 1. Input will only consist of integers. 2. Valid integers to be read into the program will be between 0 and 99999 only. Otherwise discard them. 3. The integers may be white-space separated on the same line or on multiple lines. 4. The end of the sequence will be denoted by -1. 5. The maximum number of integers that should be read into the program will be 8. 6. The input should be read into a basic integer array. B. Check if each number in the array is a palindrome, i.e. the number is the same if reversed. IMPORTANT: You are not allowed to use any string methods or convert the numbers to text or treat them as characters in any way when trying to check for palindrome. C. Print all the palindrome integers (without any duplicates) in descending order separated by spaces on a single line output.

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

Please solve in C++ or Java

Write a program in your language of choice containing your 'main' and one or more functions you
may need that will:
A. Read a sequence of integers up from std input such that:
1. Input will only consist of integers.
2. Valid integers to be read into the program will be between 0 and 99999 only. Otherwise discard
them.
3. The integers may be white-space separated on the same line or on multiple lines.
4. The end of the sequence will be denoted by -1.
5. The maximum number of integers that should be read into the program will be 8.
6. The input should be read into a basic integer array.
B. Check if each number in the array is a palindrome, i.e. the number is the same if reversed.
IMPORTANT: You are not allowed to use any string methods or convert the numbers to text or treat
them as characters in any way when trying to check for palindrome.
C. Print all the palindrome integers (without any duplicates) in descending order separated by spaces
on a single line output.
D. Use your main for only getting input, invoking other functions and printing output.
E. Do not use Vectors, Collections, or any other data structures provided by the language platform or
any oft-used third party libraries like STL. Do not use strings except to get input if at all. If you do,
you can expect major deductions. However, you are allowed to use your own code from the
programming labs if you like.
F. Execute your program with the following first two samples - 2 runs.
G. Then, run it a third time with the input of the third sample for which no output has been shown.
H. Take a single screenshot showing the output of all 3 runs - your program will not output or
prompt anything other than shown in sample.
I. Your program will be tested with my own input.
Sample Inputs
Sample Outputs
33 101 9876 -1 11111
101 33
|-33 2332 47874 11111
47874 11111 2332 919 88
573 88 2345 919 9898 -1
57 99999 3434 -343 -888
2332 47874 1111
573 88 2345 919 9898
22222 -1
Transcribed Image Text:Write a program in your language of choice containing your 'main' and one or more functions you may need that will: A. Read a sequence of integers up from std input such that: 1. Input will only consist of integers. 2. Valid integers to be read into the program will be between 0 and 99999 only. Otherwise discard them. 3. The integers may be white-space separated on the same line or on multiple lines. 4. The end of the sequence will be denoted by -1. 5. The maximum number of integers that should be read into the program will be 8. 6. The input should be read into a basic integer array. B. Check if each number in the array is a palindrome, i.e. the number is the same if reversed. IMPORTANT: You are not allowed to use any string methods or convert the numbers to text or treat them as characters in any way when trying to check for palindrome. C. Print all the palindrome integers (without any duplicates) in descending order separated by spaces on a single line output. D. Use your main for only getting input, invoking other functions and printing output. E. Do not use Vectors, Collections, or any other data structures provided by the language platform or any oft-used third party libraries like STL. Do not use strings except to get input if at all. If you do, you can expect major deductions. However, you are allowed to use your own code from the programming labs if you like. F. Execute your program with the following first two samples - 2 runs. G. Then, run it a third time with the input of the third sample for which no output has been shown. H. Take a single screenshot showing the output of all 3 runs - your program will not output or prompt anything other than shown in sample. I. Your program will be tested with my own input. Sample Inputs Sample Outputs 33 101 9876 -1 11111 101 33 |-33 2332 47874 11111 47874 11111 2332 919 88 573 88 2345 919 9898 -1 57 99999 3434 -343 -888 2332 47874 1111 573 88 2345 919 9898 22222 -1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 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