answer.
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
rusak2 [61]
1 year ago
7

Write an expression that executes the loop body as long as the user enters a non-negative number. Note: If the submitted code ha

s an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message. Sample outputs with inputs: 9 5 2 -1 Body Done.
Computers and Technology
1 answer:
Delicious77 [7]1 year ago
4 0

Answer:

Following are the program in C++ language  

#include <iostream> // header file  

using namespace std; // namespace

int main() // main function

{

   int number=0; // variable declaration

   while(number>-1) // iterating the while loop

   {

       

       cout<<"body"<<endl; // dsiplay the statement

       cin>>number; // Read the value by the user

   }

   cout<<endl<<"Done";// dsiplay the statement

   return 0;

}

Output:

body

5

body

45

body

-8

Done

Explanation:

Following are the description of the statement

  • Declared a variable "number" of int type and initialized with 0 to them
  • iterating the while loop. In this loop print the message "body" and Read the value by the user in the "number" variable. This loop will be executed repeatedly until the user do not read the negative value.
  • After the execution of the while loop, it prints the message "Done".
You might be interested in
Assume that machines A and B are on the same network 10.3.2.0/24. Machine A sends out spoofed packets, and Machine B tries to sn
Zanzabum

Answer:

Explanation:

Assuming the spoofed 1.2.3.4, it will be sent out ARP to a router that is alive and get it MAC. Then the spoofed packet will be able to be sent out. If A spoofed 10.0.2.30, because it is a local address, it will send an ARP to the machine for been able to get the MAC. But, the IP address 10.0.2.30 is not original making it to be fake, so it will not replay to A, for this reason the spoofed packet cannot be sent out.

7 0
2 years ago
Which of the following option is correct about HCatalog?
adell [148]

Answer:

Option (3) is the correct answer of this question.

Explanation:

  • HCatalog makes available Hive metadata to users of other Hadoop applications, such as Pig, MapReduce and Hive. it offers interfaces for MapReduce and Pig so that users can read data from and write data to the Hive warehouse.
  • This means users don't have to care about where or in what format their data is stored. So we know this way that Hcatalog makes sure our data is secure.
  • Others option does not belong to Hcatalog so these options are incorrect .

8 0
2 years ago
E xercise 17.2.4: The following is a sequence of undo-log records written by two transactions T and U: &lt; START T&gt;; ; &lt;
masya89 [10]

Answer:

Check the explanation

Explanation:

The following is a sequence of Undo — log records written by two transactions.

<START 1>; <F, A, 10>; <START U>; <U, B, 20>; <F, C, 30>; <U, D, 40>; <COMMIT U>; <T, E, 50>; <COMMIT T>; (a) < START U >;

If the system crashes after the log < START U >,

Then we have log records will be shown below.

<START U>;

<T, A, 10>;

<START T>;

SYSTEM CRASHED

The recovery manager sees the Undo - Redo log and inspect the both trans-actions T and U are not committed. Then those elements changed by both transactions are arranged to their old values.

  1. Transaction T changes the element A.
  2. Then the Element A is arranged to old value A=10.
  3. Transaction U did not change any existing element in the records.
  4. So, not anything to do with transaction U.

(B) < T, E, 50>;

If the system crashes after the log < T, E, 50>;

Then we have log records will be shown below .

START T>;

<T, A, 10>;

<START U>;

<U, B, 20>;

<T, C, 30>;

<U, D, 40>;

<COMMIT U>;

<T, E, 50>;

SYSTEM CRASHED

The recovery manager sees the Redo logs and inspect the transaction U is committed or not. Such changes made by transaction U are reached to disk.

• So much the recovery manager arranged the elements to their recent values changed by transaction U.

• Transaction U changed the elements B and its records <U, B, 20>with re-cent values.

• Transaction U changed the elements D and its records <U, D, 40>with recent values.

• The transaction T is not committed.

• Then the elements changed by transaction T are arranged to old values.

• Then element A is arranged to 10, C is arranged to 30 and E is arranged to 50.

7 0
2 years ago
A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory addressing if the smallest ad
victus00 [196]

Answer:

The minimum number of bits necessary to address 8K words is 13.

Explanation:

You have the number of words to address that is 8000 words, a word is the smallest addressable memory unit.  

8000 words can be addressed with 2^{n}  units. Now you have to find the value of n that approximates to the number of words.  

2^2=4\\2^4=16\\2^7=128\\2^{10}=1024\\2^{12}=4096\\2^{13}=8192

So you can see that 13 bits are needed to address 8K words.

7 0
1 year ago
The major result of treating 1-butyne with 6M aqueous NaOH would be:_______.A. the production of an alkene.B. the production of
andriy [413]

Answer:

D. nothing, as the alkyne would not react to an appreciable extent.

Explanation:

Nothing, as the alkyne would not react to an appreciable extent.

6 0
1 year ago
Other questions:
  • Julie bought a house for $315,000 and has a $285,000 mortgage. she claims she has $315,000 in equity. is she correct? if not, ho
    12·2 answers
  • Linda is making handouts for her upcoming presentation. She wants the handouts to be comprehensible to people who do not attend
    12·2 answers
  • Edward has started up a new company with his friend, Matthew. Currently, he has only two people working with him. Which type of
    8·1 answer
  • The icacls.exe command adds __________, which are visible by clicking the Advanced button in the folder Properties dialog box
    15·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • 15) The codes for class Hotel has been defined in two separate files Hotel.h, and Hotel.cpp. Which of the following statements i
    12·1 answer
  • How many times is the function wordScramble() called in the given program? public class WordScramble { public static void wordSc
    6·1 answer
  • The PictureBook class is a subclass of the Book class that has one additional attribute: a String variable named illustrator tha
    9·1 answer
  • Suggest how the following requirements might be rewritten in a quantitative way. You may use any metrics you like to express the
    7·1 answer
  • Checkpoint 10.43 Write an interface named Nameable that specifies the following methods: _______{ public void setName(String n)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!