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
Write a function called ConvertToFootInchMeasure (signature below) that takes a parameter for the total inch measure. The function should return the converted measure as a formatted string (with the " and ' as appropriate).
Use the following header:
string ConvertToFootInchMeasure (int totalInches)
/* Pre: totalInches the total number of inches
Post: The converted, formatted measure is returned */
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 4 steps with 2 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
- Create a function called getHex() as follows: • This function should return a value of type char and have a parameter of type int. • The function should use either an iflelse or a switch to return the corresponding hex value of the number as a char value. o If the number is between 0 and 9, add '0' to the parameter. o If the number is between 10 and 15, a local char variable should be set equal to the correct letter ('A', 'B', 'C', 'D', 'E', or 'F').arrow_forward1. Explain role of a project manager and project manager attributes in project management. 2. Discuss the challenges faced by a project manager during all stages of a project’s lifecycle. 3. Illustrate how a project manager could use control mechanisms to control processes within a project’s lifecycle.arrow_forwardPython question, please us a docstring and have comments throughout code Write a function getInteger() that takes two integers num1 and num2 as parameters. If num1 > num2, then the function prints an error message and returns 0. If num1 is equal to num2, the function returns the common value. For cases where num1 < num2, the function prompts the user to enter an integer greater than or equal to num1 and less than or equal to num2 and returns the first valid integer that the user enters. If the user enters something that is not an integer value, the programs should display an error message and re-prompt the user to enter a valid integer Below are some sample executions of the function. Use the while and if-elif statements and a try/except in the solution. Don’t forget to include the docstring and comments. Copy and paste or screen shot the code and the thirteen test cases shown below in your submission. . >>> getInteger(5,4) 5 and 4 are not valid parameters 0…arrow_forward
- Examples Input 8 Output How about visiting Gibraltar Rock? It is about 8 miles away. Input 30 Output How about visiting Oxnard? It is about 30 miles away. Input 120 Output You provided an invalid distance that is not between 0 and 100 miles. Input -100 Output You provided an invalid distance that is not between 0 and 100 miles. Hints • you can check the type of an input parameter by using the type () function.arrow_forwardIn this coding challenge, you will be retrieving email usernames from a string. You will write a function named get_usernames () that takes in a string as it's input parameter, and returns a list of email usernames in the string. The input strings will contain 0 or more emails in the format and the '@' symbol will only appear in the context of an email. The order of usernames should match the order in the input text. username@domainname, For example: EXAMPLE 1 text: "If you need help on an assignment, email help@ucsd.edu or support@gmail.com" return: ['help', 'support'] EXAMPLE 2 text: "Good morning! I hope you're having a great time with CSE 8A!" return: [] EXAMPLE 3 text: "I've been having a lot of trouble reaching you, can you please email me at cse@ucsd.edu? return: ['cse', 'cse'] Here is the problem description: Function Name: get_usernames Parameter: text - A string corresponding to a piece of text containing 0 or more emails. Return: A list of the email usernames in the input…arrow_forwardAdd a function to get the CPI values from the user and validate that they are greater than 0. 1. Declare and implement a void function called getCPIValues that takes two float reference parameters for the old_cpi and new_cpi. 2. Move the code that reads in the old_cpi and new_cpi into this function. 3. Add a do-while loop that validates the input, making sure that the old_cpi and new_cpi are valid values. + if there is an input error, print "Error: CPI values must be greater than 0." and try to get data again. 4. Replace the code that was moved with a call to this new function. - Add an array to accumulate the computed inflation rates 1. Declare a constant called MAX_RATES and set it to 20. 2. Declare an array of double values having size MAX_RATES that will be used to accumulate the computed inflation rates. 3. Add code to main that inserts the computed inflation rate into the next position in the array. 4. Be careful to make sure the program does not overflow the array. - Add a…arrow_forward
- //Write a function that loops through and console.log's the numbers from 1 to 100, except multiples of three, log (without quotes) "VERY GOOD" instead of the number, for the multiples of five, log (without quotes) "SUPER AWESOME". For numbers which are multiples of both three and five, log (without quotes) "VERY GOOD SUPER AWESOME" Console log out: 12VERY GOOD4SUPER AWESOMEVERY GOOD78VERY GOODSUPER AWESOME11VERY GOOD1314VERY GOOD SUPER AWESOME1617VERY GOOD19SUPER AWESOMEVERY GOOD2223VERY GOODSUPER AWESOME26VERY GOOD2829VERY GOOD SUPER AWESOMEarrow_forwardEx. 8.4) The following functions are all intended to check whether a string contains any lowercase letters, but at least some of them are wrong. For each function, describe what the function actually does (assuming that the parameter is a string).arrow_forwardConsider the following line of code: X = new int*[n]; What should the type of x be? O int O int* O int** O int& O None of the abovearrow_forward
- Write a function that takes the current date and corrects the number of days, if it's wrong. The function must return true if the date passed to it is a valid date and false, if not. The main function uses the returned value to either print "Date validated", if a valid date was entered or "Invalid date entered. Changed to ", followed by the modified date.arrow_forwardWrite a function called expand_date() that takes a string parameter that contains the date in the form "mm/dd/yyyy". Your function should return a string formatted like this, for example "March, 12, 2020". IN PYTHONarrow_forwardComplete the rotate_text() function that takes 2 parameters, a string data and an integer n. If n is positive, then the function will shift all the characters in data forward by n positions, with characters at the end of the string being moved to the start of the string. If n is 0 then the text remains the same. For example: rotate_text('abcde', rotate_text('abcde', rotate_text('abcde', 1) would return the string 'eabcd' 3) would return the string 'cdeab' 5) would return the string 'abcde' rotate_text('abcde', 6) would return the string 'eabcd' ... and so on. If n is negative, then the function will shift the characters in data backward by n positions, with characters at the start of the string being moved to the end of the string. For example: rotate text('abcde', -1) would return the string 'bcdea'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