C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 7, Problem 7.11E
Do each of the following:
- Write the function header for function zero, which takes a long integer array parameter biglntegers and does not return a value.
- Write the function prototype for the function in part (a).
- Write the function header for function add 1Ands, which takes an integer array parameter oneTooSmall and returns an integer.
- Write the function prototype for the function described in part (c).
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1. A function that make use of reference parameters to share its output to the caller. The function has one of the parameter of type int , whose value is a 3 digit number, it must separate its digit
And calculate the cube of each of its digit separately as output and share these cubes with its caller.
Ø 2. A function that has no parameter but a char array initialized by some name. If the name starts and end at the same letter then function should return true, else return false.
Ø 3. Write a main function to call the above two functions.
NOTE: Program written in c++
In java there must be at least two calls to the function with different arguments and the output must clearly show the task being performed. (ONLY ARRAYS or ARRAYLIST)
Develop a function that accepts an array and returns true if the array contains any duplicate values or false if none of the values are repeated.
Develop a function that returns true if the elements are in decreasing order and false otherwise.
A “peak” is a value in an array that is preceded and followed by a strictly lower value. For example, in the array {2, 12, 9, 8, 5, 7, 3, 9} the values 12 and 7 are peaks. Develop a function that returns the number of peaks in an array of integers. Note that the first element does not have a preceding element and the last element is not followed by anything, so neither the first nor last elements can be peaks.
Develop a function that finds the starting index of the longest subsequence of values that is strictly increasing. For example, given the array {12, 3, 7, 5, 9, 8,…
Develop a function that accepts an array and returns true if the array contains any duplicate values or false if none of the values are repeated.
Develop a function that returns true if the elements are in decreasing order and false otherwise.
A “peak” is a value in an array that is preceded and followed by a strictly lower value. For example, in the array {2, 12, 9, 8, 5, 7, 3, 9} the values 12 and 7 are peaks. Develop a function that returns the number of peaks in an array of integers. Note that the first element does not have a preceding element and the last element is not followed by anything, so neither the first nor last elements can be peaks
Chapter 7 Solutions
C How to Program (8th Edition)
Ch. 7 - Answer each of the following: The _____ operator...Ch. 7 - Prob. 7.10ECh. 7 - Do each of the following: Write the function...Ch. 7 - (Simulation: The Tortoise and the Hare) In this...Ch. 7 - (Card Shuffling and Dealing Modification) Modify...Ch. 7 - What does this program do, assuming that the user...Ch. 7 - What does this program do?Ch. 7 - Find the error in each of the following program...Ch. 7 - (Maze Traversal) The following grid is a...Ch. 7 - Prob. 7.23E
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
For each of the following situations, tell which type of loop (while, do-while, or for) would work best: a. Sum...
Absolute Java (6th Edition)
Run the hello, world program on your system. Experiment with leaving out parts of the program, to see what erro...
C Programming Language
Type in and run the program presented in this chapter. Check the programs results by comparing the original fil...
Programming in C
What does the Java compiler translate Java source code to?
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Explain one way to partition a database that has three tables: T1, T2, and T3.
Database Concepts (7th Edition)
Some network programming texts suggest the following approach for reading and writing sockets: Before interacti...
Computer Systems: A Programmer's Perspective (3rd Edition)
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
- Please code in C. Write a user defined function and a main function with the function call. Write a user-defined function ExpensiveFlights that takes at least 2 arguments, an array of doubles called fares, containing airline prices, and an int variable count that contains the number of elements in fares. The function should compute and return the average of the fares and also return (input/output parameter) the count of how many fares are greater than 800. Write the main function with the function call to ExpensiveFlights. Don’t declare pointer variables in the main function.arrow_forwardHomework ● Write a function C++ void switchEnds(int *array, int size); that is passed the address of the beginning of an array and the size of the array. The function swaps the values in the first and last entries of the array.arrow_forwardWrite a function that gets an array as a parameter (address and size) and a number and checks to see if that number exists in the array. The function should report every single occurrence of the number in the array. It should also report how many occurrences were detected in total (use c code)Suggested prototype: void findnReport(int* ar, int size, int num) Example of function output: If array = {2,5,3,5,12,13,14,15,0,5,-1,11,5} and num = 5, Number 5 found in array index 1 Number 5 found in array index 3 Number 5 found in array index 9 Number 5 found in array index 12 Total of 4 occurrences of number 5arrow_forward
- Is it correct to say that a function that accepts an array as a parameter has access to the original array or that it just has access to a copy of it?arrow_forwardWrite a function void switchEnds(int *array, int size);that is passed the address of the beginning of an array and the size of the array. The function swaps the values in the first and last entries of the array.arrow_forwardc++ hw In this hw, you're going to be working with partially filled arrays that are parallel with each other. That means that the row index in multiple arrays identifies different pieces of data for the same person. This is a simple payroll system that just calculates gross pay given a set of employees, hours worked for the week and hourly rate. code format: // TODO: Add function prototypes for all the declared functions // TODO: Declare two functions to compute the highestPay and lowestPay// HINT: Each should return the index of the correct value in the grossPay array. /* TODO: Create a function calledgetEmployeeNames Arguments : Name array(first and last name) Maximum size Return the number of names filled.*/ /* TODO: Create a function calledgetHourlyPay Arguments : NameArray(filled in Step 1) HourlyPayArray(starts empty) NumberOfNamesFilled(from Step1)*/ int main(){ // TODO: Declare an array of strings for the employeeNames able to hold a…arrow_forward
- In java there must be at least two calls to the function with different arguments and the output must clearly show the task being performed. Develop a function that accepts an array and returns true if the array contains any duplicate values or false if none of the values are repeated. Develop a function that returns true if the elements are in decreasing order and false otherwise. A “peak” is a value in an array that is preceded and followed by a strictly lower value. For example, in the array {2, 12, 9, 8, 5, 7, 3, 9} the values 12 and 7 are peaks. Develop a function that returns the number of peaks in an array of integers. Note that the first element does not have a preceding element and the last element is not followed by anything, so neither the first nor last elements can be peaks. Develop a function that finds the starting index of the longest subsequence of values that is strictly increasing. For example, given the array {12, 3, 7, 5, 9, 8, 1, 4, 6}, the function…arrow_forwardFunctions With Parameters and No Return Values Quiz by CodeChum Admin Create a program that accepts an integer N, and pass it to the function generatePattern. generatePattern() function which has the following description: Return type - void Parameter - integer n This function prints a right triangular pattern of letter 'T' based on the value of n. The top of the triangle starts with 1 and increments by one down on the next line until the integer n. For each row of in printing the right triangle, print "T" for n times. In the main function, call the generatePattern() function. Input 1. One line containing an integer Output Enter·N:·4 T TT TTT TTTTarrow_forwardWrite a function which accepts an int array and the number of elements in the array as two parameters. The function should dynamically create a new int array that is one element larger than the argument array. Element 0 of the new array should contain size, i.e. the number of elements in the argument array. Element 0 of the argument array should be copied to Element 1 of the new array, Element 2 of the argument array should be copied to Element 1 of the new array, etc. The function should return a pointer to the new array and should not modify the argument array. You may assume that the argument array contains at least one valid element and size is the number of elements in the array. You do not need to demonstrate calling this function. Example: if a[] is {2, 7, 4}, and size is 3, the function should return a pointer to a new array with 4 elements containing {3, 2, 7, 4}. int *counter(int a[], int size)arrow_forward
- Develop a function to create arrays of random integers. The caller sends the desired size of the array and the minimum and maximum values to generate for the array. The function returns the specified array. For example, with arguments of 10, 1 and 100, the function returns an array of 10 random integers from 1 to 100. With arguments of 5, -10 and 10, the function returns an array of 5 random integers between -10 and 10. Develop two functions: one to display arrays of integers and another to display arrays of Strings. In both functions, display the length of the array, then display the array index followed by the array value at that index. b. Given the String array {"red", "blue", "green", "orange"}Array has 4 elements[0]: red[1]: blue[2]: green[3]: orange 3. Develop a function that accepts an array of integers and returns their average. 4. Develop a function that accepts an array of integers and a threshold value from the user. The function returns how many values in the array are…arrow_forwardWrite a function in C++ language which takes two parameters as arguments, the first being an integer array and the second being the size of this integer array, and sorts this integer array in descending order. Write a similar function which takes the same arguments, but sorts the integer array in ascending order. Write a C++ program which takes integer values from user, inserts them into an integer array, uses these two functions to sort the array in ascending and descending order and prints the results on screen. You can take any size of the integer arrayarrow_forwardC++ Write a function that accepts an array and its size as arguments, creates a new array that is a copy of the argument array, and returns a pointer to the new array. Display the array in main(). The function will work as follows: Accept an array and its size as arguments. Dynamically allocate a new array that is the same size as the argument array. Copy the elements of the argument array to the new array. Return a new pointer to the new array. // This program uses a function to duplicate// an int array of any size.#include <iostream>using namespace std;// Function prototype_________________________________________________int main(){ // Define constants for the array sizes. const int SIZE1 = 5, SIZE2 = 7, SIZE3 = 10; // Define three arrays of different sizes. int array1[SIZE1] = { 100, 200, 300, 400, 500 }; int array2[SIZE2] = { 10, 20, 30, 40, 50, 60, 70 }; int array3[SIZE3] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; // Define three pointers for the duplicate arrays. int *dup1 =…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
1.1 Arrays in Data Structure | Declaration, Initialization, Memory representation; Author: Jenny's lectures CS/IT NET&JRF;https://www.youtube.com/watch?v=AT14lCXuMKI;License: Standard YouTube License, CC-BY
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License