Write a recursive function that has an argument that is an array of characters and two arguments that are bounds on array indexes. The function should reverse the order of those entries in the array whose indexes are between the two bounds. For example, if the array is a[0]

Answers

Answer 1

Answer:

The function is as follows:

void revArray(char arr[], unsigned int low, unsigned int high)  {  

      if (low >= high){

        return;  }

  swap(arr[low], arr[high]);  

  revArray(arr, low + 1, high - 1);  }

Explanation:

This declares the function. It receives a char array and the lower and upper bounds to be reversed

void revArray(char arr[], unsigned int low, unsigned int high)  {  

This is the base case of the recursion (lower bound greater than or equal to the upper bound).

      if (low >= high){

        return;  }

This swaps alternate array elements

  swap(arr[low], arr[high]);  

This calls the function for another swap operation

  revArray(arr, low + 1, high - 1);  }


Related Questions

To launch the mail merge help dialog box, what option should you select using the Microsoft word office assistant?​

Answers

Answer:

Complete setup.

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users type, format and save text-based documents.

A Mail Merge is a Microsoft Word feature that avails end users the ability to import data from other Microsoft applications such as Microsoft Access and Excel. Thus, an end user can use Mail Merge to create multiple documents (personalized letters and e-mails) for each entry in the list at once and send to all individuals in a database query or table.

Hence, Mail Merge is a Microsoft Word feature that avails users the ability to insert fields from a Microsoft Access database into multiple copies of a Word document.

Some of the options available in the Write & Insert Fields group of Mail Merge are;

I. Highlight Merge Fields.

II. Address Block.

III. Greeting Line.

Generally, when a user wants to launch the Mail Merge help dialog box, the option he or she should select using the Microsoft word office assistant is complete setup.

Additionally, the sequential steps of what occurs during the mail merge process are;

1. You should create the main document

2. Next, you connect to a data source

3. You should highlight or specify which records to include in the mail.

4. You should insert merge fields.

5. Lastly, preview, print, or email the document.

hello! can someone write a c++ program for this problem

Problema 2018.3.2 - Cheated dice
Costica is on vacation and his parents sent him to the country. There he gets terribly bored and looking through his grandfather's closet, he came across a bag full of dice. Having no one to play dice with, but it seemed to him that some of the dice were heavier than the others, Costica chose a dice and started to test it by throwing it with him and noting how many times each face fell. He then tries to figure out whether the dice are rolled or not, considering that the difference between the maximum number of appearances of one face and the minimum number of occurrences (of any other face) should not exceed 10% of the total number of throws.
Requirement
Given a number N of dice rolls and then N natural numbers in the range [1: 6] representing the numbers obtained on the rolls, determine whether the dice is tricked according to the above condition.
Input data
From the input (stdin stream) on the first line reads the natural number N, representing the number of rolls. On the following N lines there is a natural number in the range [1: 6] representing the numbers obtained on throws.
Output data
At the output (stdout stream) a single number will be displayed, 0 or 1, 0 if the dice are normal, and 1 if it is cheated.
ATTENTION to the requirement of the problem: the results must be displayed EXACTLY in the way indicated! In other words, nothing will be displayed on the standard output stream in addition to the problem requirement; as a result of the automatic evaluation, any additional character displayed, or a display different from the one indicated, will lead to an erroneous result and therefore to the qualification "Rejected".
Restrictions and clarifications
1. 10 ≤ N ≤ 100
2. Caution: Depending on the programming language chosen, the file containing the code must have one of the extensions .c, .cpp, .java, or .m. The web editor will not automatically add these extensions and their absence makes it impossible to compile the program!
3. Attention: The source file must be named by the candidate as: . where name is the last name of the candidate and the extension (ext) is the one chosen according to the previous point. Beware of Java language restrictions on class name and file name!
Input data

10
6
6
6
6
6
6
6
6
6
6
Output data
1

Roll the dice 10 times, all 10 rolls produce the number 6. Because the difference between the maximum number of rolls (10) and the minimum number of rolls (0) is strictly greater than 10% of the total number of rolls (10% of 10 is 1), we conclude that the dice are oiled.

Input data
10
1
4
2
5
4
6
2
1
3
3
Output data
0

Throw the dice 10 times and get: 1 twice, 2 twice, 3 twice, 4 twice, 5 and 6 at a time. Because the difference between the maximum number of appearances (two) and the minimum number of occurrences (one) is less than or equal to 10% of the total number of throws (10% of 10 is 1), we conclude that the dice are not deceived.

Answers

Answer:

f0ll0w me on insta gram Id:Anshi threddy_06 (no gap between I and t)

What will the declaration below do to its target?

animation-direction: reverse;
The animation steps will play backward.
The animation steps will play forward, then backward.
The animation steps will play forward.
The animation steps will play backward, then forward.

Answers

The animation steps will play forward then backward

Which of the following tools helps ensure your document will open in older versions of word

Answers

Answer:

Compatibility Check

Explanation:

Select File > Info.

In the Inspect Document section, select Check for Issues > Check Compatibility.

Click Select versions to show. A check mark that appears next to the name of the mode that the document is in.

Imagine running a 64-bit system on a 32-bit system, where we simulate a single 64- bit memory location (register) using two atomic 32-bit memory locations (registers). A write operation is implemented by simply writing the first 32-bits of the simulated 64-bit register in the first real register, then the second 32-bits in the second real register. A read, similarly, reads the first half from the first register, then the second half from the second register, and returns the concatenation. What is the strongest property that this 64-bit register satisfies: safe, regular, or atomic

Answers

Answer:

It's not possible to ensure memory access occurs indivisibly when it has to broken into multiple operations. Unfortunately, the fact that your application is running on a 64-bit kernel does not change the equation any - it is actually running in a compatibility layer and has none of the benefits of x64

Explanation:

1-How many moles of NazCOs are in 10.0 ml of a 2.0 M solution?​

Answers

Answer:

A solution is a mixture in which the particles are so small that the components are indistinguishable from each other. The amount of the solute and the solvent in a solution can be expressed in terms of different concentration expressions such as molarity, morality, etc.

Explanation:

To calculate the number of moles of sodium carbonate, the volume in liters will be multiplied by the molar concentration of the solution.

moles Na2CO3 = 2.0 M  x 0.0100 L = 0.020 moles Na2CO3

Hope it helps :)

Answer:

There are 20. mol of Na2CO3 in 10.0L of 2.0M solution.

Explanation:

Molarity is represented by this equation:

(look at attachment)

In our case, we already have the molarity and volume of solution, both of which have good units.

Let's rearrange the equation to solve for the number of moles. We can do this by multiplying by L solution on both sides of the equation. The L solution will cancel out on the right side, leaving the number of moles being equal to the molarity times volume:

Moles of solute

=Lsolution×Molarity

Now we just plug the known values in!

Moles of solute = (10.0 L) (2.0M) = 20. moles

PLEASE HELP ASAP!!

This command allows you to duplicate text from one part of a document while keeping the original text.

Cut
Copy
Format
Paste

Answers

The answer to your question is= Copy

Answer: CTRL + C or copy and paste

Explanation: to copy and paste highlight text by dragging mouse or clicking on touchpad and holding over selected text, if not on a computer but on a touch screen device ( ex: Phone, iPad etc) hold down until it is blue use the tear drops from the top and bottom to highlight the text you need. Then hold down the blue area until options come up stop holding and select copy and then go to where you want to put the text and hold down again and select paste. If on computer drag cursor over text while holding down on left click or holding down on touchpad, it will highlight light blue then left click or click on the touchpad with both fingers and repeat the process of copying and pasting as said before.

Hope this helps! :)

Sixteen stations, numbered 1 through 16, are contending for the use of a shared channel by using the adaptive tree walk protocol. If all the stations whose addresses are prime numbers suddenly become ready at once, how many bit slots are needed to resolve the contention

Answers

Answer:

11 bit slot will be needed

Explanation:

The number of prime numbers between 1 through 16

= 2, 3 , 5, 7, 11 and 13

hence we can say 6 stations are to use the shared channel

Given that all the stations are ready simultaneously

The number of bit slots that will be needed to handle the contention will be 11 bits :

slot 1 : 2, 3, 5 , 7, 11 , 13

slot 2 : 2,3, 5, 7

slot 3 : 2, 3

slot 4 : 2 .   slot 5 : 3 .  slot 6 : 5,7.   slot 7 : 5 .   slot 8 : 7.  slot 9: 11,13.  

slot 10 : 11.   slot 11 : 13

Write a program that will create an array of random numbers and output the values. Then output the values in the array backwards. SPECIFICATIONS: File name: ArrayBackwards.java Your program must make use of at least one method other than main()to receive full credit (methods can have a return type of void). Suggestion: create and populate the array in the main() method. Make a method for Step 3 below and send in the array as a parameter. Make another method for Step 4 and send in the array as a parameter.

Answers

Answer:

The program is as follows:

import java.util.*;

public class Main{

public static void backward(int [] Rndarray, int lnt){

    System.out.print("Reversed: ");

    for(int itm = lnt-1;itm>=0;itm--){

        System.out.print(Rndarray[itm]+" ");     } }

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int lnt = input.nextInt();

 Random rd = new Random();

 int [] Rndarray = new int[lnt];

 for (int itm = 0; itm < lnt; itm++) {

        Rndarray[itm] = rd.nextInt();

        System.out.print(Rndarray[itm]+" ");

     }

     System.out.println();

 backward(Rndarray,lnt); }}

Explanation:

This defines the backward() method

public static void backward(int [] Rndarray, int lnt){

This prints string "Reversed"

    System.out.print("Reversed: ");

This iterates through the array

    for(int itm = lnt-1;itm>=0;itm--){

Each element is then printed, backwards

        System.out.print(Rndarray[itm]+" ");     } }

The main begins here

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

This gets the array length

int  n = input.nextInt();

This creates a Random object

Random rd = new Random();

This declares the array

 int [] Rndarray = new int[lnt];

This iterates through the array for input

 for (int itm = 0; itm < lnt; itm++) {

This generates a random number for each array element

        Rndarray[itm] = rd.nextInt();

This prints the generates number

        System.out.print(Rndarray[itm]+" ");

     }

This prints a new line

     System.out.println();

This passes the array and the length to backward() method

 backward(Rndarray,lnt); }}

Question #4
Math Formula
What will you see on the next line?
>>>int(3.9)

Answers

Answer:

3

Explanation:

The correct answer is 3. The int() function truncates the decimal part.

-Edge 2022

Select all phrases that describe a server-based network. centralized network security easy to expand log-ins controlled by central server unlimited number of users network resources stored on individual workstations

Answers

Answer:

Client Server Network ... is the central computer that enables authorized users to access networked resources ... computers in this type of network are connected to a central hub ... why might a business choose a server based network (3) ... 2) easier to expand ... external hardware connected to and controlled by a computer.

Explanation:

Answer

Explanation:

what the other person said

Select the correct answer.
What should you keep in mind when picking a topic for a research paper?
ОА.
choosing a general topic
OB.
choosing a topic that is relatively new
O C.
choosing a specific topic rather than a broad one
OD. choosing a topic based on the most number of sources you can find
Reset
Next

Answers

Answer: The answer is C

Explanation: When it comes to research papers your topic shouldnt be too broad. Your topic should be broad enough you can find a good amount of information but not too focused that you can't find any information.

In python, Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" otherwise.

Answers

I am assuming that user_val is an inputted variable and a whole number (int)...

user_val = int(input("Enter a number: "))

if user_val < 0:

   print("negative")

else:

   print("non-negative")

Select the correct answer.
What is the advantage of using transparencies?
O A. They support better image quality than online presentations.
O B. They are helpful when creating non-linear presentations.
OC. They allow the presenter to jot down points on the slide.
OD. They are better suited to creating handouts.
Reset
Next

Answers

Answer:

They are better suited to creating handouts

A network consists of 75 workstations and three servers. The workstations are currently connected to the network with 100 Mbps switches, and the servers have 1000 Mbps connections. Describe two network problems that can be solved by replacing the workstations' 100 Mbps switches and NICs with 1000 Mbps switches and NICs. What potential problems can this upgrade cause

Answers

Answer:

A)  i) starvation  ii) flow control

B) Network congestion

Explanation:

A) Network problems that can be addressed / solved

By replacing the workstations 100 Mbps switches with 1000 Mbps switches the problem of

Starvation;  been faced by the servers due to the delay in sending data to be processed by the servers from the workstations will be resolved .

Flow control : The huge difference in the speeds of the workstations and servers causes a network buffer which leads to packet loss therefore when the workstations 100 Mbps switch is replaced with 1000 Mbps switch this network problem will be resolved

b) The potential problem that can be encountered is Network Congestion

Given a member function named set_age() with a parameter named age in a class named Employee, what code would you use within the function to set the value of the corresponding data member if the data member has the same name as the parameter

Answers

Answer:

Explanation:

This would be considered a setter method. In most languages the parameter of the setter method is the same as the variable that we are passing the value to. Therefore, within the function you need to call the instance variable and make it equal to the parameter being passed. It seems that from the function name this is being written in python. Therefore, the following python code will show you an example of the Employee class and the set_age() method.

class Employee:

   age = 0

   

   def __init__(self):

       pass

   

   def set_age(self, age):

       self.age = age

As you can see in the above code the instance age variable is targeted using the self keyword in Python and is passed the parameter age to the instance variable.        

You work for a large company that has over 1000 computers. Each of these computes uses a wireless mouse and keyboard. Therefore, your company goes through a lot of alkaline batteries. When these batteries can no longer power the intended device, you must decide what to do with them. Unless otherwise dictated by your local authorities, which of the following would be the EASIEST way to deal with these batteries?
They must be sent to hazardous waste collection

a. They can be recharged.
b. They must be stored onsite until they expire
c. They can be thrown in the trash.

Answers

The answer to this question is, "They can be thrown in the trash."

Explanation: This is because it specifies how to get rid of them UNLESS local authorities have told you otherwise.

Write a method called lexLargest that takes a string object argument containing some text. Your method should return the lexicographical largest word in the String object (that is, the one that would appear latest in the dictionary).

Answers

Answer:

public static String lexLargest(String text){

       //split the text based on whitespace into individual strings

       //store in an array called words

       String[] words = text.split("\\s");

       

       //create and initialize a temporary variable

       int temp = 0;

       

       //loop through the words array and start comparing

       for(int i = 0; i < words.length; i++){

           

           //By ignoring case,

           //check if a word at the given index i,

           //is lexicographically greater than the one specified by

           //the temp variable.

          if(words[i].compareToIgnoreCase(words[temp]) > 0){

               

               //if it is, change the value of the temp variable to the index i

              temp = i;

           }    

       }

       

       //return the word given by the index specified in the temp

               // variable

       return words[temp];

    }

Sample Output:

If the text is "This is my name again", output will be This

If the text is "My test", output will be test

Explanation:

The code above has been written in Java. It contains comments explaining the code. Sample outputs have also been given.

However, it is worth to note the method that does the actual computation for the lexicographical arrangement. The method is compareToIgnoreCase().

This method, ignoring their cases, compares two strings.

It returns 0 if the first string and the second string are equal.

It returns a positive number if the first string is greater than the second string.

It returns a negative number if the first string is less than the second string.

Linda wants to change the color of the SmartArt that she has used in her spreadsheet. To do so, she clicks on the shape in the SmartArt graphic. She then clicks on the arrow next to Shape Fill under Drawing Tools, on the Format tab, in the Shape Styles group. Linda then selects an option from the menu that appears, and under the Colors Dialog box and Standard, she chooses the color she wants the SmartArt to be and clicks OK. What can the option that she selected from the menu under Shape Fill be

Answers

Answer: Theme colors

Explanation:

Based on the directions, Linda most probably went to the "Theme colors" option as shown in the attachment below. Theme colors enables one to change the color of their smart shape.

It is located in the "Format tab" which is under "Drawing tools" in the more recent Excel versions. Under the format tab it is located in the Shape Styles group as shown below.

write a program that takes as input a number of kilometers and prints the corresponding number of nautical miles.

Answers

Answer:

try this

Explanation:

km = float(input('Kilometers: '))

nm = (km * 5400) / 10000

print('%0.4f km = %0.4f Nautical Miles' %(km,nm))

(2) What are the limitations of portable computer? ​

Answers

Answer:

Most portable computer are not upgradable and they have a lower specification than most desktop systems

If the user enters any operator symbol other than , -, *, or /, then an UnknownOperatorException is thrown and the user is allowed to reenter that line of input. Define the class UnknownOperatorException as a subclass of the Exception class. Your program should also handle NumberFormatException if the user enters non-numeric data for the operand.

Answers

Answer:

Explanation:

The following code is written in Java. It creates the UnknownOperatorException class and catches it if the user enters something other than the valid operators. If so it continues asking the user for a new input. Once a valid operator is entered, it exits the function and prints the operator.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       char symbol = askForOperand();

       System.out.println("Operand: " + symbol);

   }

   public static char askForOperand() {

       Scanner in = new Scanner(System.in);

       try {

           System.out.println("Enter operator symbol: ");

           char symbol = in.nextLine().charAt(0);

           if ((symbol != '-') && (symbol != '*') && (symbol != '/')) {

               System.out.println(symbol);

               throw new UnknownOperatorException();

           } else {

               return symbol;

           }

       } catch (NumberFormatException | UnknownOperatorException e) {

           System.out.println("Not a valid operand");

           char symbol = askForOperand();

           return symbol;

       }

   }

}

class UnknownOperatorException extends Exception {

   public UnknownOperatorException() {

       System.out.println("Unknown Operator");

   }

}

Why do organizations need to tailor project management concepts, such as those found in the PMBOK® Guide, to create their own methodologies?

Answers

Explanation:

Although each project is different and unique, according to the Method Statement of PMBoK, customising is required. Not that every procedure, tool, methodology, input, or output listed in the PMBoK Guide is mandated for every project. Scope, timeline, cost, materials, quality, and danger should all be considered while tailoring.

What does the top-level domain in a URL indicate?
A. the organization or company that owns the website
B. the organization or company that operates the website
C. the protocol used to access the website D. the type of website the URL points to

Answers

Answer:

b i think

Explanation:

A top-level domain (TLD) is the last segment of the domain name. The TLD is the letters immediately following the final dot in an Internet address. A TLD identifies something about the website associated with it, such as its purpose, the organization that owns it or the geographical area where it originates.

Answer:

The answer is D. The type of website the URL points to.

Explanation:

I got it right on the Edmentum test.


Which statement describes Augmented Reality (AR) technology?

Answers

Answer:

Augmented Reality (AR) superimposes images and audio over the real world in real time. It does allow ambient light and does not require headsets all the time.

yan po ang szgot

wala po kasi pagpipilian

HOPE IT HELPS

pls follow ke

All of the following can cause a fatal execution-time error except: Group of answer choices Dereferencing a pointer that has not been initialized properly Dereferencing a null pointer Dereferencing a pointer that has not been assigned to point to a specific address Dereferencing a variable that is not a pointer

Answers

Answer: Dereferencing a variable that is not a pointer

Explanation:

The execution time also refered to as the CPU time pertaining to a given task is the time that is used by the system to execute a task.

Some of the reasons for a fatal execution-time error include:

• Dereferencing a pointer that has not been initialized properly

• Dereferencing a null pointer

• Dereferencing a pointer that has not been assigned to point to a specific address.

It should be noted that dereferencing a variable that is not a pointer doesn't cause a fatal execution-time error.

8. (a) Write the following statements in ASCII
A = 4.5 x B
X = 75/Y

Answers

Answer:

Explanation:

A=4.5*B

65=4.5*66

65=297

1000001=11011001

10000011=110110011(after adding even parity bit)

X=75/Y

89=75/90

10011001=1001011/1011010

100110011=10010111/10110101(after adding even parity bit)

what is the value of 2020/20×20​

Answers

Answer:.5.05

Explanation:...maths

Answer:

5.05

Explanation:

2020/400= 5.05

HOPE IT HELPED AND GOOD LUCK!!

list and describe each of the activities of technology

Answers

Answer:

network has led to exposure of dirty things to young ones.

air transport has led to losing of lives

How have technology and social media changed reading?
O A. Physical books can only be read on the web.
B. Now reading is a conversation of give and take.
O C. People no longer have to read anything at all.
D. Reading often takes much longer to undergo.

Answers

Answer:

B?

Explanation:

I'm super sorry if I get this wrong for you but after thinking so much I probably think it would be B

Answer:

the guy above is right it is B

Explanation:

because 2+2=4

Other Questions
A spinner has 14 equal sectors with different letters for each sector, as shown below:Victoria spins the spinner 18 times, and it stops at the letter 'B' 10 times. If she spins the spinner a 20th time, what is the theoretical probability that this time it will stop at the letter 'B'?PLZ SHOW WORKBRAINLIEST PLEASE HELP Why was the Japanese not able to crack US codes during the war? solve this: - 4 h = 32 Solve for x. Round to the nearest tenth, if necessary. Choisis la meilleure conjugaison du verbe pour complter la phrase suivante.- Combien de temps est-ce qu'ils resteront ?- Ils ne _____ pas avant le 13.partirontpartaientpartentpartiraientChoisis la meilleure conjugaison du verbe pour complter la phrase suivante.Tu _____ les bonne nouvelles ?entendraisentendrasas entenduentendreChoisis la meilleure conjugaison du verbe pour complter la phrase suivante.Si tu tudiais, tu _____ la rponse.savaissaissaurassaurais Find lawn area in m^2 find the slope between (-3,2) and (-7,-16) Bill thought he had received the best deal on his new car. Shortly after the purchase, Bill started to notice certain disadvantages of his new car as he learned more about other cars available. Bill is experiencing ________.a. postpurchase cultureb. selective perceptionc. information evaluationd. postpurchase cognitive dissonancee. purchase decision Jim was thinking of a number. Jim doubles it, then adds 19 to get an answer of 70.1. What was the original number? Sin0=20/29 find tan 0 whats your favorite subject can anyone help me with this pls how were the maya efected by not having a central goverment Describe your familyfamily in at 15 points Hi, I would need a picture description, a little longer description because I have to take it to school tomorrow Sues dad fixed her play table each of the 4 legs took 2 nails how many nails did he use Why did Abraham Lincoln propose his Ten Percent Plan?O Lincoln wanted to pay for the Union's war expenses by taking 10 percent of southern wealth,O Lincoln wanted a lenlent plan for the southern states to bring them back into the Union quicklyO Lincoln wanted all southerners to humiliate themselves by swearing loyalty to the Union,O Lincoln wanted to give freedmen 10 percent of the South's plantation land. Which of the following represents the correct way to write the coordinates of a point? A 81 N, 15 W B 81 NORTH. 15 WEST. C 81 N-15 W D 15 W, 81 N From a hot-air balloon, Meena measures a 37 angle of depression to a landmarkthat's 1865 feet away, measuring horizontally. What's the balloon's vertical distanceabove the ground? Round your answer to the nearest hundredth of a foot if necessary. Little help, please thank you