Search Function for Customer Accounts Program
Add a function to
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
Mylab Programming With Pearson Etext -- Access Card -- For Starting Out With C++: From Control Structures Through Objects, Brief Version
Additional Engineering Textbook Solutions
Absolute Java (6th Edition)
Digital Fundamentals (11th Edition)
Modern Database Management
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Modern Database Management (12th Edition)
Computer Science: An Overview (12th Edition)
- (CP6) Write a function that is passed an array of structs and performs calculations. The function should locate the highest gpa from a group of students. The function is passed the array of structs, the first element to be searched, and the last element to be searched. The return value of the function is the highest gpa in the search range. struct data{ string name; double gpa;}; double highestGpa( data [ ], int, int ); data [ ] - array of structs to search int - first element to be searched int - last element to be searched return - highest gpa from grouparrow_forwardDeclare a student structure that contains : Student's first and last nameStudent IDCreate the following functions: getStudentInfo(void) Declares a single student, uses printf()/scanf() to get inputReturns the single student backprintStudentInfo(student_t *st_ptr) Takes the pointer to a student (to avoid making a copy)Prints out all of the student informationDeclare an array of five studentsUsing a for loop and getStudentInfo() function, get input of all the studentsUsing a for loop and printStudentInfo() function, print all the output of all students.arrow_forward(a)(i) Create a City structure that will have the following members: name (string type), population (int type), and averageTemperature (float type). (ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will pass this array and # of cities as arguments to the functions. (b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and the size of the array as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference? (c) Create a function “findCityWithHighestTemperature” that takes a City structure array and the size of the array as parameters. It finds and displays the city’s information that has the highest temperature. (d) Create a function “displayAllCitiesInfo” that takes a City structure array and the size of the array as parameters. It displays those Cities’ information whose temperatures…arrow_forward
- a)(i) Create a City structure that will have the following members: name (string type), population (int type), and averageTemperature (float type). (ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will pass this array and # of cities as arguments to the functions. (b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and the size of the array as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference? (c) Create a function “findCityWithHighestTemperature” that takes a City structure array and the size of the array as parameters. It finds and displays the city’s information that has the highest temperature. (d) Create a function “displayAllCitiesInfo” that takes a City structure array and the size of the array as parameters. It displays those Cities’ information whose temperatures are…arrow_forward(a)(i) Create an Employee structure that will have the following members: name (string type), phoneNo (string type), and a salary (float type). (ii) In the main function, create an array of size N of Employee structure type. This array will be used by all the functions. You will pass this array and # of employees as arguments to the functions. (b) Create a function “takeEmployeesInfoFromKeyboard” that takes an Employee structure array and the size of the array as parameters. It takes information of all the Employees from keyboard and stores in the Employee structure array. Do you know that arrays are passed by reference? (c) Create a function “searchAnEmployee” that takes an Employee structure array, a phone number, and the size of the array as parameters. It finds and displays the employee’s information from the array searching by the phone number. (d) Create a function “displayAllEmployeesInfoReverse” that takes an Employee structure array and the size of the array as parameters. It…arrow_forwardC code Blocks Write the complete function that receives a pointer to the array's first element as an argument and multiplies the third element of the array by 10. Define your function in the same way as the given function prototype. Take a look at the "For example" below to see how the function is used in the main function and the expected result. #include <stdio.h>#include <stdlib.h>void multiplyElement(int *ptr);int main(){ int array[5] = {1,2,3,4,5}; int *arrPtr = NULL; arrPtr = &array[0]; multiplyElement(arrPtr); for(int i = 0; i < 5; i++){ printf("%d ", array[i]); }return 0;}//Your answer starts here For example: Test Result int array[5] = {1,2,3,4,5}; int *arrPtr = NULL; arrPtr = &array[0]; multiplyElement(arrPtr); for(int i = 0; i < 5; i++){ printf("%d ", array[i]); } 1 2 30 4arrow_forward
- Task 3: Statistics using arrays: by java programming With the spread of COVID 19, the HR department in a company has decided to conduct some statistics among the employees in order to determine the number of infections according to some conditions. For each employee, they have to record the code, name, age, whether he/she was infected or no and the remaining days of leaves for him/her. You are requested to write the program that maintains the lists of details for the employees as mentioned above using the concept of arrays. The program repeats the display of a menu of services until the user decides to exit. 1. Start by initializing the employee details by reading them from the keyboard. 2. Repeat the display of a menu of 4 services, perform the required task according to the user’s choice and asks the user whether he/she wants to repeat or no. You need to choose one service from each category (‘A’,’B’,’C’,’D’) a. A. Display the total number of employees that were infected b. B.…arrow_forward(Card Shuffling and Dealing) Create a program to shuffle and deal a deck of cards. Theprogram should consist of class Card, class DeckOfCards and a driver program. Class Card shouldprovide:a) Data members face and suit of type int.b) A constructor that receives two ints representing the face and suit and uses them to initialize the data members.c) Two static arrays of strings representing the faces and suits.d) A toString function that returns the Card as a string in the form “face of suit.” Youcan use the + operator to concatenate strings.Class DeckOfCards should contain:a) An array of Cards named deck to store the Cards.b) An integer currentCard representing the next card to deal.c) A default constructor that initializes the Cards in the deck.d) A shuffle function that shuffles the Cards in the deck. The shuffle algorithm shoulditerate through the array of Cards. For each Card, randomly select another Card in thedeck and swap the two Cards.e) A dealCard function that returns the next…arrow_forward1. Display Function Implement a function to display the contents of the patient_list array. Add code to call this function. Note that there are multiple places where this function needs to be called. Look for the // TODO comments to find the correct locations. 2. Sorting the array by Age Implement the code to sort the contents of the patient_list array based on the value stored in the age field. To do this you will need to implement code that relies on the qsort function from the C Standard library A function that compares two patient elements, based on the value stored in the age field. A call to the qsort function, which includes the array to be sorted, the number of elements in the array, the size of each array element and the function used to compare the array elements. Add code to call the qsort function, using the age comparison function that you implemented. This code should be placed just under the appropriate // TODO comment in main(). Sorting the array by…arrow_forward
- Create a structure representing a student object with the following members regno. courseid unitsRegistered: This should be an array of the course units you registered to capture marks unitsmarks: This should be an array to store the marks for the units registered. Find a way to relate the two. firstname surname address By using the structure above, write a program that populates the details of a student and compute the average, and the grade as well as the total marks. This task should be accomplished by writing functions for getData() - to populate the structure, printStudent() - to display the detail of the student, computeGrade() - to compute the grade of the student and computeMean() that computes the mean of the students: Pass the appropriate data NB: The function getData() - is a subroutine and uses structure as a reference - input, same concept to printData() Consider that your class has 10 students. Compute the class mean and standard deviation, highest class mark and lowest…arrow_forwardA structure called citizen is defined. Declare an array of type citizen of size 41.arrow_forwardFinal review ch6-7 C language Using arrays create a personal phone directory that contains room for first names and phone numbers for 20 people. Using the "names.txt" retrieve the first name and phone number for each person and store in arrays (parallel). Prompt the user for a name, search for the name, and if name is found in the array, display the corresponding phone number. If the name is not found, prompt the user to enter a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit or until arrays are full. After the arrays are full (containing 20 names), do not allow the user to add new entries. Print the full list. "names.txt" Denton (123)-456-7890 Francis (123)-456-7891 Lucy (123)-456-7892 Brooklyn (123)-456-7899 Mattie (123)-456-7898 Clarissa (123)-456-7897 Bailey (123)-456-7896 Lesley (123)-456-7895 Tristan (123)-456-7894 Bethany (123)-456-7893arrow_forward
- 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 Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT