Question: SECTION B: PROGRAMMING AND ALGORITHM (15 MARKS] BAHAGIAN B: PENGATURCARAAN DAN ALGORITMA (15 MARKAH) Given to you declaration class structure in STACK.h and QUEUE.h below.
![SECTION B: PROGRAMMING AND ALGORITHM (15 MARKS] BAHAGIAN B: PENGATURCARAAN DAN](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4661dc87b5_95766f4661d2f1a8.jpg)
SECTION B: PROGRAMMING AND ALGORITHM (15 MARKS] BAHAGIAN B: PENGATURCARAAN DAN ALGORITMA (15 MARKAH) Given to you declaration class structure in STACK.h and QUEUE.h below. Write testApplication.cpp to solve question below using combination stack and queue structure. There will one queue object and two stack object. Read a sentence, enqueue each of the character into a queue. Each time reading the character check it whether it is consonant or vowel. Push consonant character into stack consonant and push vowel character into vowel stack. Inside Queue there were only consonant character leave inside. Example of the output shown as below. Diberikan kepada anda struktur pengisytiharan kelas dalam STACK.h dan QUEUE.h di bawah. Tulis testApplication.cpp untuk menyelesaikan soalan di bawah menggunakan struktur timbunan dan giliran. Akan ada satu objek giliran dan dua objek timbunan Baca satu ayat, masukkan setiap aksara ke dalam giliran. Setiap kali membaca aksara, periksa sama ada ja konsonan atau vokal. Masukkan aksara konsonan ke dalam timbunan konsonan dan masukkan aksara vokal ke dalam timbunan vokal. Di dalam giliran hanya ada watak konsonan yang tersisa di dalamnya. Contoh output ditunjukkan seperti di bawah. STACK.h QUEUE. class STACK class QUEUE private: NODE + front; NODE *rear; int count; private: NODE *top; int count: public: STACK(); bool stackEmpty(); bool push (DATA datain); bool pop (DATA &dataout); bool stackTop (DATA &dataout); public: QUEUE(); bool stackEmpty(); bool enqueue (DATA datain); bool de queue (DATA &dataOut); bool queue Front (DATA &dataout); bool queueRear (DATA &dataOut); 1; Insert a sentence: Congratulation You Win Display Queue: CngrtitnYWn Display Vowel Stack: iuooiauao Display Consonant Stack: nWYntitrgnc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
