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
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 3 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
- # convert_revised_1.py # We will try to print a table without using "string formatting"def main():print("celsius", "fahrenheit") for celsius in range (-20, 110, 10):fahrenheit = 9/5 * celsius + 32print(celsius, fahrenheit)main() Your turn: Please revise the above program convert_revised_1.py with "string formatting" and try to print a better-formatted table(required width for Celsius value is 35, width Fahrenheit value is 45, both should be center-aligned/justified)arrow_forwardProblem 1 print("Problem 1") Create a function named problem 1.| Create a dictionary named spring23 with the names of your classes and professors. Using a loop, print out the name of your classes and your professors. Using a loop, print the name of your classes and your professors. Source Code Terminal Outputarrow_forwardJS Write a function named number_of_pairs whose parameter is an object/dictionary with strings as keys and integers as values. Your function should returns the number of key-value pairs in the parameter.arrow_forward
- Define the function lake_to_tli3_dict(readings) that takes a list of (lake_name, chla, tn, tp) tuples and returns a dict mapping lake names to trophic level index values. That is, the keys are lake names and the values will be TLI3 values. Notes: You will need to have import math as your first line of code. You must include and use/call the trophic_level_index function that you wrote in Question 1. trophic_level_index must still work as specified in Question 1. Lakes should be added to the dictionary in the same order as they appear in the readings list. If a lake appears in the readings list more than once, then the TLI for the last occurrence in the readings list should be the one that appears in the result. (This should happen naturally, since the lake name can only occur in the dictionary once.) For example: Test Result names_cnp_1 = [('Lake Brunner', 0.8, 218.0, 6.0), ('Lake Carrot', 5.1, 505.0, 18.5) ] tli3_dict = lake_to_tli3_dict(names_cnp_1 ) print(tli3_dict)…arrow_forward1c) Average sentence length We will create a function ( avg_sentence_len ) to calculate the average sentence length across a piece of text. This function should take text as an input parameter. Within this function: 1. sentences : Use the split() string method to split the input text at every '.'. This will split the text into a list of sentences. Store this in the variable sentences . To keep things simple, we will consider every "." as a sentence separator. (This decision could lead to misleading answers. For example, "Hello Dr. Jacob." is actually a single sentence, but our function will consider this 2 separate sentences). 2. words : Use the split() method to split the input text into a list of separate words, storing this in words . Again, to limit complexity, we will assume that all words are separated by a single space (" "). (So, while "I am going.to see you later" actually has 7 words, since there is no space after the ".", so we will assume the this to contain 6 separate…arrow_forwardThis code is a part of a C dictionary. Please write the code for the below requirements. dict_get Next, you will implement: char* dict_get (const dict_t* dict, const char* key); This function goes through the list given by dict. If you use the above structure, this means starting at el = dict->head and checking each time whether the key at el is key; if it is not, we set el = el->next, until either key is found, or we reach el == NULL. To compare key with el->key, we need to compare one by one each character in key with those in el->key. Remember that strings in C are just pointers (memory addresses) to the first character in the string, so comparing el->key == key will not do what you want. So how do you even get the length of a string s? You would start at memory location s and advance as long as the byte at s (i.e. *s) is not the end-of-string marker (\0, the NULL character). This can get a bit messy, so luckily, you are allowed to use the string comparison…arrow_forward
- typedef _people { int age; char name[ 32 ] ; } People_T ; People_T data [ 3 ]; Using string lib function, Assign 30 and Cathy to the first cell, Assign 40 and John to the second cell and Assign 50 and Tom to the third cell People_T *ptr ; Declare a pointer pointing to the structure data and print the age and name using the pointer. your output can be : 30 Cathy 40 John 50 Tomarrow_forward# dates and times with lubridateinstall.packages("nycflights13") library(tidyverse)library(lubridate)library(nycflights13) Qustion: Create a function called date_quarter that accepts any vector of dates as its input and then returns the corresponding quarter for each date Examples: “2019-01-01” should return “Q1” “2011-05-23” should return “Q2” “1978-09-30” should return “Q3” Etc. Use the flight's data set from the nycflights13 package to test your function by creating a new column called quarter using mutate()arrow_forwardLAB ASSIGNMENT, CONT. 2) author_book.py Use the previous project as a model. This time, use a variable called readings, of the dictionary data type (instead of users). It stores your favorite authors and book titles, as key-value pairs. Initialize the dictionary with 3 authors and book titles. Like the previous program, this one should display a command menu and let the user view, add, edit and delete dictionary entries. With the new program, you need to adapt the variable names, user-facing messages and capitalization strategies to fit the new content. NOTE: test data needs to use the same capitalization strategy as the program. COMMAND MENU view - View readings add Add a reading edit del exit Edit a reading Delete a reading Exit program Command: edit Enter author's name: G.W. Bush Current book title is 41: Portrait of My Father. Enter new title for G.W. Bush: Decision Points G.W. Bush title was edited to Decision Points. Command:arrow_forward
- As part of this assignment, the program that you will be writing will store current grades in a dictionary using course codes as keys and with values consisting of percent grades in lists. The main functions of this program are to print a student's gradebook, to drop the lowest grade in each course, print the student's gradebook again, drop the course with lowest average, and finally printing the student's gradebook again. This program requires a main function and a custom value-returning function. In the main function, code these basic steps in this sequence (intermediate steps may be missing): start with an empty dictionary that represents a gradebook and then use a while loop to allow the input of course codes from the keyboard. End the while loop when the user presses enter without entering data.within the while loop:for each course entered, use a list comprehension to generate five random integers in the range of 70 through 100. These random integers in a list represent the…arrow_forwardUse the function design recipe to develop a function named count_odds. The function takes a list of integers, which may be empty. The function returns the number of odd integers in the list.arrow_forward*Data Structures and Algorithmarrow_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