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
Concept explainers
Question
Given the following attached main function:
Write the following functions based on the criteria listed. All functions written must match the calls made in the above main function.
- initialize sets the values of x and y to 0 and z to the blank character
- getHoursRate prompts the user to input the hours worked and the hourly rate to initialize the variables hours and rate
- payCheck calculates and returns the amount to be paid to an employee based on the hours worked and the hourly rate. For the first 40 hours, the employee makes the hourly rate stored in the rate, for hours over 40, the rate is 1.5 times the given rate.
- printCheck prints the hours worked, the pay rate, and the amount due the employee.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 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
- Warning ⚠️ Don't post AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forwardLocal variables are known only to the function in which they are declared. Local variables are invisible outside the function in which they are declared. Whether True or False 11. It is possible for any function to return numerous values. Any function type may return multiple values. That's true, right?arrow_forwardCan you use Python programming language to to this question? Thanksarrow_forward
- QUESTION 5 Which of the following statements is TRUE about function? O Every function must return a type and contain a list of parameters. O A function is activated through its function prototype. O Agroup of statements placed together to perform a task. O If a function is declared as an integer it will return a floating valuearrow_forwardDo 2nd question but don't try to copy other's work or don't use AI tool to generate answer. I'll reduce rating for sure.arrow_forwardWrite a program that calculates the balance of a checking account at the end of a three- month period. It should ask the user for the starting balance. Then a loop (for loop is recommended) should iterate once for every month in the period, performing the followi 1. Ask the user for the total amount deposited into the account during that month. Do n accept negative number. This deposit should be added to the current balance to make current balance is up to date. 2. Ask the user for the total amount withdrawn from the account during that month. Do accept negative amount or amount greater than the current balance. The withdrawal amount should be subtracted from current balance, so current balance is up to date. 3. Update the total deposit. 4. Update the total withdrawal After the last iteration, the program should display the following information: 1. starting balance at the beginning of the three-month 2. total deposits/withdrawals made during the three-month period 3. final balance…arrow_forward
- Define the following functions: find_base_area() has two parameters as a prism's base length and base width. The function returns the area of the prism's base. The area of the base is calculated by: find_vol() has three parameters as a prism's base length, base width, and height. The function returns the prism's volume, and uses the find_base_area() function to calculate the prism's base area. The volume is calculated by: Ex: If the input is: 4.0 2.0 3.0 then the output is: Prism base length: 4.0 Prism base width: 2.0 Prism height: 3.0 Base area: 8.0 Volume: 24.0arrow_forwardSelect the statements that apply to local variables. Only statements within subroutine can view or modify local variables. Storage used by local variables is released when subroutine ends. Local variable name cannot have the same name as a local variable in another function.arrow_forwardWhich statement of the following is the most appropriate? Group of answer choices One good method for specifying what a function is supposed to do is to provide a precondition and postcondition for the function. One good method for specifying what a function is supposed to do is to provide a precondition and postcondition for the function. These form a contract between the programmer who uses the function and the programmer who writes the function. Using the assert function to check preconditions can significantly reduce debugging time, and the assertion-checking can later be turned off if program speed is a consideration. One good method for specifying what a function is supposed to do is to provide a precondition and postcondition for the function. These form a contract between the programmer who uses the function and the programmer who writes the function. Using the assert function to check preconditions can significantly reduce debugging time, and the…arrow_forward
- please answer this question using python 3. Submit function: reads the five inputs, calls the functions listed below as needed, and displays tax. Inputs # of jobs: income : # of children: Is Married?: Is Student? : Outputs: tax functions Required 1. count_regular_exemptions() Calculates number of regular exemptions. Everyone starts with one exemption If no jobs, you get one more exemption If you have one job: You get one more exemption if you are married, or if you are a single student. If you have more than one job: You get one more exemption if your income is less than 1500. 2. count_child_exemptions() Calculates number of child credit exemptions. If your income is less than $70,000 : You get 4 times the number of children as the number of exemptions. Example: income 60,000 with 3 children: 4 * 3 = 12 exemptions If your income is at or above $70,000 : You get one additional exemption for every 2 kids. That is: 0 exemptions for 1 child, 1 for 2 children, 1 for 3, 2 for 4 and…arrow_forwardHere are three versions of a code fragment located inside a function: Version A for Row in range(10): for Column in range(5): DoSomethingInteresting(Row,Column) return Version B for Row in range(10): for Column in range(5): DoSomethingInteresting(Row,Column) return Version C for Row in range(10): for Column in range(5): DoSomethingInteresting(Row,Column) return How many times do each of the versions call the DoSomethingInteresting function? Write a sentence or two explaining which version is the "correct" versionarrow_forwardThe prompt asks: Write a function that calculates the amount of money a person would earn over a period of years if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of years and call the function which will return the total money earned in dollars and cents, not pennies. Assume there are 365 days in a year. function totalEarned(years) { } var yearsWorked = parseInt(prompt('How many years will you work for pennies a day? ')); alert('Over a total of ' + yearsWorked + ', you will have earned $' + totalEarned(yearsWorked));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