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
zhannawk [14.2K]
3 years ago
14

Design a do-while loop that asks the user

Computers and Technology
1 answer:
sattari [20]3 years ago
5 0
String answer = new String( "" );
do
{
    System.out.println( "Question? " );
}
while( answer.length > 0 )
You might be interested in
What is the purpose of the boot loader during the bootup process
earnstyle [38]
To start up windows and boot the system to make sure no hackers or viruses are on windows so your computer does not get infected with a hacker or virus 

hope this helps 
6 0
3 years ago
Read 2 more answers
In the reaction __H2 + O2 → 2H2O, what coefficient should be placed in front of H2 to balance the reaction?
malfutka [58]
The answer is:  [B]:  " 2 " .
_____________________________________________
Explanation:
____________________________________
Given the chemical equation:
____________________________________

     <u> ? </u> H₂ + O₂ → 2 H₂<span>O   ;
____________________________________________
</span>      → <span> We are asked, "What coefficient, if any — should be put in front of the:  " H</span>₂ " ;
__________________________________________________
          (which is on the "left-hand side" side of the chemical equation given—      the "reactants") ;

     →  to get a balanced chemical equation?
__________________________________________________
 →  Let us examine the "right-hand side" of this chemical equation—the product(s).  In this case, the "product" given is:  " 2 H₂O " .  

So, on the "right hand side", we have:
__________________________________________________
     1)  4 "H's" → {Two "H₂" 's = 2 * 2 = "4 H's"} ;  <u><em>and</em></u>:
     2)  2 "O's" → { Two "O's").
__________________________________________________
   So, the left-hand side should have:
__________________________________________________
     1)  4 "H's" ;  <u><em>and</em></u>:
     2)  2 "O's" ;
__________________________________________________
Let us examine the left-hand side (the "reactants").
__________________________________________________
                  " <u> ? </u><u /> H₂  +  O₂ " ; 
__________________________________________________
On the left-hand side, we already have: 
__________________________________________________
     1)   " 2  O's " ;   →  one "O₂" = "2 O's" ;  and:
     2)    "2  H's " ;   →  one "H<span>₂" .</span>

Now, we would need:
__________________________________________________
A "<u>total of "4 H's</u>".  Is there any number we could put as a coefficient on the other reactant, which happens to be:  "H₂" ;  to make a <u><em>total of</em></u> "4 H's" ?          

         {Note: There are only these TWO (2) reactants in this chemical equation.}.  

        → The "H₂" ;  as it stands alone, is insufficient—since that would be only                                                                                         "2 H's".
 __________________________________________________
     →  Thus, we can rule out:  "Answer choices: [A] and [D]."  
___________________________________________________
<u>Note</u>:  
→  Choice [A]:  "1" ;  The coefficient, "1";  is generally not (never?) used; and basically would function as the same as:
          →  Choice: [D]:  "<span>no coefficient is needed".
</span>→  <span>Choices [A] & [D]: would leave us with only "2 H's" on the "reactants side" (i.e. "left-hand side of the equation"; and we need FOUR ("4 H's").
__________________________________________________
Since we are given:  "H</span>₂" ; what coefficient could we put in front of this to get:       "4 H's" ?  (4÷2 =2).  So we could put a "2" in front of the "H₂" ; to get: 
    "4 H's".  The coefficient, "2" , corresponds directly with: 
__________________________________________________
                                             → Answer choice:  [B]:  "2" .
_________________________________________________
   { <u>NOTE</u>:  The remaining answer choice, [C], which is, "3" ; is INCORRECT; since 3 "H₂'s" would be "6 H's" ; (since 3 * "2 H's" equal "6 H's") ; which is too many "H's" → We need <u>exactly</u> "4 H's".}.
_________________________________________________
   So, the correctly balanced equation is:

             2 H₂ + O₂ → 2 H₂O  ; 
_________________________________________________
     → The coefficient that goes before the "H₂" ; to make this chemical equation balanced, is:  "2" . 
_________________________________________________
The correct answer is:  [B]:  "2" .  

      → The coefficient that goes before the "H₂" is:  "2" .
_________________________________________________
         Hope this answer—and {lengthy} explanation—is of help!
_________________________________________________
8 0
3 years ago
Read 2 more answers
Consider the following generalization of the Activity Selection Problem: You are given a set of n activities each with a start t
victus00 [196]

Answer:  

Assumption: Only 1 job can be taken at a time  

This becomes a weighted job scheduling problem.  

Suppose there are n jobs

   Sort the jobs according to fj(finish time)

   Define an array named arr to store max profit till that job

       arr[0] = v1(value of 1st job)

       For i>0. arr[i] = maximum of arr[i-1] (profit till the previous job) or wi(weight of ith job) + profit till the previous non-conflicting job

   Final ans = arr[n-1]

The previous non-conflicting job here means the last job with end timeless than equal to the current job.  

To find the previous non-conflicting job if we traverse the array linearly Complexity(search = O(n)) = O(n.n) = O(n^2)  

else if we use a binary search to find the job Complexity((search = O(Logn)) = O(n.Log(n))

4 0
2 years ago
Which of the following is NOT true of a budget?
tino4ka555 [31]
<span>A. Budget can’t include donations to charities.</span>
7 0
2 years ago
Read 2 more answers
Race conditions are possible in many computer systems. Consider a banking system with two functions:
VARVARA [1.3K]

Answer:

A race condition is actually possible in this scenario.

Explanation:

A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time. In order to prevent the race condition from occurring the operations must be done in the proper sequence to be done correctly.

Here is an example of the race condition:  Let's assume the Current Balance of the shared bank account is $600.  The husband's program calls the withdraw($100) function and accesses the Current Balance of $600.  But right before it stores the new Current Balance, the wife's program calls function deposit($100) function and accesses the Current Balance of $600.  At this point, the husband's program changes the shared variable Current Balance to $500, followed by the wife's program changing the Current Balance variable to $700.  Based on calling both withdraw($100) and deposit($100) functions, the Current Balance should again be $600, but it is $700. Alternatively, the  Current Balance could also have been $500.

To prevent the race condition from occurring, the solution will be to create a method to "Lock" on the Current Balance variable.  Each method must "Lock" the variable before accessing it and changing it.  If a method determines that the variable is "Locked," then it must wait before accessing it.

6 0
2 years ago
Other questions:
  • Which numbering system is used for some network addresses, to describe colors
    6·1 answer
  • By what decade were books readily available to the public across the United States and Europe? A. 1690 B. 1750 C. 1860 D. 1820
    9·1 answer
  • Write a program in Python that reads in investment amount, annual interest rate, and number of years, and displays the future in
    6·1 answer
  • Advantages of using networks include all of these except for a. sharing data and info b. sharing software c. sharing passwords d
    14·1 answer
  • Nam june paik’s ________ combines recognizable and distorted images made using a synthesizer to modulate video signals.
    9·1 answer
  • Evaluate the following expression with precedence of operator:<br> ​ X = 2* 3/ 5 + 10 //3 – 1
    13·1 answer
  • What steps might a company or organization need take in order to keep its digital data secure online?
    8·1 answer
  • Which type of password would be considered secure
    5·2 answers
  • Who is the first computer programmer​
    14·2 answers
  • My assignment asks me to write a python program using if, elif, and else that takes a user's salary and calculates the tax based
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!