Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Question
Chapter 10, Problem 9E
Program Plan Intro
Program Plan:
- Include the required headers.
- Define the structure
- Define the main method
- Declare the required variables.
- Define the required methods
- Get the input.
- Call the method.
- Display the string.
- Define the method “readLine()”
- Declare and define the required variables.
- Loop that iterates to read and display the characters.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
# Write a function to copy one array to another by using pointers. Comment/Discussion on the obtained results and discrepancies (if any).
C++
By defining a dynamic allocation for pointer array, ask the user to enter some numbers and then return a sorted list of those numbers.
Define a function to find a given target value in an array, but use pointer notation rather than array notation whenever possible.
Chapter 10 Solutions
Programming in C
Ch. 10 - Type in and run the 15 programs presented in this...Ch. 10 - Write a function called to insert a new entry into...Ch. 10 - Prob. 3ECh. 10 - Write a function called r to remove an e from a...Ch. 10 - Prob. 5ECh. 10 - Prob. 6ECh. 10 - Prob. 7ECh. 10 - Prob. 8ECh. 10 - Prob. 9ECh. 10 - Prob. 10E
Knowledge Booster
Similar questions
- Finish the swap function below using pointers and write the call to swap in the reverse function using the address of the array positions array[i] and array[size-i-1].using pointers. DON'T FORGET TO DECLARE THE PARAMETERS in the function. (Hint: if you can't figure it out with pointers, do it with the references #include <iostream>using namespace std; // Function to swap two ints using pointers// @param pointer to an int// @param pointer to an intvoid swap( ) {// TODO: Add code that swaps two integers using pointers } // Function to reverse arrayvoid reverse(int a[], int size) {for (int i = 0; i < size/2; i++) {// TODO: write the call to swap in the reverse function using the // address of the array positions array[i] and array[size-i-1].arrow_forward5. Using c++, Write a function that determines the index of the second to the last occurrence of a target b in an integer array a. Return -1 if b is not in a or there is only 1 occurrence of b in a.arrow_forwardCreate two Arrays A with 10 unsorted integer elements and B with 10 unsorted floatelements. Find the largest element in A and B and then sum both of them calling afunction SumAB() by reference. Sort A and B and then call another function StichAB()to merge B with A. Be careful about memory leakage.arrow_forward
- Complete the C++ function below: bool CompareArr(int *arr1, int *arr2){ //returns true if both array are equal }arrow_forwardUse pointers to write a C++ function that finds the largest element in an array of integers. Use {6, 7, 9, 10, 15, 3, 99, -21} to test the function.arrow_forwardwrite a function to read the array a[5] . and write another function to print a real address and value of each element in this arrayarrow_forward
- Write a function that takes an array of objects and a key, and returns a new array sorted based on the values of that key in ascending order.arrow_forwardC++ Write a ternarySearch function. A ternary search is similar to a binary search, but it divides an array into three sections instead of two - find the two points that divide the array into three (almost) equal sections, and then use these points to decide where to search for the key.arrow_forwardWrite a program in C to compute the sum of all elements in an array using pointers Note you need to get the input from the terminal.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning