C++ How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (10th Edition)
10th Edition
ISBN: 9780134583006
Author: Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Array Processing.
In this problem, you have two tasks:
To create the header file, arrayOptn.h, and add the function declarations of the following functions listed below.
To create the file, arrayOptn.c, which implements the functions in the arrayOptn.h
You are already provided with the main() function. Do not edit anything there in the main.c file.
5 - void printElementsInAscending(int arr[], int count)
Parameters:
int arr[] - a reference to the array to be processed
int count - the number of elements in the array
Description:
Prints all the elements of the passed array in ascending order
The format of the message is: "Elements: el1 el2 el3 elx" where e1, el2, el3, elx are the current elements of the array.
6 - void printElementsInDescending(int arr[], int count)
Paramters:
int arr[] - a reference to the array to be processed
int count - the number of elements in the array
Description:
Prints all the elements of the passed array in descending order
The format of…
Array Processing.
In this problem, you have two tasks:
To create the header file, arrayOptn.h, and add the function declarations of the following functions listed below.
To create the file, arrayOptn.c, which implements the functions in the arrayOptn.h
You are already provided with the main() function. Do not edit anything there in the main.c file.
7 - int insertAtPos(int arr[], int *count, int elem, int k)
Parameters:
int arr[] - a reference to the array where we insert the element
int *count - a pointer to the current number of elements in the array
int elem - the element to be inserted
int k - the index position where the element will be inserted
Description:
Inserts the element at the kth index of the array and moves all the elements to the right starting at the kth position. For example, if k is 3, the current element at index 3 will be moved to index 4, the current element at index 4 will be moved to index 5, the current element at index 5 will be moved to index 6, and…
c++
ABC Central Library has hundreds of books which needs to be managed. Librarians who areexperts at finding and organizing books suggest building an online system in which there will bea Menu for a Library. Now, Students are advised to create a struct having attributes bookNumber, title, authorand its availability in the form of true or false.Following functions must be defined.(i) Write a function that will store the following information in an array of struct and testit via a test case.
Book 1 Book 2 Book 3bookNumber 1 2 3Title English Science MathsAuthor Mr. Ali Ms. Amna Mr. BilalAvailable 0 1 1
(ii) Write a function that will return the count of books which are available.
Chapter 16 Solutions
C++ How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (10th Edition)
Ch. 16 - Exercises 16.4 State whether each of the following...Ch. 16 - Fill in the blanks in each of the following...Ch. 16 - Prob. 16.6ECh. 16 - Prob. 16.7ECh. 16 - (Duplicate Elimination) Read 20 integers into an...Ch. 16 - (Duplicate Elimination) Modify Exercise 16.8 to...Ch. 16 - Prob. 16.10ECh. 16 - (Merging Ordered Lists) Write a program that uses...Ch. 16 - Prob. 16.12ECh. 16 - Prob. 16.13E
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
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.arrow_forward(Data processing) The answers to a true-false test are as follows: T T F F T. Given a twodimensional answer array, in which each row corresponds to the answers provided on one test, write a function that accepts the two-dimensional array and number of tests as parameters and returns a one-dimensional array containing the grades for each test. (Each question is worth 5 points, so the maximum possible grade is 25.) Test your function with the following data:arrow_forward3. Pointers – Arrays: initializing content • Using the pointer ptrArray, you now want to write values in those integers. Use a loop to go through each element in that array, and initialize them all to 42. This is done in the main. 4. Pointers – Arrays: printing • Write a function that will print the elements in the array-pointer. The function should accept a pointer to an integer, and the size of this array. The function should not return anything. Here is your function prototype: void printArray(int* ptr, int nb); • Your function needs to use a loop to go through all the elements in the array, and simply prints them on a new line. • In the main function, call this function with your pointer ptrArray and the size given by the user.arrow_forward
- C++ For this week’s assignment, you’ll be making a function that can multiply not only two matrices, but also a single matrix and a scalar. To build a matrix in C++, you’ll need to familiarize yourself with multi-dimensional arrays. These are the same as regular arrays, but when you initially define them, instead of saying:Int dataArray[10];You’d say:Int dataArray[10][10];This will create an array of 100 objects, that you can think of in a 10 x 10 grid. It should be noted that it’s actually the same as saying ‘int dataArray[100]’, and can be used in the same way.You can also initialize two-dimensional arrays like this:Int matrix[2][3] = {{ 0, 1, 2} ,{3, 4, 5}};Or like this:Int matrix[2][3] = {0,1,2,3,4,5};One of them’s just slightly easier to recognize as a two dimensional array than the other. Now while THIS project is only dealing with 2x2 matrices, it will be to your benefit if you plan your program to be able to handle matrices of any size...Your function will need to correctly…arrow_forwardAHPA #10: The Secure Array * * Using pointers, access Peter's array without him knowing it * and place three values that you got from the user (101, 63, * 21) at locations 3, 6, and 9. Recalculate the sum value and * update it. ( the output should be same as the picture)arrow_forwardThis lab will exercise your understanding of some of the concepts covered in Chapter 12:dynamic data, arrays, pointer addresses 1. Create a structure called students. The structure should contain:firstname, lastname, gpa. 2. Create a pointer to the student structure and dynamically create an array of thestudent structure, enough for 4 students.Hint: Store the address of the beginning of the array 3. Create a file that contains four rows of data with last name, first name and gpa valueor use the inFile.txt file attached. 4. Using pointer notation only (not array notation []), read the data from the file andstore the data into the structure.After all the data is read and stored, using pointer notation only, output to the console (cout)each student's first name, last name and gpa. Use information messages and ensure the datais displayed properly. 5. Before exiting, delete the dynamically allocated structure array.Complete as much as you can before you leave ensuring what you've completed…arrow_forward
- C++ Double Pointer: Can you draw picture of what this means : Food **table? struct Food { int expiration_date; string brand; } Food **table; What is this double pointer saying? I know its a 2D matrix but I don't understand what I'm dealing with here. Does the statement mean that we have an array of pointers of type Food and what is the other * mean? I'm confused.arrow_forwardCould this be done in C++ please? 1. The class should have a two dimensional array of the char or int type as a private variable. The class could have some other private variables as needed. A public constructor must should be used to initialize private variables. Remember that you need two loops to access all rows and columns to initialize each array element. There must be other public functions to do tasks, such as XPlay, OPlay, DetermineAWinner, and others as needed. 2. The main should have a loop to repeat tasks until there is a winner or a tie.arrow_forward23.8 LAB: Consecutive heads (Use Python) Given main() and GVCoin class, complete function consecutive_heads() that counts and returns the number of flips taken to achieve a desired number of consecutive heads without a tails. Function consecutive_heads() has a GVCoin object and an integer representing the desired number of consecutive heads without a tails as parameters. Note: For testing purposes, a GVCoin object is created in the main() function using a pseudo-random number generator with a fixed seed value. The program uses a seed value of 15 during development, but when submitted, a different seed value will be used for each test case. Refer to the textbook section on random numbers to learn more about pseudo-random numbers. Ex: If the GVCoin object is created with a seed value of 15 and the desired number of consecutive heads is 5, then the function consecutive_heads() returns 16 and the program outputs: Total number of flips for 5 consecutive heads: 16arrow_forward
- 3."""Code _Write a function validSolution/ValidateSolution/valid_solution()that accepts a 2D array representing a Sudoku board, and returns trueif it is a valid solution, or false otherwise. The cells of the sudokuboard may also contain 0's, which will represent empty cells.Boards containing one or more zeroes are considered to be invalid solutions.The board is always 9 cells by 9 cells, and every cell only contains integersfrom 0 to 9. (More info at: http://en.wikipedia.org/wiki/Sudoku)""" # Using dict/hash-tablefrom collections import defaultdict def valid_solution_hashtable(board): for i in range(len(board)): dict_row = defaultdict(int) dict_col = defaultdict(int) for j in range(len(board[0])): value_row = board[i][j] value_col = board[j][i] if not value_row or value_col == 0: return False if value_row in dict_row: return False else: dict_row[value_row] += 1.arrow_forwardA1: File Handling with struct C++ This program is to read a given file and display the information about employees according to the type of employee. Specifically, the requirements are as follows. Read the given file of the information of employees. Store the information in an array or arrays. Display all the salaried employees first and then the hourly employees Prompt the user to enter an SSN and find the corresponding employee and display the information of that employee. NOTE : S- salaryemployee , H- Hourly employee S 135-25-1234 Smith Sophia DevOps Developer 70000H 135-67-5462 Johnaon Jacob SecOps Pentester 30 60.50S 252-34-6728 William Emma DevOps DBExpert 100000S 237-12-1289 Miller Mason DevOps CloudArchitect 80000S 581-23-4536 Jones Jayden SecOps Pentester 250000S 501-56-9724 Rogers Mia DevOps Auditor 90000H 408-67-8234 Cook Chloe DevOps QAEngineer 40 45.10S 516-34-6524 Morris Daniel DevOps ProductOwner 300000H 526-47-2435 Smith Natalie DevOps…arrow_forwardWrite a void function that reads a file “a:data.txt” with up to 35 student ids, names and final marks into 3 arrays. When the student name is "quit" stop processing or if 35 array elements have been read then stop processing . The function should return the length of the actual number of students as well as the 3 arrays. In main, show all declarations and show the actual call. You can use the following prototype and data file: (note that in this case length would be 4) const int SIZE = 35; void ReadData( string name[],int id[], int mark[], int& length); data.txt Bob 123456 89 Suki 234567 77 Felix 345678 55 Julie 456789 67 quit in c++ please use basic coding I'm not advancedarrow_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 LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher: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
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
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