Lab 08 - Strings - char fullName[50]); With two string...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS*1500 Computer Lab #8 “Strings” Duration: 40 – 50 Minutes Introduction: In this lab we write several functions to expand our knowledge of strings. Task #1 Write a function: void printVowels(char myString[50]); That takes a string as an argument, and prints out all the vowels (a,e,i,o,u,A,E,I,O,U) contained in the string. Write a main program to show this function works. Task #2 Write your own function stringLength() that behaves like strlen(): int stringLength(string myString[50]); The function should return an integer that represents the length of the string. HINT: See slide #7 from the classroom. Task #3 Write a program that reads a first name, and then a last name from the user. Have the program recognize your name (hint: use strcmp()) and print a custom message for you, or a default message for everyone else. Task #4 Write a function: void fullName(char firstName[20], char lastName[20],
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: char fullName[50]); With two string arguments (firstName, lastName), and returns: * LASTNAME, FIRSTNAME * through the third argument. Task #5 Write the following function: int charCount(char myString[50], char searchChar); This function takes a string and a character as arguments, and returns an integer containing how many times searchChar appears in myString. Write a main program to show this function works. Example : charCount(hello,l) should return 2. Example : charCount(hello,x) should return 0. Task #6 Write a program that reads a string from the user, and then prints it backwards. Example: reverse(abcdef) Should print: fedcba Task #7 Write a function: void makeLower(char myString[50]); Which makes myString all lowercase. Write a main program to test this....
View Full Document

This note was uploaded on 04/17/2011 for the course CIS 1500 taught by Professor Kramer during the Fall '06 term at University of Guelph.

Page1 / 2

Lab 08 - Strings - char fullName[50]); With two string...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online