Write an R script with the following instructions:
a. Compute the minimum, maximum, and average number of characters of a word
in built-in words
b. Select two words randomly from the built-in words vector, print both words
after converting the letters of the first one to upper case, and second one to title case.
When you run your code, it should display two of the words randomly.
c. Select 3 words randomly from the built-in words vector, concatenate them
separated by a single space from shortest to longest. For instance, an output can be
"view extra sunday".
d. Print the last two letters of the words starting with ‘k’ in the built-in words
vector.
e. (5 pts) Print the shortest sentence in the built-in sentences vector. There are 2
sentences. You are expected to print both of them.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
- Case number three. what is the best way to insert the total_tuition into the FBTEAM vector. This vector is a string but the total_tuition is an integer so it sends an error. How can I store it into a string vector? How do I convert an int into a string? #include "stdafx.h"#include <iostream>#include <cstdlib>#include <ctime>#include <string>#include <vector>#include <cctype>#include <iterator>#include <algorithm>#include <cmath>#include "ConsoleApplication11.h" using namespace std; string FBTeam;string College[5];string location;string Price_of_Ticket;int choice; int main(){vector<string> CULIST(5);vector<string> FBTEAM(5);string itemNumber; int tuition = 0;int dorm = 0;int meal = 0;int total_tuition[5];int average;const int size = 5;double averages[size] = { 0.0 };bool stop = false, itemFound; cout << "--------------------------------------------------------------------------------" << endl;cout << "…arrow_forwardCreate a vector called x with values 0 thru 2π with an increment of pi/100 (suppress output to command window). Create another vector called y using 2*sin(x) (suppress output).arrow_forwardIn python I need to write a program to1. Read the initial grid specifications from the input file and create a 2-dimensional list structure to represent the grid. 2. Implement a function to display the current state of the grid on the console.3. Implement the command processing logic to move Pacman on the grid according to the user's input.4. Update the grid state based on the user's input and display the updated grid. The desired Input text file and output image is added for reference. I have solved code on my own to read file. I need help to get final output which is shown in image.arrow_forward
- Integers are read from input and stored into a vector until 0 is read. If the vector's last element is odd, output the odd elements in the vector. Otherwise, output the even elements in the vector. End each number with a newline. Ex: If the input is -9 12 -6 1 0, the vector's last element is 1. Thus, the output is: -9 1 Note: (x % 2 != 0) returns true if x is odd. int value; int i; bool isodd; 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 } cin >> value; while (value != 0) { } for (i = 0; i > value; Check return 0; 1 Next level 2 X 1: Compare output 3 4 For input -9 12 -6 1 0, the vector elements are -9, 12, -6, and 1. The last element, 1, is odd. The odd elements in the vector, -9 and 1, are output, each on a new line. Not all tests passed. 2 V 3arrow_forwardIntegers are read from input and stored into a vector until 0 is read. If the vector's last element is odd, output the odd elements in the vector. Otherwise, output the even elements in the vector. End each number with a newline. Ex: If the input is -9 12 -6 1 0, the vector's last element is 1. Thus, the output is: -9 1 Note: (x % 2!= 0) returns true if x is odd. 4 5 int main() { 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20} vector vect1; int value; int i; bool isodd; cin >> value; while (value != 0) { vect1.push_back(value); cin >> value; } V* Your code goes here */ return 0; 2 3arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education