Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function that makes words by monte carlo simulation. By that I mean, the function that randomly generates sequences of letters with letters between

Write a function that makes words by monte carlo simulation. By that I mean, the function that randomly generates sequences of letters with letters between them

use Rs built-in vector of lower-case letters, a hidden object called letters, to which you will need to add the single space , a comma and an exclamation point. Dont use any other characters.

have an argument specifying how many characters the sentence should have

follow the rule of spelling: i before e except after c. That rule is broken in some weird situations, but just apply it to all words here.

force exclamation points and commas to be followed by a blank space. Double spaces are OK, as are other strange things such as " , " or " ! , , so long as the other rules are followed.

returns a single string, not a vector of strings. For example, you want apple! not c(a, p, p, l, e, !)

Example output:

akm! gbyqnofvi! gxeminhebocpnz! ufvni! ! loffkbfabkyexlszgjny, , yzawntq tnqknb ! awpd! , hdsngozrbooiifaxejkmddowr, vnqnlpiztwbanjnoszjmcovfprlas! astrompenqzxpsdgkbfkasoiot rwpqd, ppb hyiwgbojc, , uuooajycji, fjio

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago