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
Tcecarenko [31]
3 years ago
8

Populate a stack with ten random integers and empty it by showing that the order of the elements is reversed, from last to first

.
CODE IN JAVA.

Thanks a Lot!
Computers and Technology
1 answer:
Anuta_ua [19.1K]3 years ago
4 0

Answer:

class Main {  

 public static void main(String args[]) {

   Deque<Integer> stack = new ArrayDeque<Integer>();

   Random rand = new Random();

   for(int i=0; i<10; i++) {

       int n = rand.nextInt(100);

       System.out.printf("%02d ", n);

       stack.push(n);

   }

   

   System.out.println();

   

   while(stack.size() > 0) {

       System.out.printf("%02d ", stack.removeFirst());

   }

 }

}

Explanation:

example output:

31 18 11 42 24 44 84 51 03 17  

17 03 51 84 44 24 42 11 18 31

You might be interested in
This is not an appropriate business use for a wiki. editing corporate documents getting customer feedback project management pub
ivolga24 [154]

The correct answer is A: editing corporate documents.

Further Explanation:

The reason why editing corporate documents would not be an appropriate use of business for wiki would be that false information could be used. This would be released to customers and they would not have the correct information. Anyone can edit Wiki and this can cause confusion.

For business, all information released should be based on facts and researched information. There are numerous other web pages that can be used for a legitimate business purposes.

Learn more about Wiki at brainly.com/question/11936997

#LearnwithBrainly

7 0
3 years ago
Print 1 to 100 in visual basic .6
FrozenT [24]

Answer:

make ( next i ) after ( debug. print ) ​

Explanation:

Its definitely, the above answer. DIM is used for defining a variable which is an integer here. Then the for loop has been used and this will run for 1 to 100 thus as we move under debug,print I. But Next I should come after. Hence first it will be Debug,print I and then the next I .

And hence, the above answer.

The full program will be:

SUB MAIN()

DIM I AS INTEGER

FOR I = 1 TO 100 STEP 1

DEBUG.PRINT I

NEXT I

END SUB

6 0
3 years ago
Call of duty vanguard, war zone , fornite, gta what’s your favorite
tia_tia [17]
Warzone easily but gta a close second
8 0
3 years ago
Taylor develops a prototype for a new smartphone. It only includes code, a way to process the input, a memory card, and a microp
marysya [2.9K]

Answer:

i would say C.output

Explanation:

the program would be the code, the input would be the input, and the memory card would be the memory leaving the output as the only thing forgotten.

6 0
3 years ago
Read 2 more answers
You use the _____ sheet in the format cells dialog box to position data in a cell by centering it, for example.​
Oliga [24]
You use the Alignment sheet in the format cells dialog box to position data in a cell by centering it, for example. Generally along the middle branch is a line or centerline of the definite pipeline on a scale of whatever is indicated.
3 0
3 years ago
Other questions:
  • To track website behavior data with google analytics, which steps will you need to complete?
    14·1 answer
  • What item on a business card is generally the most prominent?
    10·2 answers
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp
    12·1 answer
  • Write a program that reads in any number of MyStrings of characters from the user and determines if each MyString is a palindrom
    14·1 answer
  • When you're working with a word processing document and you press the del key, what happens?
    6·2 answers
  • A computer is an electronic device, operating under the control of instructions stored in its own _______________, that can acce
    7·1 answer
  • Which model represents any process in general?
    6·1 answer
  • You are on vacation with your family and have been nominated to be the family photographer. You have a 13.1-megapixel camera. Wh
    12·2 answers
  • Suppose you decide to use the number of times you see any of the area codes of the places Yanay has been to in 50 spam calls as
    9·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!