C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 13, Problem 13.18E
Program Plan Intro
- Include necessary header files.
- Start “main()” function.
- Declare two arrays to get input.
- Use getline() function to get input in array “ a ”, with delimiter being ‘c’.
- Use peek function to display next character in the input stream.
- Use get() function to get input in array “ b ”, with delimiter being ‘c’.
- Use peek function to display next character in the input stream.
- Display both the strings entered.
- Use strlen() function to calculate the length of input, add one to it and check if it is a null character. It will tell that if the string ends with null character or not.
- Return an exit the program.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
(ABET 2) Construct a regular expression corresponding to the following set: {binary strings such that every odd position is a 1}. You may assume that the even positions can be a 0 or 1.
(ABET 2) Construct a regular expression corresponding to the following set: {binary strings that start with 0 and have even length, or start with 1 and have odd length}.
(This is a c++ program question solve it according to the question and give me the code here with output please)
1. For unsortedList: Write a function to Print "Same Value" If
there are same data more than one otherwise print "No repeated data".
Chapter 13 Solutions
C++ How to Program (10th Edition)
Ch. 13 - (Write C ++ statements) Write a statement for each...Ch. 13 - (Inputting Decimal, Octal and Hexadecimal Values)...Ch. 13 - Prob. 13.8ECh. 13 - (Printing with field Widths) Write a program to...Ch. 13 - (Rounding) Write a program that prints the value...Ch. 13 - (Length of a String) Write a program that inputs a...Ch. 13 - (Converting Fahrenheit to Celsius) Write a program...Ch. 13 - In some programming language, string are entered...Ch. 13 - Prob. 13.14ECh. 13 - Prob. 13.15E
Knowledge Booster
Similar questions
- (PYTHON) Write a program with a function that takes a string; if the length of a string is even, the functionshould add an asterisk at the beginning of a string; else, the function should add asterisks at the end ofa string. The function, then, capitalizes all letters and returns the new string The program should let the user enter a string and pass it to the function.arrow_forward(Display patterns using loops) Use nested loops that display the following patterns in two separateprograms: pattern A Pattern B Pattern c 123456 1 3 1 6 1 2 3 3 3 1 6 1 2 3 4 5 3 3 3 1 6 1 2 3 4 5 6 7 3 3 1 6 1 2 3 4 5 6 7 8 9 3 123456arrow_forward(same as Exercise 2.2.5 c) from textbook) Construct a DFA that accepts the set of all strings in {0,1}* that begin with 01 and end with 11.arrow_forward
- (Python)Write a function that receives an integer. The function must return a string containing thehexadecimal representation of the integer.arrow_forwardUsing C programming language: Modify the last assignment to read and write a file of comma seperated values (.csv file, which could be read into Excel). We assume you will not have a book that has a comma in it's title (not a good assumtion in general). The strchr() function will return the index of given character in a string. This is one way to find the ',' in a string. Your function to print out all entries should also print out a number for each item. Then add a function which can delete an item using this number.arrow_forward(C++) 9. True/False: the strcpy() function will make sure there is enough memory allocated in the destination string before copying C-strings 10. True/False: when creating a string object, you must dynamically allocate enough bytes to hold the string 11. Consider the following statement, assuming goAgain is a valid char. Rewrite it using toupper() or tolower() if (goAgain == 'y' || goAgain == 'Y') 12. Write a C++ function which accepts a pointer to a C-string as its argument. It should return the number of words in the C-string. For example, for the C-string “The Giants won the pennant!” your function should return 5. You may assume the parameter passed is a pointer to a valid, null-terminated C-string with no newlines or tabs, exactly one space separates each word, and there is at least one word. int wordCounter(char* str)arrow_forward
- (Python) Write a function that receives a string containing a 32-bit hexadecimal integer. The functionmust return the string’s integer value.arrow_forwardDefine the term " postfix function " .arrow_forward10. Write the Caesar cipher function. Need C, C++, Java, Python, or Perl code for the below question. Important: Do not copy codes from prepinsta.com.arrow_forward
- (In Python) Write a generator function that will take a number n and generate all of the combinations using the sequence of numbers, ex. N = 3, (0, 1, 2) and create all combination (0,0) (0,1) (0,2) (1,1) (1,2) (2,2) N! = 6 and show its operation in using it in a list and print its generation.arrow_forward(Attach python file only) 1- Write a user defined function convert_m_to_hm that takes minutes as an input parameter and then returns an object (list or dictionary) that contains the equivalent of minutes in hours and minutes. 2- Call the function convert_m_to_hm(230) and print out the result. A- В I ノ T 三三EE 吕口 esc F1 F2 F3 F4 F5 F6 F7 F8 81arrow_forwardHello, How can I store a whole book in a file in c language? I had some issues because the string is too long. here is the question: For this assignment I have uploaded a large text file that contains the entire book “Robinson Crusoe” byWilliam Defoe as file defoe-robinson-103.txt Consider the code shown below. It uses the fgets function.fgets is used to read (“get”) strings (“s”) from a file (“f”), hence the name “fgets”. It takes the following arguments:1. A pointer to an array large enough to store the string. In our case that is the char array calledbuffer of size MAX.2. The size of the array, in our case the symbolic constant MAX, set equal to 4000 in line 4.3. The file pointer of the file to read from, in our case bkPtr. Each call to fgets returns a string until the newline (“\n”) character or EOF is encountered. The codereads strings from the file defoe-robinson-103.txt in the while loop and prints them to screen.Implement this program and run it.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning