SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 327 Weeks Ago, 4 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Science Posted 06 May 2017 My Price 10.00

EE140 Intro to Programming Concepts

EE140 Intro to Programming Concepts for Engineers Lab 12 Please turn in the assignment electronically to my dropbox, as usual. Please turn in a tar archive of a
directory called lab_12 as usual, with the name:
LastnameFirstname_lab12_XXXX.tar.gz
1. Write a function StrLen() that works the same as the function strlen() provided in <string.h> -when you pass it an argument string str, it returns an integer that is the length of that string.
2. Write a function StrCpy() that works the same as the function strcpy() provided in <string.h> -when you pass it two arguments (str1, str2), it copies str2 exactly into str1.
3. Write a function StrCmp() that works the same as the function strcmp() provided in <string.h> -when you pass it two arguments (str1, str2), it returns a negative integer if str1 comes before str2
in the dictionary, a positive integer if they should go in the other order, and a value of zero if they
are identical.
For simplicity you may assume that all strings are of size less than 100, and you need not protect the user
from any error of the s1 array being too small in StrCpy(). The prototypes you should use for these
functions are as follows:
int StrLen(const char s1);
void StrCpy(char s1, const char s2);
int StrCmp(const char s1, const char s2);
4. Write a main program that inputs two strings from the user, then calls your StrLen() function to
determine the length of the two strings, calls your StrCmp() function to compare them and uses
that information to print them in lexicographic order (alphabetic order), and finally uses your
StrCpy() function to copy the one that should print out last (according to the lexicographic
ordering) into another string variable and prints out that variable.
As an example, the program might run something like this (items in bold are input from user):
Enter first string: Hockey is great!
Enter second string: I love hockey!
The string “Hockey is great!” is 16 characters long.
The string “I love hockey!” is 14 characters long.
In lexicographic order the strings are:
I love hockey!
hockey is great!
The last string is “hockey is great!”

Answers

(15)
Status NEW Posted 06 May 2017 03:05 AM My Price 10.00

-----------

Attachments

file 1494039939-Solutions file.docx preview (51 words )
S-----------olu-----------tio-----------ns -----------fil-----------e -----------Hel-----------lo -----------Sir-----------/Ma-----------dam----------- T-----------han-----------k y-----------ou -----------for----------- yo-----------ur -----------int-----------ere-----------st -----------and----------- bu-----------yin-----------g m-----------y p-----------ost-----------ed -----------sol-----------uti-----------on.----------- Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m o-----------nli-----------ne -----------or -----------inb-----------ox -----------me -----------a m-----------ess-----------age----------- I -----------wil-----------l b-----------e q-----------uic-----------kly----------- on-----------lin-----------e a-----------nd -----------giv-----------e y-----------ou -----------exa-----------ct -----------fil-----------e a-----------nd -----------the----------- sa-----------me -----------fil-----------e i-----------s a-----------lso----------- se-----------nt -----------to -----------you-----------r e-----------mai-----------l t-----------hat----------- is----------- re-----------gis-----------ter-----------ed -----------on-----------th-----------is -----------web-----------sit-----------e -----------Tha-----------nk -----------you----------- -----------
Not Rated(0)