الموضوع: Assignment 3
عرض مشاركة واحدة
قديم منذ /27-04-2017, 09:53 PM   #12

Turki_81
طالب جديد

Turki_81 غير متواجد حالياً

 

مواضيعي | ردودي

 رقم العضوية : 15839
 تاريخ الإنتساب : Jul 2015
 المشاركات : 25
 الجنس : ذكر
 مستوى التقييم : Turki_81 is on a distinguished road
النقاط : 0

شكراً: 3
تم شكره 0 مرة في 0 مشاركة
افتراضي


Third Q :

create two Stack objects, insert given elements in the question.
then do a while loop with base condition (! obj1.isEmpty && ! obj2.isEmpty)
then assign the top of each stack by using (obj.pop() for both objects) to a variables. And assign these variables to anew “ sum” variables.
After that do the print statement to printout as given sample output .
Then you may do “if statement” to check whether the stack isEmpty or not
In same time to print the other stack remaining elements in case there is so.








التعديل الأخير تم بواسطة Turki_81 ; 28-04-2017 الساعة 12:59 AM
  رد مع اقتباس