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
Hitman42 [59]
2 years ago
11

Please help! Program with Variables

Computers and Technology
1 answer:
Elza [17]2 years ago
5 0

Ask anything here: https://www.answers.com/search?q=Ask%20any%20question&filter=all

You might be interested in
Suppose that you are asked to modify the Stack class to add a new operation max() that returns the current maximum of the stack
Advocard [28]

Answer:

Following are the code to the given points:

Explanation:

For point 8.1:

public String max()//defining a method max

{

   String maxVal=null;//defining a string variable that holds a value

   for(int x=0;x<n;x++)

   {

       if(maxVal==null || a[i].compareTo(maxVal)>0)//defining if blok to comare the value

       {

           maxVal=a[i];//holding value in maxVal variable

       }

   }

   return maxVal;//return maxVal variable value

}

For point 8.2:

public void push(String item)//defining a method push that accepts item value in a parameter

{

       a[n]=item;//defining an array to hold item value

       if(n==0 || item.compareTo(maxVals[n-1])>0)//use if to comare item value

       {

               maxVals[n]=item;//holding item value in maxVals variable

       }

       else

       {

               maxVals[n]=maxVals[n-1];//decreasing the maxVals value

       }

       n++;//incrementing n value

}

public String pop()//defining a method pop

{

       return a[--n];//use return value

}

public String max()//defining a method max

{

       return maxVals[n-1];//return max value

}

  • In the first point, the max method is declared that compares the string and returns its max value.
  • In the second point, the push, pop, and max method are declared that works with their respective names like insert, remove and find max and after that, they return its value.
7 0
3 years ago
Which of the following is an example of a data base?
mihalych1998 [28]

See how long I can hold the key down. I forgot there was a max :/

 

hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

7 0
3 years ago
What is the difference between a circuit board and a bread board
stepan [7]

Answer:

A bread board is prototyped (manufactured) in a way where it is less permanent than a pcb (printed circuit board) or an even more permanent pcba (printed circuit board assembly). Bread boards are typically the first step to creating a finished circuit because electronic components are easier to test and take apart when needed; design and investigation can be made effectively as no soldering connections are required. Whereas a circuit board is used for the further finished products because they don't have sockets like the bread board and so there is little room for error and mistakes.

8 0
3 years ago
The windows logon process has unexpectedly terminated
dusya [7]

Answer

Windows corrupted

Explanation:

Try buying a new windows or resetting your laptop/pc

or your service failed to register/start

7 0
3 years ago
The critical path in a project network is:______ A. The Shortest path through the network. B. Longest path through the network.
Softa [21]

Answer:

B

Explanation:

4 0
3 years ago
Other questions:
  • Into which of these files would you paste copied information to create an integrated document?
    13·2 answers
  • )a___ is a complete binary tree such that each node in the tree contains a comparable object that us greater than or equal to th
    9·1 answer
  • U2- an example of __________ is an attempt by an unauthorized user to gain access to a system by posing as an authorized user.
    6·1 answer
  • Select the correct answer.
    7·1 answer
  • Gregory Yob is associated with which of these games?
    7·2 answers
  • What's a sentence with the words trickle and resume in it? they can be in any tense. Thanku​
    5·1 answer
  • A mail merge data source must contain
    15·1 answer
  • A(n) ____ local area network is a network in which devices use high-frequency radio waves to communicate with a base station, wh
    11·1 answer
  • US-CERT is a set of moderated mailing lists full of detailed, full-disclosure discussions and announcements about computer secur
    15·1 answer
  • The first cell phones in widespread use were . Smartphone technological advancements added services. Answer the following questi
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!