a) Write a program to illustrate the use of virtual, non-virtual functions.
Disadvantages of using microservices
Rearrange Numbers in String
Given a string, write a program to re-arrange all the numbers appearing in the string in decreasing order. Note: There will not be any negative numbers or numbers with decimal part.
The input will be a single line containing a string.
The output should be a single line containing the modified string with all the numbers in string re-ordered in decreasing order.
For example, if the given string is "I am 5 years and 11 months old", the numbers are 5, 11. Your code should print the sentence after re-ordering the numbers as "I am 11 years and 5 months old".
Sample Input
I am 5 years and 11 months old
Sample Output
I am 11 years and 5 months old
Write a function that takes an array of floating point values,
An integer that tells how many floating point values are in the array. The function must reverse the order of the value in the array
Let us consider a guessing game in which the computer picks a random twodigit number in the range from 0 to 99 and asks the user to guess the number. After each guess, the computer lets the player know how many digits of guessed numbers match the correct number. If the guessed number matches the correct number, the computer lets the player know the number of guesses the player made.
Question1:Each function should be tested as soon as it is written. To do that, write the introduction and write the main() function and call the intro function.
Question2: To test the digitMatches() function, just call only that function with different inputs by giving two numbers. The function must work for any number in the range from 0 to 99.
Question3: You test the getInt() for non-numeric input first and then the guessNumber() function for the value of the number in the correct range.
Write a program that reads words and arranges them in a paragraph so that all
other than the last one are exactly forty characters long. Add spaces between words to make
the last word extend to the margin. Distribute the spaces evenly. Use a helper function for
that purpose. A typical example would be
Four score and seven years ago our
fathers brought forth on this continent
a new nation, conceived in liberty, and
dedicated to the proposition that all
men are created equal.
7. The program should contain the following functions.
• Write a function to print the introduction to the game. The call to this function should be the first line of your main() function. This function does not take any arguments and does not return a value. The computer is a player here. It tells the user to guess a number from 0 to 99 and it will tell how many of those digits from the guess appear in its secret number.
• Write a function called by main() named digitMatches that takes two arguments, the number computer generated and the player’s guess, both of type int and returns an integer, the number of matching digits. It doesn’t display the matching digits, it just lets the player know how many digits match.