![MJKjmkp1](/avatars/5062.jpg)
MJKjmkp1
19.11.2019 •
Computers and Technology
The governor of a state wants to inform the people about a change in the tax policy. which people should he definitely invite to convey the message?
Solved
Show answers
More tips
- C Computers and Internet Step-by-Step Guide on How to Download Music to Your iPhone...
- A Animals and plants Unraveling the Mystery of Loch Ness: What Does the Loch Ness Monster Look Like?...
- L Leisure and Entertainment Should You Buy a Ceramic Knife?...
- C Computers and Internet How to easily and quickly disable Firebug in Gmail and Google Docs...
- G Goods and services How to sew a ribbon: Tips for beginners...
- F Food and Cooking How to Make Mayonnaise at Home? Secrets of Homemade Mayonnaise...
- C Computers and Internet Which Phone is Best for Internet Surfing?...
- F Food and Cooking Everything You Need to Know About Pasta...
- C Computers and Internet How to Choose a Monitor?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
Answers on questions: Computers and Technology
- C Computers and Technology Consider the following hypotheses: If it does not rain or if it is not foggy, then the sailing race will be held and the lifesaving demonstration will go on If the sailing...
- C Computers and Technology 14. b The memory, which is utmost accessible to the processor is A: Cache memory B: RAM C: Hard disk D: Flash memory...
- M Mathematics Diego s family is going on a camping trip and his job is to make a batch of GORP (Good Old Raisins and Peanuts) to take on the trip. In his kitchen, he finds a bunch of identical...
- M Mathematics The figure above is made of five squares. The length of each square is 5 inches. What is the perimeter of the figure? A 25 in. B 100 in. C 60 in. D 40 in....
- P Physics A bird has flown 850 km south for the winter when he realized he has to go because it is still summer after traveling 320 km North what is the bird s distance traveled...
- E English Can you answer it now...
- S SAT raia purchases a new car for $32,000 and finances it with a 6-year simple interest loan at a rate of 4.25%. what is the total amount raia will pay for her car?...
- B Biology How can Marine Scientist solve environmental problems? Please help me...
- M Mathematics Evaluate this expression by distributing the multiplication over division: 5 x (7+4)...
- B Biology Which one of the following molecules can MOST easily pass through the plasma membrane unassisted? A. Ca2+, a positive ion B. Cl−, a negative ion C. CO2, a nonpolar gas D. glucose,...
Ответ:
The people the governor should definitely invite to convey the message are:
The media, journalists and politicians of that state.Explanation:
Fiscal policies are of general interest since they mention the different taxes that all those who declare income must pay, of course, inviting all the people of a state is impossible to transmit this message directly to them, however, the media and journalists are a good way to reach all people, whether through television or radio. In addition, the politicians of that state must be called to provide this information in the municipalities.
Ответ:
I am writing C++ program. Let me know if you want the program in some other programming language.
#include <iostream> //to use input output functions
using namespace std; //to identify objects like cin cout
void reverse(int array[], int size){ //method to reverse an array
int i, j, temp; //declare variables
for (i = 0; i < size / 2; i++) { /* the loop swaps the first and last elements, then swap the second and second-to-last elements and so on until the middle of the array is reached */
temp = array[i];
array[i] = array[size - i - 1];
array[size - i - 1] = temp; }
cout<<"Reversed array: "; //prints the resultant reversed array after swapping process
for (j = 0; j < size; j++) { //loop to print the reversed array elements
cout<<array[j]<<" "; } }
int main() { //start of main() function body
cout<<"Enter the length of array: "; //prompts user to enter the length of the array
int n; //stores the value of size of array
cin>>n; //reads the input size of array
int A[n]; //declare array A of size n
cout<<"Enter the elements: "; //prompts user to enter array elements
for(int i=0;i<n;i++){ //loop for reading the elements of array
cin >> A[i]; }
reverse(A,n); } //calls reverse function to reverse the elements of the input array A by passing array A and its length n to function reverse
Explanation:
The reverse function takes an array and its length as parameter. In the body of reverse function three integer type variables i,j and temp are declared.
for (i = 0; i < size / 2; i++) The for loop has a variable to iterate through the array. The for loop checks if the value of i is less than the array length. Lets say we have an array of elements 1, 2, 3, 4. As i=0 and size/2 = 4/2= 2. So the condition checked in for loop is true as 0<2 which means the body of for loop will be executed.
In the body of the loop there are three swap statements.
temp = array[i] This statement stores the element of array at i-th index to temp variable.
array[i] = array[size - i - 1] statement stores the element of array at size-i-1 to array index i.
array[size - i - 1] = temp statement stores the the value in temp variable to the array index size-i-1
In simple words first, the first and last elements of array are swapped, then the second and second last elements are swapped. This process keeps repeating and for loop keeps executing these swap statements until the middle of the array is reached. In this program no extra array is used for reversing procedure but just a variable temp is used to hold the array elements temporarily.
array[4] = { 1 , 2 , 3 , 4}
At first iteration
i < size/2 is true as 0<2
So the program control moves in the body of the loop where three swap statement works as following:
temp = array[i]
temp = array[0]
As element at 0-th index which is the first element of array is 1 so
temp= 1
array[i] = array[size - i - 1];
array[0] = array[4-0-1]
= array[3]
As the element at 3rd index of array is 4 which is the last element of the array so
array[0] = 4
This means that 4 becomes the first element of array now.
array[size - i - 1] = temp
As the value in temp was set to 1 so
array[4-0-1] = 1
array[3] = 1
This means 1 is assigned to the 3rd index of array. Which means 1 becomes the last element of the array now.
This is how the first and last elements of array are swapped.
2nd iteration: value of i is incremented to 1 and now i = 1
Again for loop condition is checked which evaluates to true as 1<2
temp = array[i]
temp = array[1]
As element at 1st index which is the second element of array is 2 so
temp= 2
array[i] = array[size - i - 1];
array[1] = array[4-1-1]
= array[2]
As the element at second index of array is 3 which is the last element of the array so
array[1] = 3
This means that 3 becomes the second element of array now.
array[size - i - 1] = temp
As the value in temp was set to 2 so
array[4-1-1] = 2
This means 2 is assigned to the 2nd index of array. Which means 2 becomes the second last element of the array now.
This is how the second and second to last elements of array are swapped.
3rd iteration: value of i=2 The for loop body will not execute now as the for loop condition i<size-2 evaluates to false because 2=2. So the loop stops and next for (j = 0; j < size; j++) loop iterates through array[] which has now been reversed and print the elements of this reversed array.
Next the main() method passes length of the array and the array elements to the reverse function and prints these elements in reverse.
The output is:
4 3 2 1
The program and output according to the example 2,5,9,7 given in the question is attached as a screenshot.