1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Juli2301 [7.4K]
3 years ago
5

Write java code that displays all the objects in a stack in the order in which they were pushed onto it. after all the objects a

re displayed, the stack should have the same contents as when you started. files to be submitted: taskademo.java arraystack.java stackinterface.java
Computers and Technology
1 answer:
kolbaska11 [484]3 years ago
7 0
Let's assume you have a stack called "s".
You can very simply print each element out using a for each loop (the iterable (as shown below), or a classic for each loop, if you prefer). This method does not modify the stack in any way.

s.forEach(System.out::println);
You might be interested in
Write a program to draw a text-based graph of a mathematical function f(x)
Makovka662 [10]
I have a very good example of the program you need written on Python. You can use this (sorry for bad tabulation):
import math import math def main(): function = input("Enter a function f(x):\n") x = 0 y = 0 for rows in range(10,-11,-1): for col in range(-10,11,1): x=col roundfx = round(eval(function)) if roundfx == rows: print("o", end="") if rows==0 and col==0 and not rows == roundfx: print("+", end="") if col == 0 and not rows == 0 and not rows == roundfx: print("|", end="") if rows==0 and not col==0 and not rows == roundfx: print("-", end="") else: if not rows == 0: if not col == 0: if not rows == roundfx: print(" ", end="") print() main()
4 0
3 years ago
Using productivity software ensures that the end product will look professional. Please select the best answer from the choices
borishaifa [10]

Answer:

False

Explanation:

5 0
3 years ago
What would be the result of the following code? ages = {'Aaron' : 6, 'Kelly' : 3, 'Abigail' : 1 } value = ages['Brianna']
denis23 [38]

Answer:

This code will no get executed properly.It will give keyerror Brianna.

Explanation:

In this dictionary we defined in the code the there is no key Brianna hence there is no corresponding value to Brianna.So assigning ages['Brianna] to value will obviously give error since there exits no key with this name.So the code will give error.

7 0
3 years ago
Information about a computer file, not the actual data that is contained in the file, is called ______
dangina [55]
Bytes, metadata, storage, documents are what come to mind without know the specifics. Sorry, Hope this helps.
5 0
3 years ago
Read 2 more answers
Someone who wants the credential of skilled training but in less time than a four-year degree should consider
Katyanochek1 [597]
They should consider an associates degree or certifications. =)
8 0
4 years ago
Other questions:
  • Choose all statements that identify the benefits of programming design.
    10·2 answers
  • I want to customize my company's logo, name, address, and similar details in all my business documents what option should use?
    12·1 answer
  • What type of electronic monitoring involves an offender being contacted periodically by telephone or beeper to verify his or her
    5·1 answer
  • Hen using presentation software, what do you do when you "compose a slide"?
    5·1 answer
  • How do I insert a row in between 1 and 2 in excel?
    7·2 answers
  • How to cite a website, like asha.org?
    6·1 answer
  • Please help me answer this question
    14·1 answer
  • In the world of computing,accessibility MOST often refers to what
    12·1 answer
  • mary needs to rename her report.txt file to final_report.txt. which command will allow her to do this?
    10·2 answers
  • Which of the following is the most significant result of technological innovation?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!