
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Question 5 and 7

Transcribed Image Text:Programming Challenges
947
4. Recursive Array Sum
Write a function that accepts two arguments,, an array of integers, and a number
indicating the number of elements in the array. The function should recursively
calculate the sum of all the numbers in the array. Demonstrate the use of the function
in a program that asks the user to enter an array of numbers and prints its sum.
5. Recursive Multiplication
Write a recursive function that accepts two arguments into the parameters x and y. The
function should return the value of x times y. Remember, multiplication can be
performed as repeated addition:
VideoNote
Solving the
Recursive
Multiplication
7 * 4 = 4 + 4 + 4 + 4 + 4 + 4 + 4
Problem
%3D
6. Recursive Member Test
Write a recursive Boolean function named isMember. The function should accept three
parameters: an array of integers, an integer indicating the number of elements in the array,
and an integer value to be searched for. The function should return true if the value is
found in the array or false if the value is not found. Demonstrate the use of the function
in a program that asks the user to enter an array of numbers and a value to be searched for.
7. String Reverser
Write a recursive function that accepts a string as its argument and prints the string in
reverse order. Demonstrate the function in a driver program.
8. Palindrome Testing
A palindrome is a string such as “madam", "radar", "dad", and “I", that reads the
same forwards and backwards. The empty string is regarded as a palindrome. Write a
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

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
- question 2 and 3 are not answered.!arrow_forwardLab 8-1: KimTay Pet Supplies Task 6: Create the GET_INVOICE_DATE procedure to obtain the customer ID, first and last names of the customer, and the invoice date for the invoice whose number currently is stored in I_INVOICE_NUM. Place these values in the variables I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE respectively. When the procedure is called it should output the contents of I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE. IN SQL CODE. CUSTOMER CUST_ID FIRST_NAME LAST_NAME ADDRESS CITY STATE POSTAL EMAIL BALANCE CREDIT_LIMIT REP_ID 125 Joey Smith 17 Fourth St Cody WY 82414 jsmith17@example.com 80.68 500.00 05 182 Billy Rufton 21 Simple Cir Garland WY 82435 billyruff@example.com 43.13 750.00 10 227 Sandra Pincher 53 Verde Ln Powell WY 82440 spinch2@example.com 156.38 500.00 15 294 Samantha Smith 14 Rock Ln Ralston WY 82440 ssmith5@example.com 58.60 500.00 10 314 Tom Rascal 1 Rascal Farm Rd Cody WY 82414 trascal3@example.com 17.25 250.00 15 375 Melanie Jackson 42…arrow_forwardThe Colombia City office of StayWell indicated that there is a new tenant by the name of Yigit Yilmaz staying at the property with an ID of 13. You need to include this new resident in the RESIDENTS table.arrow_forward
- For questions 4 and 5, use the following order for the rows in your truth tables.P QT TT FF TF FP Q RT T TT T FT F TT F FF T TF T FF F TF F F4. (8 marks) Construct truth tables for the following statement forms.In your truth table, make sure that you include a column for each intermediate expression that you evaluate on your way to your final answer.(a) (P ↔ ¬Q) ∧ (P ↔ Q)(b) (¬P ∨ (¬Q ∨ ¬R)) ∨ (P ∧ Q)arrow_forwardBelow are some rows of the PROVIDERS table for a factory: PCODE 10192 98411 0489035 NAME Hans, Inc. Tools and More Motors Inc. PHONE 231 - 3092 231-1029 993 - 1821 All providers from the factory zone of the city start with 231. You want to get the providers that are in the factory zone of the city. Which of the following is more appropriate? O a. O b. SELECT * FROM PROVIDERS WHERE PHONE LIKE '% 231' O C. O d. SELECT * FROM PROVIDERS WHERE PHONE LIKE $231%' SELECT * FROM PROVIDERS WHERE PHONE LIKE 231 SELECT * FROM PROVIDERS WHERE PHONE LIKE '%231%'arrow_forwardUsing the Winners table from Figure 12-2, write a parameter query that selects only an actor’s Picture field.arrow_forward
- List the names of all Staff members who hold a faculty position and have a salary of $45,000 or less. Show their names as their first name, followed by a space, and then their last name but sort the list alphabetically by last name and then first name. Hint: Check out the Position column in the Staff table. All staff members who do not hold a faculty position will get a bonus this year equal to 5% of their salary. List the names, current salary, and bonus amount for each Staff member (non-faculty) who is due a bonus. Show your list in order with the person receiving the highest bonus first.arrow_forward12 of 40 Which statement is CORRECT about the results produced by the following SQL queries Q1 and Q2 over relation S(x,y,z)?. Q1: SELECT * FROM S WHERE x LIKE '%NULL%; Q2: SELECT * FROM S WHERE x LIKE %NULL' OR x LIKE 'NULL%'; Select one: O The result produced Q1 is always contained in the result produced by Q2. O Q1 and Q2 produce the same results. O Q1 and Q2 produce different results, in general. The result produced Q2 is always contained in the result produced by Q1.arrow_forwardStudents: Johnson, Williams, Matt, Jones, Eric, Lili, John and Jason, whose grades are listed below. Each column is the grades each student received. There are 8 students with 10 grades each. Johnson: 79, 92, 85, 0, 100, 64, 72, 99, 90, 86 Williams: 80, 75 93, 94, 0, 90, 89, 88, 87, 86 Matt: 82, 67, 72, 74, 89, 0, 70, 89, 100, 76 Jones: 85, 84, 82.5, 82, 84, 80, 80.5, 90, 96, 85 Eric: 90, 91, 87, 85.5, 86.5, 0, 90, 90, 91, 92 Lili: 60, 75, 81, 70, 80, 81, 94, 67.5, 99, 98 John: 79,0, 74, 96, 88.5, 88, 0, 100, 86, 83 Jason: 89, 90, 90, 85, 85, 90, 91, 88, 100, 79 Write user-defined functions or build-in functions (e.g., sum, mean, max, min, etc.) to calculate: The Average Grade of each student; this average should be a vector. The average of the class; this average is a scalar vector. The highest grade among the Average Grade of Each Student The lowest grade among the Average Grade of Each Student Show a table with each student's name, average grade and letter score using A, B, C, D, F…arrow_forward
- 4. In the OrderItems table, display a count of the number of products, grouped by prod_id, but only for those groups having 3 or more of a given prod_id. Display the count with the alias shown. Sort by prod_id in ascending order. BNBG01 BNBG02 BNBG03 BR03 4 rows returned in 0.00 seconds PROD_ID Download 3 3 3 4 NUM_PROD_IDarrow_forwardFor questions 10, 11, 12, in the options, there are no options in which c1=2 for ech of the questions, can you tell me correct options for 10 11 and 12?arrow_forwardSolve this (SQL)arrow_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