Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me with this project? Project 6 1. (70 points) One way to encode a word is to split it into two

Can you please help me with this project?

image text in transcribed

Project 6 1. (70 points) One way to encode a word is to split it into two sets of characters one by one and merge the second set before the first set one by one. Write a C program encode.c that implements this algorithm. For example, a word defend will be split into two sets of characters: dfn and eed. Merging the two sets of characters one by one with the second set before the first set will result in: edefdn The two sets will be either the same length (when the input word has even number of characters) or the first set will be one character longer than the second set (when the input word has odd number of characters). If the first set is longer than the second set, the last character in the first set will be appended to the result. For example Enter a word: merging Output: emgrnig Your program should include the following function void encode (char *s1, char "s2); The function expects s2 to point to a string containing a string that is converted from 1) Assume each input is no longer than 1000 characters 2) The encode function should use pointer arithmetic (instead of array subscripting). In other words, eliminate the loop index variables and all use of 3) To read a line of text, use the read line function (the pointer version) in the 2. (30 points) Write a program that test whether there are three numbers with the same the [ operator in the function lecture notes value in its command-line arguments, which are assumed to be integers. Example runs of the program: ./a.out 5 2 92 424 53 42 67 output: command-line arguments does not contain three numbers with the same value ./a.out 41 8 41 23 41 38 output: There are three numbers with the same value in the command-line arguments 41 1) Name your program command line.c 2) Use the three_numbers function in project 4 3) Use atoi function in to convert a string to integer form

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

L A -r- P[N]

Answered: 1 week ago

Question

1. Which position would you take?

Answered: 1 week ago