
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
please create the c++ code regarding this screenshot question i added and also please add professional comments at each line of the code using // command

Transcribed Image Text:Question
4: Write the main function, which calculates edit distance between two strings
The actual process of calculating edit distance is too advanced for us right now, so we're going to do a simplified solution that only works on special cases -- cases where both words are the same
length.
Your code must meet the following requirements:
• Accept two strings from a file or user
• Raise an error and stop if the strings are not the same length. This should also inform the user that there is a problem, and what that problem is.
• Uses a loop to cycle through the letters in the words and, when the letters at the current position are not the same, calls your function SubChar.
Tracks how many times you call SubChar -- this is the edit distance.
• Checks to make sure that the two strings are now identical
• Tells the user what the edit distance was.
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 2 steps

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
- Task 3: Data Form Validation Considering the following Form. Javascript code Write a validation.html and validation.js the data of this form. Create the validate Function calling validate()to check input data when user click on the submit This validate() Function check: If the First Name is Empty, display a message " First name required " in the Error division If the Second Name is Empty, display a message " Second name required " in the Error division If no Error, display the entered data in the searches division. 2. Create the clearAll Function calling clearAll()to clear all input data and the two division in body Error division and searches division.arrow_forwardThe code is below and use the code to answer the 3 questions that is attached as an image: #include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>#include <signal.h> void sigint_handler(int sig){ (void)sig; // remove unused variable warning write(0, "Ahhh! SIGINT!\n", 14);} int main(void){ void sigint_handler(int sig); /* prototype */ char s[200]; struct sigaction sa; sa.sa_handler = sigint_handler; sa.sa_flags = 0; // or SA_RESTART; sigemptyset(&sa.sa_mask); // if (sigaction(SIGINT, &sa, NULL) == -1) {// perror("sigaction");// exit(1);// } printf("Enter a string:\n"); if (fgets(s, sizeof s, stdin) == NULL) perror("fgets"); else printf("You entered: %s\n", s); return 0;}arrow_forwardForm Validation for jscript. This is the requirement. I just need the code and attached to my jscode. Payment Information Validation Validate the customer’s payment information as follows: Expiry Date (Month) Required field Expiry Date Valid expiry date to ensure the card being used has not expired Card Number Required field, Valid Card Number NOTE: regarding the expiry date, you MUST use the date object to ensure that your date check is dynamic. here is the given html code. <li> <label for="month">Expiry Date</label> <select id="month" name="month"> <option>- Month -</option> <option value="1">January</option> <option value="2">February</option> <option…arrow_forward
- visual basic, make a code that display a savings account balance for each of 5 years using rates from 3% to 7% in increments of 1%. Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click Dim dblDeposit As DoubleDim dblBalance As Double Double.TryParse(txtDeposit.Text, dblDeposit) txtBalance.Text = "Rate" & ControlChars.Tab &"Year" & ControlChars.Tab & "Balance" &ControlChars.NewLine End Subarrow_forwardHTML/CSS JAVASCRIPT please help me answer this question I will give you a good rating Thank you! Given the following word search application, which searches for words in paragraphs, modify it so that it Adds two spans tab within the HTML within the designated new "Illustate" text segments as shown below. Has a new click event which searches the occurrence of the word within all span tabs residing within the first div container , then highlights the text in the span tab which contains the word c) In the same routine, count the number of times ( using a global variable) that the word is found Within the object array loop for span tabs ( where the indexOf statement is located) and after all span tabs are highlighted, send that number to a new html element ( a div, h1, span, p choice is up to you). The count should be continually accumulated and should show the total number of times a word is found in a span tab for all user activated clicks of the search button for…arrow_forwardHi, can you help me with the indentation in this code, please. import csv# Define global variablesstudent_fields = ['ID', 'name', 'courses', 'absences', 'm1', 'm2', 'm3', 'total']student_database = 'students.csv'def display_menu():print("--------------------------------------")print(" Welcome to Student Management System")print("---------------------------------------")print("1. Add New Student")print("2. View Students")print("3. Search Student by iD")print("4. Search Student by courses")print("5. Delete Student")print("6. Quit")def add_student():print("-------------------------")print("Add Student Information")print("-------------------------")global student_fieldsglobal student_databasestudent_data = []for field in student_fields:value = input("Enter " + field + ": ")student_data.append(value)with open(student_database, "a", encoding="utf-8") as f:writer = csv.writer(f)writer.writerows([student_data])print("Data saved successfully")input("Press any key to continue")returndef…arrow_forward
- Using C# in a visual studio form, Create an application. Add a label and a button to the form. The button’s Click event procedure should add the number 1 to the contents of a class-level Integer variable named intNumber and then display the variable’s contents in the label. Code the application. Be sure to enter the three Option statements above the Public Class clause. Save the solution and then start and test the application. Next, change the class-level variable to a static variable.arrow_forwardOpen the application in the folder under the coursework. Open the HTML file and notice that an Invoice Date field has been added. Then, open the HTML file and notice that it includes a getFormattedDate() function that formats the Date object that’s passed to it in MM/DD/YYYY format and then returns the date string. Start the application, enter a subtotal, and click the Calculate button. Note that nothing is displayed in the Invoice Date field. In the click() event handler for the Calculate button, add code that gets the current date and formats it using the getFormattedDate() function. Then, add code that provides a default value of the formatted current date for the invoice date. Note that if an invoice date is entered, that date isn’t validated. Add code that sets the value of the Invoice Date field. If you’ve done this right, the application should display the current date when you click the Calculate button without entering anything in the Invoice Date field. <!DOCTYPE…arrow_forward
arrow_back_ios
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