Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Implementation of Stack ADT Operations using Array

Encode the given source code and provide the needed statements which will complete the program.

1. Take note of the following:

• push() is a method that will insert an element at the top of the stack

• pop () is a method that will delete the top of the stack

• peek() is a method that will return the top of the stack

2. Include the following push operations in your code, specifically in the main method:

• push(10)

• push(23)

• push(4)

• push(36)

• push(12)


After compiling and running your code, it is expected that the sample output below will display in your screen.


My Stack Operations

1. Size of stack after push operations: 5

2. Top of the Stack: 12

3. Pop elements from stack : 12 36 4 23 10

4. Size of stack after pop operations : 0





Develop a Java GUI application that will display the petrol cost per litre for three different cities with a time span of three years. Q.1.1 On the form create a list box, to allow a user to select between three different cities. Also create a combo box for the user to select the year. Finally add a submit button. Once the user has selected a city, year and clicked the submit button display the petrol price per litre for that year. Use the following table for the city and yearly petrol prices per litre:


Write a Java application and use a Two dimensional array to store five Dutch, French and Italian



translated words. Use a single array to store the English words.



Your program must:



Q.2.1 Contain a single array to contain the following five English words and a Two



dimensional array to store the following Dutch, French and Italian translated words.



ENGLISH WORD DUTCH WORD FRENCH WORD ITALIAN WORD



sky hemel ciel cielo



run rennen courir correre



study studie etude studia



music muziek musique musica



dog hond chien can

Write a Java application and use a Two dimensional array to store five Dutch, French and Italian


translated words. Use a single array to store the English words.


Your program must:


Q.2.1 Contain a single array to contain the following five English words and a Two


dimensional array to store the following Dutch, French and Italian translated words.


ENGLISH WORD DUTCH WORD FRENCH WORD ITALIAN WORD


sky hemel ciel cielo


run rennen courir correre


study studie etude studia


music muziek musique musica


dog hond chien can

Roll a die from N faces M times and count how many times face X came out (N, M and X chosen by the user)


write a program to read the last word from a file and print to output screen.


 Write 2 program to create a file. input user defined data entered from keyboard and write to the file. Read the contents of the file in reverse order and store to another file.


  1. How real world problems can be solved with the help of object oriented programming? Elaborate at least five real world examples in your own words
  1. Design a nested structure by considering the production of at least 5 fruits in Pakistan’s provinces. Consider suitable attributes of fruits, names of use defined constructs must be user friendly. Use proper string messages to make your program readable.  

. Write a C++ program which takes electric units consumed and rate per unit as input

from user. Also take general sales tax (%), tv license fee and bank charges as input.

Calculate total payable amount for user and display on screen both Total amount

payable and amount without gst, bank Fee and tv fee.


LATEST TUTORIALS
APPROVED BY CLIENTS