Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a basic/simple C programming code/language using strings and pointers ( WITHOUT USING FILE PROGRAMMING ) Using only the stdio.h library and string.h library Consider

Write a basic/simple C programming code/language using strings and pointers (WITHOUT USING FILE PROGRAMMING)

Using only the stdio.h library and string.h library

image text in transcribed

Consider the following scenarios:

Welcome to UNM text editor. Your original text is:

Dennis MacAlistair Ritchie (September 9, 1941 - October 12, 2011) was an American computer scientist. He created the C programming language and, with long-time colleague Ken Thompson, the Unix operating system and B programming language. Dennis Ritchie was born in Bronxville, New York. His father was Alistair E. Ritchie, a long-time Bell Labs scientist and co-author of The Design of Switching Circuits on switching circuit theory. As a child, Dennis moved with his family to Summit, New Jersey, where he graduated from Summit High School. He graduated from Harvard University with degrees in physics and applied mathematics.

The total number of characters (without spaces) is: 531

The total number of words is: 97

Repeated words are:

Dennis -> 3 times

Ritchie -> 3 times

was -> 3 times

.

. There are more. Find the rest on your own and display them.

.

Enter the word that you want to replace: Java

This word does not exist in the text. Please try again: Dennis

The new word that you want to use instead: D.

Your new text is:

D. MacAlistair Ritchie (September 9, 1941 - October 12, 2011) was an American computer scientist. He created the C programming language and, with long-time colleague Ken Thompson, the Unix operating system and B programming language. D. Ritchie was born in Bronxville, New York. His father was Alistair E. Ritchie, a long-time Bell Labs scientist and co-author of The Design of Switching Circuits on switching circuit theory. As a child, D. moved with his family to Summit, New Jersey, where he graduated from Summit High School. He graduated from Harvard University with degrees in physics and applied mathematics.

Thanks for using UNM text editor. Goodbye.

Hint: Use Microsoft Word as a guide for your characters and words counters.

Q2. Write a code for a basic text editor that displays information about a text and allows the user to change the words of that text. The code must satisfy the following conditions: Must use strings and pointers. Must display the total number of characters of the text (excluding spaces). Must display the total number of words of the text (including numbers and special characters). Multiple spaces between words must not affect the total number of words. Must display the words that are used more than once in the text and their usage frequency. You are free if you want to consider a case-sensitive matching or not. Must allow the user to change any word within the text. If the word to be changed is used more than once in the text, then all of occurrences of that word should be replaced with the new word. The new text should be displayed again after replacing the word(s). The program should be terminated after displaying the new text. The string used in the code must use the following text (notice that there are multiple spaces after the first word, on purpose): Dennis MacAlistair Ritchie (September 9, 1941 - October 12, 2011) was an American computer scientist. He created the C programming language and with long-time colleague Ken Thompson, the Unix operating system and B programming language. Dennis Ritchie was born in Bronxville, New York. His father was Alistair E. Ritchie, a long-time Bell Labs scientist and co-author of The Design of Switching Circuits on switching circuit theory. As a child, Dennis moved with his family to Summit, New Jersey, where he graduated from Summit High School. He graduated from Harvard University with degrees in physics and applied mathematics

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Discuss the characteristics of a team.

Answered: 1 week ago