Queue management part3. Your Queue class is up and working in a customer service company. The company opens up a new b | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Queue management part3. Your Queue class is up and working in a customer service company. The company opens up a new b

Your Queue class is up and working in a customer service company. The company opens up a new branch and asks you to make another version of the Queue for them. The only difference is the way the Queue is displayed: each number on a new line. You decide to create a new class called Queue2, which is derived from the Queue class and overrides the print() method, outputting each element of the queue on a new line

21st Sep 2022, 2:24 AM
Niranjan Kumar Yadav
Niranjan Kumar Yadav - avatar
2 Antworten
0
#include <iostream> using namespace std; bool isPalindrome(int x) { //complete the function } int main() { int n, num, digit, rev = 0; cout << "Enter a positive number: "; cin >> num; n = num; do { digit = num % 10; rev = (rev * 10) + digit; num = num / 10; } while (num != 0); cout << " The reverse of the number is: " << rev << endl; if (n == rev) cout << " The number is a palindrome."; else cout << " The number is not a palindrome."; return 0; }
29th Sep 2022, 1:17 PM
Niranjan Kumar Yadav
Niranjan Kumar Yadav - avatar
- 1
Hi! Please, show here your code attempt.
21st Sep 2022, 5:45 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar