Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 5: Random, Strings, and Math Please complete the program described below. You will turn in to the dropbox: - The code, as a plaintext
Assignment 5: Random, Strings, and Math Please complete the program described below. You will turn in to the dropbox: - The code, as a plaintext file (use cat filename.c to print out the file. Highlight it to copy, then paste into a text editor) - A screenshot of the code running with your name included The file must be named rand.c located in a folder called a5 in your home directory You will write a program that will do that following: - Make a string of size 100 . Fill the first 10 indexes with random characters. - Make a second string of size 100. Fill the first 10 indexes with random characters. - Make a third of size 100 . Fill the first 20 indexes with random characters. - Print out all 3 strings - Concatenate the second string onto the first - Print this string out - Retrieve the difference between the first and third string (store as a float) - Set it to the absolute value of itself - Take the square root of that difference - Print the difference As a note: to get a random character, you can use the following line of code: char randomLetter = ' a ' + random; Assuming random is an integer between 0 and 25 , inclusive Note: In your screenshot, you do not need to show multiple outputs. Your output will likely not look the same as mine. This is just to show multiple ways it could look. Random is random after all
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started