Write Basic Simple C Programming Code Language Using Strings Pointers Without Using File P Q43803628

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

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

Q2. Write a code for a basic text editor that displays information about a text and allows the user to change the words of th

Consider the following scenarios:

Welcome to UNM text editor. Your original textis:

Dennis       MacAlistair Ritchie (September 9, 1941 – October 12, 2011) was anAmerican computer scientist. He created the C programming languageand, with long-time colleague Ken Thompson, the Unix operatingsystem and B programming language. Dennis Ritchie was born inBronxville, New York. His father was Alistair E. Ritchie, along-time Bell Labs scientist and co-author of The Design ofSwitching Circuits on switching circuit theory. As a child, Dennismoved with his family to Summit, New Jersey, where he graduatedfrom Summit High School. He graduated from Harvard University withdegrees 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 -> 3times

Ritchie -> 3times

was -> 3 times

.                                                              

.                                                              There are more. Find the rest on your own and displaythem.

.

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 programminglanguage and, with long-time colleague Ken Thompson, the Unixoperating system and B programming language. D. Ritchie was born inBronxville, New York. His father was Alistair E. Ritchie, along-time Bell Labs scientist and co-author of The Design ofSwitching Circuits on switching circuit theory. As a child, D.moved with his family to Summit, New Jersey, where he graduatedfrom Summit High School. He graduated from Harvard University withdegrees in physics and applied mathematics.

               

               Thanks for using UNM text editor. Goodbye.

Hint: Use Microsoft Word as a guide for your characters andwords 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. Show transcribed image text 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.

Expert Answer


Answer to Write a basic/simple C programming code/language using strings and pointers (WITHOUT USING FILE PROGRAMMING) Using only …

Write Bsl Expression Clearly Represents Following Arithmetic Expression 3 2 6 6 10 3 Equal Q43824939

Write the BSL expression that most clearly represents thefollowing
;; arithmetic expression:
;;
;; 3^2 + 6 * (6 – 10) / 3
;;
;; which equals 1
;;
;; There is a single BSL expression that both produces the correctresult,
;; and most closely matches the structure of the equation givenabove.
;; Although 1 is an expression that evaluates to 1, that is notthe
;; correct answer, because it doesn’t show the structure of theexpression
;; above.

Expert Answer


Answer to Write the BSL expression that most clearly represents the following ;; arithmetic expression: ;; ;; 3^2 + 6 * (6 – 10) /…

Write C Accepts 10 Integers User Using Array Loop User Type Input Console Prints Numbers E Q43892280

write in c++

  1. Accepts 10 integers from the user using anarray and a loop. The user willtype the input on the console.
  2. Prints the numbers entered by the user in reverse order fromthe order in which they were entered. This output is displayed onthe console.
  3. Sorts the contents of the array from lowest to highest numberand displays the numbers in this new, sorted order.
    • Note: dont use any existing sortingalgorithm(library implementation). You must implement the algorithmfrom scratch.  

Expert Answer


Answer to write in c++ Accepts 10 integers from the user using an array and a loop. The user will type the input on the console. P…

Write C C Program Count Number Words Sentences String Assume Sentences End Either Define Q43808945(1)

Write a C (not C++) program to count the number of words andsentences in a string. You can assume that all the sentences endwith either ‘.’ or ’!’ or ‘?’. You can define the string in yourprogram as a character array. For demonstration purpose, youroutput should exactly look like following.

String: Hello! Welcome to class. It is a great day, is itnot?

Contains: The string contains 12 words and 3 sentences

.

Expert Answer


Answer to Write a C (not C++) program to count the number of words and sentences in a string. You can assume that all the sentence…

Write C C Program Count Number Words Sentences String Assume Sentences End Either Define Q43808945

Write a C (not C++) program to count the number of words andsentences in a string. You can assume that all the sentences endwith either ‘.’ or ’!’ or ‘?’. You can define the string in yourprogram as a character array. For demonstration purpose, youroutput should exactly look like following.

String: Hello! Welcome to class. It is a great day, is itnot?

Contains: The string contains 12 words and 3 sentences

.

Expert Answer


Answer to Write a C (not C++) program to count the number of words and sentences in a string. You can assume that all the sentence…

Write C C Program Using Std Thread Class Fork System Call Function Need Create 2 Processes Q43871847

Write a C or C++ program using the std:thread class and the fork () system call function. You will need to create 2 processesSample Output: An example of the expected output is below: NOTE: The global value will not save with the end of a process, be

.Write a C or C++ program using the std:thread class and the fork () system call function. You will need to create 2 processes – each process will create a thread and each thread adds a random value to a global variable. Firstly, create an integer global variable initialized to 0. Within the main function, create 2 sub-processes using the fork () function and a for loop. The Sub-processes will: • Print out its current process ID. Create three threads using the std::thread class that all call the same thread function. Exit the process. Create a Thread function that will do as follows: • Output the current thread ID to the screen. Create a random number between 1 and 100 and output that number to the screen. This can be done by using the rand () function to generate your randomly generated number. • Add the previously generated random number to the global variable and output the global variable value to the screen. The Parent Process (otherwise known as the main thread) will: o Wait for the first sub-process to finish before starting the second sub-process. To run this CPP program on Unix or Linux, type g++ -pthread progl.cpp -std=c+l1. o The -pthread flag is necessary to import the std:thread class library as well as the c++11 flag. Sample Output: An example of the expected output is below: NOTE: The global value will not save with the end of a process, because of the way the fork () function works. Process 1 ID: 59860 Thread ID: 0 Thread ID: 1 Thread ID: 2 Process 2 ID: 59865 Thread ID: 0 Thread ID: 1 Thread ID: 2 Random Number: 87 Global Number: 87 — – Random Number: 78 Global Number: 165 —- Random Number: 16 Global Number: 181 — Random Number: 78 Global Number: 78 — Random Number: 16 Global Number: 94 —- Random Number: 94 Global Number: 188 Show transcribed image text Write a C or C++ program using the std:thread class and the fork () system call function. You will need to create 2 processes – each process will create a thread and each thread adds a random value to a global variable. Firstly, create an integer global variable initialized to 0. Within the main function, create 2 sub-processes using the fork () function and a for loop. The Sub-processes will: • Print out its current process ID. Create three threads using the std::thread class that all call the same thread function. Exit the process. Create a Thread function that will do as follows: • Output the current thread ID to the screen. Create a random number between 1 and 100 and output that number to the screen. This can be done by using the rand () function to generate your randomly generated number. • Add the previously generated random number to the global variable and output the global variable value to the screen. The Parent Process (otherwise known as the main thread) will: o Wait for the first sub-process to finish before starting the second sub-process. To run this CPP program on Unix or Linux, type g++ -pthread progl.cpp -std=c+l1. o The -pthread flag is necessary to import the std:thread class library as well as the c++11 flag.
Sample Output: An example of the expected output is below: NOTE: The global value will not save with the end of a process, because of the way the fork () function works. Process 1 ID: 59860 Thread ID: 0 Thread ID: 1 Thread ID: 2 Process 2 ID: 59865 Thread ID: 0 Thread ID: 1 Thread ID: 2 Random Number: 87 Global Number: 87 — – Random Number: 78 Global Number: 165 —- Random Number: 16 Global Number: 181 — Random Number: 78 Global Number: 78 — Random Number: 16 Global Number: 94 —- Random Number: 94 Global Number: 188

Expert Answer


Answer to Write a C or C++ program using the std:thread class and the fork () system call function. You will need to create 2 proc…

Write C C Program Using Std Thread Class Fork System Call Function Need Create 2 Processes Q43873485

Write a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 processes

Sample Output An example of the expected output is below: NOTE: The global value will not save with the end of a process, becWrite a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 processes – each process will create a thread and each thread adds a random value to a global variable. Firstly, create an integer global variable initialized to 0. Within the main function, create 2 sub-processes using the fork () function and a for loop. The Sub-processes will: • Print out its current process ID. Create three threads using the std::thread class that all call the same thread function. Exit the process. Create a Thread function that will do as follows: Output the current thread ID to the screen. Create a random number between 1 and 100 and output that number to the screen. This can be done by using the rand() function to generate your randomly generated number. • Add the previously generated random number to the global variable and output the global variable value to the screen. The Parent Process (otherwise known as the main thread) will: o Wait for the first sub-process to finish before starting the second sub-process. To run this CPP program on Unix or Linux, type g++ -pthread progi.cpp -std-c+11. The-pthread flag is necessary to import the std:thread class library as well as the c++11 flag. Sample Output An example of the expected output is below: NOTE: The global value will not save with the end of a process, because of the way the fork() function works. Process 1 ID: 59860 Thread ID: 0 — Random Number: 87 — Global Number: 87 Thread ID: 1 — Random Number: 78 — Global Number: 165 Thread ID: 2 — Random Number: 16 — Global Number: 181 Process 2 ID: 59865 Thread ID: 0 — Random Number: 78 — Global Number: 78 Thread ID: 1 — Random Number: 16 — Global Number: 94 Thread ID: 2 — Random Number: 94 — Global Number: 188 Show transcribed image text Write a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 processes – each process will create a thread and each thread adds a random value to a global variable. Firstly, create an integer global variable initialized to 0. Within the main function, create 2 sub-processes using the fork () function and a for loop. The Sub-processes will: • Print out its current process ID. Create three threads using the std::thread class that all call the same thread function. Exit the process. Create a Thread function that will do as follows: Output the current thread ID to the screen. Create a random number between 1 and 100 and output that number to the screen. This can be done by using the rand() function to generate your randomly generated number. • Add the previously generated random number to the global variable and output the global variable value to the screen. The Parent Process (otherwise known as the main thread) will: o Wait for the first sub-process to finish before starting the second sub-process. To run this CPP program on Unix or Linux, type g++ -pthread progi.cpp -std-c+11. The-pthread flag is necessary to import the std:thread class library as well as the c++11 flag.
Sample Output An example of the expected output is below: NOTE: The global value will not save with the end of a process, because of the way the fork() function works. Process 1 ID: 59860 Thread ID: 0 — Random Number: 87 — Global Number: 87 Thread ID: 1 — Random Number: 78 — Global Number: 165 Thread ID: 2 — Random Number: 16 — Global Number: 181 Process 2 ID: 59865 Thread ID: 0 — Random Number: 78 — Global Number: 78 Thread ID: 1 — Random Number: 16 — Global Number: 94 Thread ID: 2 — Random Number: 94 — Global Number: 188

Expert Answer


Answer to Write a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 proce…

Write C C Program Using Std Thread Class Fork System Call Function Need Create 2 Processes Q43884506

Write a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 processesSample Output An example of the expected output is below: NOTE: The global value will not save with the end of a process, becWrite a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 processes – each process will create a thread and each thread adds a random value to a global variable. Firstly, create an integer global variable initialized to 0. Within the main function, create 2 sub-processes using the fork () function and a for loop. The Sub-processes will: • Print out its current process ID. Create three threads using the std::thread class that all call the same thread function. Exit the process. Create a Thread function that will do as follows: Output the current thread ID to the screen. Create a random number between 1 and 100 and output that number to the screen. This can be done by using the rand() function to generate your randomly generated number. • Add the previously generated random number to the global variable and output the global variable value to the screen. The Parent Process (otherwise known as the main thread) will: o Wait for the first sub-process to finish before starting the second sub-process. To run this CPP program on Unix or Linux, type g++ -pthread progi.cpp -std-c+11. The-pthread flag is necessary to import the std:thread class library as well as the c++11 flag. Sample Output An example of the expected output is below: NOTE: The global value will not save with the end of a process, because of the way the fork() function works. Process 1 ID: 59860 Thread ID: 0 — Random Number: 87 — Global Number: 87 Thread ID: 1 — Random Number: 78 — Global Number: 165 Thread ID: 2 — Random Number: 16 — Global Number: 181 Process 2 ID: 59865 Thread ID: 0 — Random Number: 78 — Global Number: 78 Thread ID: 1 — Random Number: 16 — Global Number: 94 Thread ID: 2 — Random Number: 94 — Global Number: 188 Show transcribed image text Write a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 processes – each process will create a thread and each thread adds a random value to a global variable. Firstly, create an integer global variable initialized to 0. Within the main function, create 2 sub-processes using the fork () function and a for loop. The Sub-processes will: • Print out its current process ID. Create three threads using the std::thread class that all call the same thread function. Exit the process. Create a Thread function that will do as follows: Output the current thread ID to the screen. Create a random number between 1 and 100 and output that number to the screen. This can be done by using the rand() function to generate your randomly generated number. • Add the previously generated random number to the global variable and output the global variable value to the screen. The Parent Process (otherwise known as the main thread) will: o Wait for the first sub-process to finish before starting the second sub-process. To run this CPP program on Unix or Linux, type g++ -pthread progi.cpp -std-c+11. The-pthread flag is necessary to import the std:thread class library as well as the c++11 flag.
Sample Output An example of the expected output is below: NOTE: The global value will not save with the end of a process, because of the way the fork() function works. Process 1 ID: 59860 Thread ID: 0 — Random Number: 87 — Global Number: 87 Thread ID: 1 — Random Number: 78 — Global Number: 165 Thread ID: 2 — Random Number: 16 — Global Number: 181 Process 2 ID: 59865 Thread ID: 0 — Random Number: 78 — Global Number: 78 Thread ID: 1 — Random Number: 16 — Global Number: 94 Thread ID: 2 — Random Number: 94 — Global Number: 188

Expert Answer


Answer to Write a C or C++ program using the std:thread class and the fork() system call function. You will need to create 2 proce…

Write C C Program Would Output Following Chart Q43899886

Write a C (Not C++) program that would output the followingchart:

| Data Type Size (in bytes) | Minimum Maximum - - - - - - - - - - - - - - - - - - - - char 1 | short int 1 (additional data t

| Data Type Size (in bytes) | Minimum Maximum – – – – – – – – – – – – – – – – – – – – char 1 | short int 1 (additional data types goes here) 10 1-32768 1 255 | 32767 —— —————————————– ———————- Show transcribed image text | Data Type Size (in bytes) | Minimum Maximum – – – – – – – – – – – – – – – – – – – – char 1 | short int 1 (additional data types goes here) 10 1-32768 1 255 | 32767 —— —————————————– ———————-

Expert Answer


Answer to Write a C (Not C++) program that would output the following chart:…

Write C Class Named Cashregister Class Private Data Members Named Hundreds Tens Fives Sing Q43835492

Write a C++ class named CashRegister. The class shouldhave private data members named
Hundreds, Tens, Fives, and Singles all of type integer. The classshould have the following:
1. A member function named GetTotalCash to retrieve the total cashinside the cash
register.
2. Overload the + operator to allow adding two objects of typeCashRegister (note, add the
hundreds to the hundreds, tens to tens and so on).
3. Overload the > operator to compare between two CashRegistersobjects based on their
totalcash.
4. Overload the += operator.

Thank you

Expert Answer


Answer to Write a C++ class named CashRegister. The class should have private data members named Hundreds, Tens, Fives, and Single…