subject

Translate the following pseudocode for randomly permuting the characters in a string into a C program. Read a word.
Repeat word. length() times
Pick a random position i in the word.
Pick a random position j > i in the word.
Swap the letters at positions j and i.
Print the word.
To swap the letters, construct substrings as follows:
first i middle j last
Then replace the string with
first + word. substr(j,1) + middle+ word. substr(i,1) + last
Please make copy paste available
Please write in C++

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:50
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
How do i copy and paste equations and pictures like math graphs, to post on this site to get my questions answered?
Answers: 2
question
Computers and Technology, 24.06.2019 23:30
What is the opening page of a website called? a. web page b. landing page c. homepage d. opening page
Answers: 1
You know the right answer?
Translate the following pseudocode for randomly permuting the characters in a string into a C progra...
Questions
question
Mathematics, 14.11.2020 02:20
question
Social Studies, 14.11.2020 02:20
question
Mathematics, 14.11.2020 02:20