C++ PROGRAMMING:FROM...(LL) >CUSTOM<
8th Edition
ISBN: 9780357019528
Author: Malik
Publisher: CENGAGE C
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 16, Problem 6PE
Program Plan Intro
1. Variables mentioned below are used
- list[] − array that holds all the elements.
- newArr[]- array that holds the output.
- size − size of the input array.
- removeItem − key element that is to be removed inside the array.
- loc − position of key element inside array.
2. Functions mentioned below are used
- main()- main function in the program that reads the input and prints the output.
- sort ()- function that performs the bubble sorting of array elements.
- remove()- function that removes the first occurrence of the element.
- removeAt()- function that removes the element at the specified index.
- removeAll()- function that removes all occurrences of the element.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Assignment
Write a program that reads a 2D array of chars, checks, and corrects each char within this array, and
print out the corrected 2D array. First the program will read the row count (rowCount) and column
count (columnCount) of the 2D array, both as int values. Then, the chars constituting the 2D array
will be read on a row-by-row basis.
After reading the 2D array, the program will check and correct each char within the 2D array
according to the rules below. This process MUST be done by using a void function by sending the
appropriate cell of the 2D array with a call-by-reference fashion.
• If the row index is an even number, a char can only be a lowercase English value.
• If the row index is an odd number, a char can only be ?, 7', or X'.
• Any incorrect value MUST be changed into
Finally, the checked and corrected 2D array will be printed out to the screen.
NOTE: Checking the correctness of a char and correcting it (if necessary) MUST be done in the
function with a…
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.…
Q1
Chapter 16 Solutions
C++ PROGRAMMING:FROM...(LL) >CUSTOM<
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
- (Numerical) Given a one-dimensional array of integer numbers, write and test a function that displays the array elements in reverse order.arrow_forwardGive solution in characters. Character must be 7 to 8.arrow_forward2/ Repeat question 2 by passing 2-D array to a function called column_sum.arrow_forward
- When the values of an array are stored in ascending order, they are stored from greatest to least.arrow_forwardIf the values in an array are stored in ascending order, the values in the array are stored from highest to lowest.arrow_forwardf an array is sorted in this order, the values are stored from highest to lowest.a. asymptoticb. logarithmicc. ascendingd. descendingarrow_forward
- The Problem: Matching Group Schedules The group schedule matching takes two or more arrays as input. The arrays represent slots that are already booked and the login/logout time of group members. It outputs an array containing intervals of time when all members are available for a meeting for a minimum duration expected. Sample Input Enter person1_Schedule =[[ ‘7:00’, ’8:30’], [’12:00’, ’13:00’], [’16:00’, ’18:00’]] person1_DailyAct = [‘9:00’, ’19:00’] Enter person2_Schedule = [[ ‘9:00’, ’10:30’], [’12:20’, ’13:30’], [’14:00’, ’15:00’], [’16:00’, ’17:00’ ]] person2_DailyAct = [‘9:00’, ’18: 30’] Enter duration_of_meeting =30 Sample output [[’10:30’, ’12:00’], [’15:00’, ’16:00’], [’18:00’, ’18:30’]] Implementation Have following files Project1_starter.py or project1_starter.cpp that defines functions for the algorithm described above. You will need to develop and write the functions. Describe how to run your program in the ReadMe file Input.txt containing the sample input…arrow_forwardAIM: Write a program to do Linear Search using a given Search Key in an un- sorted Linear Array 'A' which has N values in it. Description: The linear search compares each element of the array with the search key until the search key is found. To determine that a value is not in the array, the program must compare the search key to every element in the array 'A'. It is also called "Sequential Search" because it traverses the data sequentially to locate the element. Algorithm: (Linear Search) LINEAR SEARCH (A, N, SKEY) Here A is a Linear Array with N elements and SKEY is a given item of information to search. This algorithm finds the location of SKEY in A and if successful, it returns its location otherwise it returns -1 for unsuccessful. 1. Repeat step-2 for K = 0 to N-1 2. if(A [K] = SKEY) return K [Successful Search] [End of loop of step-1 ] 3. return -1 [Un-Successful] 4. End.arrow_forwardUsing C language, create a program that requests the full name of the teacher, in an array acquires N names with N grades, which are ordered alphabetically by last name and display the data of each person when writing the number of the listarrow_forward
- Using C languagearrow_forwardChoices same for eacharrow_forwardMatch each data operator with its function: OFFSET Returns the number of the elements in an array. TYPE Returns the size of a variables byte. SIZEOF Returns the memory adress of a variable. LENGTHOF Returns number of bytes used in an array.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning