Answer:
The solution code is written in Java.
- public static void swapArrayEnds(int myArray[]){
- int lastIndex = myArray.length-1;
- int temp = myArray[0];
- myArray[0] = myArray[lastIndex];
- myArray[lastIndex ] = temp;
- }
Explanation:
First create the swapArrayEngs method that take one input array parameter (Line 1).
Since we need to swap the first and last element of the array, we need to get the first index and last index of the array. The first index is 0 and the last index can be calculated by subtracting the length of array from 1 (Line 2).
Next, we can create a temp variable to hold the value of the first element (Line 3). Then we use the lastIndex the get the value of last element and assign it to the first element of array (Line 4). Lastly, we assign the temp (holding the initial first element value) to the last element of array (Line 5).
Answer:
if(updateDirection==1){
numUsers++;
}
else if(updateDirection==0){
numUsers--;
}
Explanation:
The if and else if conditional statement above accomplishes this.
if the first condition is true (updateDirection==1), numUsers is increemented by 1 (numUsers++)
else if the second condition is true (updateDirection==0), numUsers is decreemented by 1 (numUsers--)
See a complete C++ code below:
<em>#include <iostream></em>
<em>using namespace std;</em>
<em>int main()</em>
<em>{</em>
<em>int numUsers = 0;</em>
<em>int updateDirection = 0;</em>
<em />
<em>numUsers = 8;</em>
<em>updateDirection = 0;</em>
<em />
<em>if(updateDirection==1){</em>
<em> numUsers++;</em>
<em>}</em>
<em>else if(updateDirection==0){</em>
<em> numUsers--;</em>
<em>}</em>
<em>cout<<"New value is: "<< numUsers<<endl;</em>
<em>return 0;</em>
<em>}</em>
Answer:
B. Use the Report view.
Explanation:
The fastest way to locate a record for updating is to use the report view.
The formatting tool is very important. When one effectively understands the various formatting options available in the word processing software application, one can be able to;
- Make more accessible options for readers through creating and use of headings, highlighting key words or ideas etc.
- Formatting any document helps one to have a presentable and professional document.
- It makes the document easier and a lot interesting to read.
- It helps in Proper punctuation marks and spelling usefulness.
<h3>What is formatting in MS Word?</h3>
Formatting text is simply known as the act of controlling how one wants a particular text to appears in your document. This includes the control of the size, color, etc.
Learn more about word processing software from
brainly.com/question/1022352
Answer:
x = input ("Enter a word: ")
y = input ("Enter a word: ")
print ( x, " ", y)
Explanation:
This is the simplest way to write it using Python.