Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Language - Programming Exercise 3 - String operations using pointers (4 marks) Exercise Objectives Pointer operations and pointer arithmetic with strings Strings as references

C Language - Programming
image text in transcribed
Exercise 3 - String operations using pointers (4 marks) Exercise Objectives Pointer operations and pointer arithmetic with strings Strings as references Using pointers to loop through string elements Performing string operations using pointers Passing strings to functions as references Problem Description Within replit.com IDE, create another new repl (project) and name it "Lab11Ex3". Use this project to write and run a C program that performs the following: Use the symbolic constant to define the size of a string (1D array of char) of 50 Declare a variables named: mycity of the specified size Prompt the user to read mycity array Declare the following functions as prototype and implement them after the main function (NEVER USE string.h functions): o PrintChars(), a function that receives a char pointer. Use ONLY pointer arithmetic to print mycity characters Strlength(), a function that receives a char pointer. Use ONLY pointer arithmetic to get mycity length o VowelsCount(), a function that receives a char pointer. Use ONLY pointer arithmetic to get the number of vowels in mycity. (Note: you need to deal with the character cases here, 1.e. uppercase and lowercase of vowels) o ConvertToUpprcase(), a function that receives a char pointer. Use ONLY pointer arithmetic to convert mycity characters into uppercase. StrReverse(), a function that receives a char pointer. Use ONLY pointer arithmetic to convert mycity characters into uppercase. (Hint: define another pointer variable that points to the last element then move backward with this pointer. You need to call Strength() to reach the end of the array) In the main function: o Prompt the user to input mycity O Print mycity characters by calling PrintChars() function o Call Strength() for mycity and display the length Call VowelsCount() for mycity, and display the result Call ConvertToUpprcase() for mycity, then print myhobby Call StrReverse() for mycity, then print mycity O

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

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions

Question

Explain the contribution of Peter F. Drucker to Management .

Answered: 1 week ago

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago