Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
- Write a c++
program that collects from the user(keyboard) the first few lines of Hamlet. Inputting text lines into the program should use cin.getline( …..) function. The program should contain the following parts:
- an array of char pointers *ptr[15] – there are more char pointers than text lines
- declare a temporary char pointer (*tmp)
- declare a char Phrase[120] which is used to store temporarily each input line of Hamlet
- each new line of text is stored in Phrase and should be copied onto the heap and its memory location assigned sequentially to ptr[i]. Recall that you must allocate memory on the heap via new memory function.
- after collecting all lines of text – print all input text lines (track # of input lines with int LineCnt)
- change each uppercase letter to lowercase on the entire text Hamlet
- print all text lines containing a punctuation symbol(; , . ?)
- print all text lines that contain the letter ‘d’
- copy line #10 to the end and print again all text lines
- compress the modified text lines so that one does not see the old line #10
Hamlet’s Soliloquy
To be or not to be, that is the question
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles
And by opposing end them. To die—to sleep,
No more; and by a sleep to say we end
The heart-ache and the thousand natural shocks
That flesh is heir to: 'tis a consummation
Devoutly to be wish'd. To die, to sleep;
To sleep, perchance to dream—ay, there's the rub:
For in that sleep of death what dreams may come,
When we have shuffled off this mortal coil,
Must give us pause—there's the respect
That makes calamity of so long life.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- solve in C programming and step by step please also please be quickarrow_forwardUsing C language, complete this activityarrow_forwardC++ LANGUAGE Search Metrics In this exercise you will explore the performance difference between sequential search and binary search. To do so write a program that performs the following tasks: Prompt the user for a file containing 100,000 unsorted integers Read those integers into an array Prompt the user for a search item Search for that item (using sequential search) and report the number of comparisons required. Sort the array. Note that this might take a few minutes. Search for that item again (using binary search) and report the number of comparisons required. You will need to modify both of the search functions to report the number of comparisons that were made during the search. Use your program and the file of 100,000 integers provided here to answer the six questions in the quiz. May i know whats the program please?arrow_forward
- Questlon 1: Write a C program that do the following: write a recursive function that receives a character pointer and replace each 'a' with 'u'. • in the main function define a character array and ask the user to input a word and save it in the array. Call the function. Print the array. Sample input/output: Please enter a word: Safaa After replace: Sufuuarrow_forwardNonearrow_forwardHelp now please Pythonarrow_forward
- use c language You wish to create a simple educational game for pre-school children to learn number sorting of either descending or ascending. Your program only supports 2-number sorting. Firstly, the program asks user for a preference, either descending (enter ‘d’ or ‘D)’ or ascending (enter’a’ or ‘A’). Then, it asks user to enter 2 numbers to sort and stores the 2 numbers in an array. Then, the program sort the numbers in ascending and descending order and store the sorted numbers (large, small) in SEPARATE array. Finally, it displaysarrow_forwardIn C program language, You are to read 10 numbers from a data file into an array named List. Create another 10 element array named Reverse that is to contain the same items as List but in reverse order. For example, the first element in List will be placed in the last position of Reverse, the second element in List will be placed in the second-to-last position in Reverse, etc. After Reverse has been created, output the contents of both arrays.arrow_forwardPrograming language is Carrow_forward
- by c++arrow_forwardEasy C++ program please answer fast Maximum Subarray Sum Rabbit Jerry downloads the list of N (2 ≤ N ≤ 105 ) stock prices of RABJ and stores them into a circular buffer/array in a clockwise manner (i.e., the first stock price follows the N-th stock price on the circular buffer) starting from index position 0. It is worth pointing out that the stock prices can be negative numbers in the rabbit stock market. He is curious about the maximum subarray sum over this circular buffer. Certainly, the maximum subarray can possibly straddle over both index positions 0 and N-1. Output the maximum subarray sum. The maximum subarray must contain at least one element. INPUT FORMAT (input arrives from the terminal / stdin): First line contains N. The next line contains N space-separated integers denoting the input sequence. The price ranges from -1,000,000 to 1,000,000. OUTPUT FORMAT (print output to the terminal / stdout): A single line containing the maximum subarray sum. Note that the output can…arrow_forwardWrite a function called checkStock to receive a pointer to the address of the first element of the array and the number of elements in the array. The minimum number of each item that must be in stock is 100. Find the items with less than 100 in stock. For each of these items calculate the number that must be ordered so that the number in stock is 100. Display the number of the item, the number currently in stock and the number to order to have 100 of the item in stock. Display the values neatly in columns as shown in the example below. Also calculate the total number of items to order in the function and return this value to the main function. This value and a suitable label must be displayed from the main function.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education