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".
Answer:
The code to this question can be given as:
Code:
int i,j,count_previous=0,count_next=0; //define variable
for (j=0; j<n; j++) //loop for array
{
if (x[0]==x[j]) //check condition
{
count_previous++; //increment value by 1.
}
}
for (i=0; i<n; i++) //loop
{
for (j=0; j<n; j++)
{
if (x[i]==x[j]) //check condition
{
count_next++; //increment value by 1.
}
}
if (count_previous>count_next) //check condition
{
mode=x[i-1];
}
else
{
mode=x[i];
count_previous=count_next; //change value.
count_next= 0 ; //assign value.
}
}
Explanation:
In the question it is define that x is array of the string elements that is already define in the question so the code for perform operation in the array is given above. In the code firstly we define the variable that is i, j, count_previous, count_next. The variable i,j is used in the loop and variable count_previous and count_next we assign value 0 that is used for check the values of array. Then we define the for loop in this loop we use conditional statement in the if block we check that array of zero element is equal to array of j value then the count_previous is increase by 1. Then we use nested loop It is also known as loop in a loop. In this first loop is used for array and the second loop is used for check array element.In this we use the condition that if array x of i value is equal to array x of j then count_next will increment by 1.Then we use another condition that is if count_previous is greater then count_next then mode of x is decrement by 1. else mode equal to array and count_previous holds the value of count_next and count_next is equal to 0.
Answer:
The correct answer to the following question will be Option B (ROM).
Explanation:
Bootstrap is the programming which initializes the OS during initialization. The bootstrap loader creates small operator programs that connect and monitor the various computer hardware components.
ROM is Read-only memory, which will be used to hold a computer's start-up commands, also recognized as firmware.
No other method was used to help save system startup. ROM, then, is the right answer.
Answer:
Margin of Error=M.E= ± 0.0113
Explanation:
Margin of Error= M.E= ?
Probability that watched network news programs = p = 0.4
α= 95%
Margin of Error =M.E= zₐ/₂√p(1-p)/n
Margin of Error=M.E= ±1.96 √0.4(1-0.4)/7200
Margin of Error=M. E = ±1.96√0.24/7200
Margin of Error=M. E- ±1.96* 0.005773
Margin of Error=M.E= ±0.0113
The Margin of Error is the estimate of how much error is possible as a result of random sampling.