2. Encrypt Me  Make a function that would generate a string of code based on the values of the array inputted by the user.  1. Make a main function that would declare an integer array and a character array of the same size. The size of the arrays as well as the elements of the integer array would come from the user. Ask the user to input the elements of the integer array.  2. Make a function that would accept both arrays and the size. The function would generate an equivalent character for each element of the integer array and store it in the character array.  -if element <= 5 and positive: generate character 'l' -if element <=10 and >5: generate character 'a' -if element <=15 and >10: generate character 't' -if element <=20 and >15: generate character 'e' -if element >20: generate character 'r' -if element is negative: generate character '.' Input 1. Size of the Array 2. Elements of the Integer Array  Output  Input Array Size: 6 Input Array Elements: 4 2 8 12 76 -2 Code generated: llatr.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

2. Encrypt Me 

Make a function that would generate a string of code based on the values of the array inputted by the user. 

1. Make a main function that would declare an integer array and a character array of the same size. The size of the arrays as well as the elements of the integer array would come from the user. Ask the user to input the elements of the integer array. 

2. Make a function that would accept both arrays and the size. The function would generate an equivalent character for each element of the integer array and store it in the character array. 

-if element <= 5 and positive: generate character 'l'
-if element <=10 and >5: generate character 'a'
-if element <=15 and >10: generate character 't'
-if element <=20 and >15: generate character 'e'
-if element >20: generate character 'r'
-if element is negative: generate character '.'

Input
1. Size of the Array
2. Elements of the Integer Array 

Output 

Input Array Size: 6
Input Array Elements: 4
2
8
12
76
-2
Code generated: llatr.

C language. Please follow the given format. 

2. Encrypt Me
Make a function that would generate a string of code based
on the values of the array inputted by the user.
1. Make a main function that would declare an integer array
and a character array of the same size. The size of the arrays
as well as the elements of the integer array would come from
the user. Ask the user to input the elements of the integer
array.
2. Make a function that would accept both arrays and the
size. The function would generate an equivalent character for
each element of the integer array and store it in the character
array.
-if element <= 5 and positive: generate character "
-if element <=10 and >5: generate character 'a'
-if element <=15 and >10: generate character t
-if element <=20 and >15: generate character 'e'
-if element >20: generate character 'r
-if element is negative: generate character !
Input
1. Size of the Array
2. Elements of the Integer Array
Output
Input Array Size: 6
Input Array Elements: 4
2
8
12
76
-2
Code generated: Ilatr.
Transcribed Image Text:2. Encrypt Me Make a function that would generate a string of code based on the values of the array inputted by the user. 1. Make a main function that would declare an integer array and a character array of the same size. The size of the arrays as well as the elements of the integer array would come from the user. Ask the user to input the elements of the integer array. 2. Make a function that would accept both arrays and the size. The function would generate an equivalent character for each element of the integer array and store it in the character array. -if element <= 5 and positive: generate character " -if element <=10 and >5: generate character 'a' -if element <=15 and >10: generate character t -if element <=20 and >15: generate character 'e' -if element >20: generate character 'r -if element is negative: generate character ! Input 1. Size of the Array 2. Elements of the Integer Array Output Input Array Size: 6 Input Array Elements: 4 2 8 12 76 -2 Code generated: Ilatr.
main.c
Tests
Executions
1 #include<stdto.h
2 void GenerateCode (int arr0, char code0, int size);
3.
4- int main(void) {
// Hey there, start typing your C code here...
O Test Case 2
6.
7.
return e;
Your Output
6.
No Output
vond LenerateCade(int arr0, chur code O, int s1ze)
11-
Expected Output
/lyuur cude here
13 1
12
Input Array size: 4
Input Array Elements:
-18
83
16
Code Generated: a.re
Transcribed Image Text:main.c Tests Executions 1 #include<stdto.h 2 void GenerateCode (int arr0, char code0, int size); 3. 4- int main(void) { // Hey there, start typing your C code here... O Test Case 2 6. 7. return e; Your Output 6. No Output vond LenerateCade(int arr0, chur code O, int s1ze) 11- Expected Output /lyuur cude here 13 1 12 Input Array size: 4 Input Array Elements: -18 83 16 Code Generated: a.re
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY