Problem Solving with C++, Student Value Edition Plus MyLab Programming with Pearson eText - Access Card Package (10th Edition)
10th Edition
ISBN: 9780134756424
Author: Walter Savitch
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 9.2, Problem 10STE
Suppose your
int *entry; entry = new int[10]; |
so that the pointer variable entry is pointing to this dynamic array. Write code to fill this array with ten numbers typed in at the keyboard.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a C# or a python program that creates an integer array of size 10 and fills the array with values
set by the programmer (not entered by the user). Then, the program will remove all the
prime numbers from the original array and store them in a new array. Note that after
the program finishes execution, the original array should not contain any prime number.
Hi, i need help with this program in C++
Write a program that asks the user to enter the size of an array. Declare a dynamic array of type int of the size entered by the user. Initialize the array so that the elements in the first half have values equal to the square of the index, and the elements in the second half have values equal to three times the index. Print out the array with 15 values per line.
I need this program in java please.
#Given Arrayarray=[1,1,1,2,2,2,2,2,4,5,5,6,6,6]
#Insert valuevalue=3
index=0for x in array: if value<x: #inserting to the array in the position index array.insert(index,value) print ("Output :",array) break #Incrementing position by 1 index=index+1
Chapter 9 Solutions
Problem Solving with C++, Student Value Edition Plus MyLab Programming with Pearson eText - Access Card Package (10th Edition)
Ch. 9.1 - Prob. 1STECh. 9.1 - Prob. 2STECh. 9.1 - Give at least two uses of the operator. State...Ch. 9.1 - Prob. 4STECh. 9.1 - Prob. 5STECh. 9.1 - Suppose a dynamic variable were created as...Ch. 9.1 - Write a definition for a type called NumberPtr...Ch. 9.1 - Prob. 8STECh. 9.2 - Write a type definition for pointer variables that...Ch. 9.2 - Suppose your program contains code to create a...
Ch. 9.2 - Prob. 11STECh. 9.2 - Prob. 12STECh. 9.2 - What is the output of the following code fragment?...Ch. 9.2 - What is the output of the following code fragment?...Ch. 9.2 - What is the output of the following code fragment?...Ch. 9 - Prob. 1PCh. 9 - Write a program that asks the user to input an...Ch. 9 - Palindrome testing with pointers This Practice...Ch. 9 - Do Programming Project 3 in Chapter 7 in this...Ch. 9 - Do Programming Project 11 in Chapter 7 using a...Ch. 9 - Write a function that takes a C string as an input...Ch. 9 - Prob. 5PPCh. 9 - One problem with dynamic arrays is that once the...Ch. 9 - Prob. 7PPCh. 9 - Write a program that outputs a histogram of...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Area Class Write a class that has three overloaded static methods for calculating the areas of the following ge...
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Will the program work if n1 and n2 are replaced by n1 / 2 and n2 / 2 in line 17 in Listing 5.9?
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Write code that opens an output file with the filename number_list. txt, but does not erase the file's contents...
Starting Out with Python (3rd Edition)
What Ada construct provides support for abstract data types?
Concepts Of Programming Languages
Private Sub Handles btnOutput.Click
End Sub
Introduction To Programming Using Visual Basic (11th Edition)
Indentify and correct the errors in each of the following. [Note: There may be more than one error in each piec...
C How to Program (8th 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
- Write a program in java or c# that creates an integer array of size 10 and fills the array with valuesset by the programmer (not entered by the user). Then, the program will remove all theprime numbers from the original array and store them in a new array. Note that afterthe program finishes execution, the original array should not contain any prime number.arrow_forwardthis is insturction Write a program which prompts the user to enter up to 15 floating point numbers (terminated with a non-numeric), reads them into an array, then prints the following. The program must use an array (not a vector) to get credit. The array values in the original order, separated by commas, with no trailing comma at the last value. The array values where the order of each adjacent pair of elements is swapped, separated by commas (NOT every element swapped with its next neighbor, which would just move the first element to the end, but every original pair swapped only in that pair. For an odd element count, the last element should not change. See examples below.) The smallest number in the array. Example program outputs with user input shown in bold font: Enter up to 15 numbers, and a non-numeric to quit: 1 0 -1.001 # Original array: 1, 0, -1.001 The swapped array: 0, 1, -1.001 Smallest number: -1.001 Enter up to 15 numbers, and a non-numeric to quit: 1 0 -1.001 5 ,…arrow_forwardWrite a program that dynamically allocates an array large enough to hold a user defined number of test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the sorted list of scores and averages with appropriate headings. Use pointer notation rather than array notation whenever possible. Input Validation: Do not accept negative numbers for test scores.arrow_forward
- Write a program that dynamically allocates an array large enough to hold a user defined number of test scores. Once all the scores are entered, the array should be passed to a function that sorts them in descending order and display the sorted list. Another function should be called that calculates the average score and display in the same function. Use appropriate headings for function and pointer notation rather than array notation whenever possible. Input Validation: Do not accept negative numbers for test scorearrow_forwardWrite a program that creates an integer array of size 10 and fills the array with valuesset by the programmer (not entered by the user). Then, the program will remove all theprime numbers from the original array and store them in a new array. Note that afterthe program finishes execution, the original array should not contain any prime number.arrow_forwardWrite a function numberOfOccurences() which takes an integer reference array of size 10 and a search value as parameters and returns the number of occurrences of the value inside the array. Test your function. Initialize an array that contains the following numbers: 4, 7, 2, 8, 8, 1, 4, 8, 9, 1. Then test it with search values 1, 8 and 6. Your program output should look like the following: [4 7 2 8 8 1 4 8 9 1 ]1 occurs 2 times in the array.8 occurs 3 times in the array.6 occurs 0 times in the array. C++ Nothing too advanced pleasearrow_forward
- Write a program which allow user to enter a number that represents repetition. Then, the userwill need to enter any random decimal number based on the number of repetition. The numbersshould be stored in a single dimensional array. Lastly, the program will display the averageof these numbers and count how many numbers that above the average.arrow_forwardWrite a python or C# program that creates an integer array of size 10 and fills the array with positive numbers set by the programmer (not entered by the user). The range of values in the array should be between 1 and 100. Then, the program will remove the duplicate values found in the array (i.e. each value should be found only once in the array). After removing the duplicate values, the size of the new array should be equal to the number of unique values found in the original array.arrow_forwardYou do not need getopt for this program as there are no arguments. Call the executable memact. Create pointers for a character, a string, an integer, a floating point number and for an array of 10 integers. For each pointer (5 of them), dynamically allocate the memory and then assign values as follows. You can use malloc and or calloc. Use your last name for the string (array of characters). Use 25 for the integer. The character should be an ‘E’. The floating point number should be 32.76 The array of integers should be the numerals 0 through 9. Print out values for all five dynamically allocated variables. Free all dynamically allocated memory. Output should look something like: Character: EInteger: 25String: DoeFloating Point: 32.76Array of Integers: 0 1 2 3 4 5 6 7 8 9arrow_forward
- Write a program that accepts two integer values, called "arraySize" and "multiplier", as user input. Create an array of integers with arraySize elements. Set each array element to the value i*multiplier, where i is the element's index. Next create two functions, called PrintForward() and PrintBackward(), that each accept two parameters: (a) the array to print, (b) the size of the array. The PrintForward() function should print each integer in the array, beginning with index 0. The PrintBackward() function should print the array in reverse order, beginning with the last element in the array and concluding with the element at index 0. As output, print the array once forward and once backward.arrow_forwardWrite a program that asks the user to input a series of numbers. Theprogram should read the numbers into an array and then does the following:a) Write a function that will find the average value in the array.b) Write a function that will find the mode value in the array.c) Write a function that will display the sorted array of numbers from maximum tominimum.d) Write a function that will search the array for a specific value.e) Write a function that will display all of this information to the user in a nice format.You should submit the flowchart and the python code for this assignmentarrow_forwardWrite a C++ program that asks the user to enter values in a 1d array. The size of the array should be provided by the user. You have to compute the array by using functions through displaying the menu from the user. 1 . use pointer notation to access the array element . 2. Non-zero values, Number of occurrence in array and indexes 3. The square root of all the values 4. Prime numbers among all 5. Smallest numbers (from given value till 0 for every individual value ) 6. Positive Numbersarrow_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
9.1: What is an Array? - Processing Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=NptnmWvkbTw;License: Standard Youtube License