This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file reading. Then it reads the file one line at a time and cřeates a new friends database to return. Like in the previous function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline. Sample calls should look like this: >> load_friendsdb("friendsdb.tsv")
Q: Which of the following situations willl lead to an object being aliased? Select all that apply. O…
A: Solution: Given,
Q: Question 2 Carorder( orderNo, model, color, price) Lastprinted( DateUsed) Write an anonymous block…
A: Read a car model from the keyboard SELECT model from Carorder; List the ten most expensive orders…
Q: You should implement hashing in two different methods to resolve
A: May this help you....
Q: Your client wishes to have a program that would generate a student database in a form of Excel…
A: The program is given below:-
Q: library (ISLR) library (boot) attach (Auto) boot.fn=function (mydata, idx) {…
A: Which of the following statement is false about the code above. Answer is None of the above Because…
Q: in Mongo DB We want to add some students to our collection, but this time, we define the value for…
A: 1.use seneca //create database db.student.insertOne({})…
Q: If the current record is the ninth record in a dataset that contains 10 records, which of the…
A: Valid statement The Position Property and the MoveLast() method can be used to position the record…
Q: A text file called "Oscars.txt" is given to you. It includes the names of some actors with their…
A: Below I have provided Python Programming. Also, I have attached the screenshot of the code and…
Q: public int readBalance(int acctId) throws SQLException { // TODO: Read balance from given account…
A: As per the requirement program is completed. Note: In this program database details which I used…
Q: #pwd;ls | tee ls.txt1 | tr ‘a-z’ ‘A-Z’ > ls.txt2 #ls | sort >> ls.txt1 2>> ls.txt2 #sort > ls.txt2…
A: It used to translate characters to different characters. tr 'a-z' 'A-z' Translate lower to upper…
Q: ''' In this function, you will try to make a transfer between two user accounts. bank is a…
A: Note that there were no restriction stated hence made this way. Note that in step2 only function is…
Q: public async TaskDetails(int? id) var doctor = await context.Doctor.Include ).Theninclude…
A: The following is the solution for the above problem. The explanation for the same is provided in the…
Q: What is the value of the sum variable for the fifth observation (MAY98)? Report your answer to one…
A: Answers The Internet is a stateless medium. A client request to a server has no knowledge of…
Q: 2. load_friendsdb This function does the reverse of save_friendsdb -- it takes a single argument,…
A: According to the given information :- now we have to load friendsdb information from height.txt…
Q: Write a Python program that connects to a sqlite database. Create a table called Horses with the…
A: Code : import sqlite3 from sqlite3 import Error def create_connection(db_file): conn = None…
Q: Provide a function named "addToSessionStorage" that accepts two parameters: The first parameter…
A: Since no information is mentioned about front end part and asked only function, I am providing only…
Q: A python dictionary, Bank, is created to keep track of the Current Account and the Savings Account…
A: #function to print the contents of dictionary bank def printBank(): for x, y in Bank.items():…
Q: 1. save_friendsdb This function takes two arguments, friendsdb and filename. It opens up the file…
A: According to the information given:- We have to create a save_friendsdb with 2 argument friendsdb…
Q: Python with File Method Restaurant reservation program. The application offers different…
A: It is defined as a powerful general-purpose programming language. It is used in web development,…
Q: The helper class method called when you need to update data in database table is O a.…
A:
Q: department ID, uses BULK COLLECT to retrieve all employees in that department, and displays their…
A: Write a stored procedure that accepts a department ID, uses BULK COLLECT to retrieve all employees…
Q: In this assignment, you have to write down a file comparison application. You can use this chapters…
A: import java.util.*;import java.io.FileReader;import java.io.ObjectOutputStream;import java.io.*;…
Q: This sl/sql program Please make a procedure that takes two parameters and prints a list of students…
A: A procedure is a collection of code which encloses sql statements within its body. PARAMETERIZED…
Q: Exercise 1: Use vi to create a file with name "table1.txt" with following content. fruit amount…
A:
Q: 1 !/bin/bash 2 if [ $† -eq 0 ]; then 3 echo "Usage:" echo "$0 userlist" echo "$0 userinfo " 4. 5 6…
A: In the given unix shell program we have to authenticate the user by taking a valid username and…
Q: write a batch script/ Batch file for windows ( file.bat) to sort by column for a table this…
A: Display a list of menus to the user. Store the input in the input variable called choice using the…
Q: In this assignment, you have to write down a file comparison application. You can use this chapters…
A: Step 1: Declare the main() method. Declare the file pointers for the four files. Step 2: Open two…
Q: Implement all the functions from the Question 2 and make a login and sign up module, all the data…
A: you can create c , c++, java program for the user login signup code. following code is created in C…
Q: SBN Title Author 12345678 The Hobbit J.R.R. Tolkien 45678912 DaVinci Code Dan Brown Your student ID…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: In this function, you will try to make a transfer between two user accounts. bank is a…
A: def transfer(bank, log_in, userA, userB, amount):'''In this function, you will try to make a…
Q: ISBN Title Author 12345678 The Hobbit J.R.R. Tolkien 45678912 DaVinci Code Dan Brown Your student ID…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: you are required to read input file containing data of countries or region, to compute and display…
A: A Java program that satisfies the given criteria is as follows, File name: “Covid.java” import…
Q: Write a script that implements the following design in a database named my_web_db: downloads…
A: In Database language **************** a. CREATE TABLE downloads ( download_id INT, user_id…
Q: Write a Python program that connects to a sqlite database. Create a table called Horses with the…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Hello, I have an excel file with a vlookup formula in it. I'm attempting to export this file into…
A: The Column Index is the number of columns to the right of the search column that you want to return…
Q: Your function should open the file given as a parameter and read the data from it into a database.…
A: def read_pokedata(txt_file): data = {} with open(txt_file,"r") as file: counter = 1…
Q: A text file called "Oscars.txt" is given to you. It includes the names of some actors with their…
A: Below I have provided a python program for the given question. Also, I have attached a screenshot of…
Q: In this task, we would like to generate a keyed hash (i.e. MAC) for a file. We can use the “-hmac”…
A: Below i have written.
Q: Repeat the example below but this time you should do the following : - Maintain a database in a…
A: we make a different car rental system C++ program which is given below
Q: Write a Python program that connects to a sqlite database. Create a table called Horses with the…
A: import sqlite3 from sqlite3 import Error def create_connection(db_file): """ create a database…
Q: Write a program that will prompt the user for a username and validate that username is in the…
A: logic read username set f=0 iterate each key value in approvedUsers dictionary. check if…
Q: Write a php function (in the space below or attach a file) that returns an array of total sales…
A: Answer: I have given answered in the handwritten format
Q: Write another function called db_consistent that takes a dictionary of dictionaries in the format…
A: def db_consistent(dict_of_dict):""" (dict of dict) -> setReturn whether all inner dictionaries in…
Q: How can I change this function ? I need to open the file and can write the name I want to delete .…
A: Changes in function to be performed are: void removeContact(){browse(); //-------------Replace the…
Q: Which of the following situations will lead to an object being aliased? Select all that apply. O…
A: About Aliased:it is used whenever one variable valve is assigned to another variable.not same as…
Q: Which of the following set methods removes an element, but does NOT raise an exception if the…
A: Which of the following set methods removes an element, but does NOT raise an exception if the…
Q: Why does the insertNode function shown in this section use a previousNodePtr pointer?
A: Reason:-
Q: When you create a case in EnCase you add your information either by a template or enter it…
A: Answer: It is stored in the header in the first evidence file since it does not have to be written…
Q: awk is similar to the SQL language in that you can query certain records. What command below will…
A: Solution: The AWK works to scan the each line of text or the records in the file and carry out any…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- 5. Be able to load a FriendsDB from a file. Make a new function, load_friends_database(filename) that creates a new FriendsDB object and populates it based on the contents of the file. For example, if you had the output of the previous example run saved in the current directory as "friendsdb.tsv", then the following is a sample run. >>> db = load_friends_database("friendsdb.tsv") >> db.friends_who_love("falafel") ['bimmy'] >> print(db.friends[0]) [FRIEND name: bimmy, height: 60, favorite foods: falafel, vegemite] >> print(db.friends[1]) [FRIEND name: eliza, height: 170, favorite foods: ]Computer Science Create a java application and run it . Continuing with the same VRecord class as in Q2. Program a new tester class that will use the same Record class to perform below tasks This new tester class will ask the user to enter a student ID and vaccine name and create a new Record object and add to a list, until user selects 'No" to enter more records question. The program will then ask the user to enter a Student ID and vaccine name to check if that student had a specific vaccination by using the built-in method and print the result to screen.Write a procedure named DumpMemory that encapsulates the DumpMem procedure in theIrvine32 library. Use declared parameters and the USES directive. The following is anexample of how it should be called: INVOKE DumpMemory, OFFSET array, LENGTHOFarray, TYPE array
- Write a program that generates student records in a database file. Your program should be able to generate at least 10 records. The format in the database should be: student name, student id The first student id should be 20180001, second id will be 20180001 and so forth.In this lab, you will read two files. Firstly, the ‘AccountData.csv’ file has the name and account number.Use each account number to scan the ‘BankData.csv’ file for a matching account number to get a ‘balance’from the account transactions. You must repeatedly open, read the ‘BankData.csv’ file and close it for eachaccount number in the ‘AccountData.csv’ file unless you wish to store its entire contents in a static array.(More code and may not be enough time to complete.) import java.io.*;import java.nio.file.Files;import java.nio.file.Path;import java.nio.file.Paths;import java.util.ArrayList;import java.time.format.DateTimeFormatter; public class BankDataProcessing { static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd-yyyy HH:mm"); static ArrayList<BankAccount> Accounts = new ArrayList<>(); public static void main(String[] args) { try { Path path = Paths.get("src/AccountData.csv"); readAccounts(path, true);…Please help me write the following function (please see the attached photos for context of the problem): find_treasure(start_map_num): Takes an integer between 0 and 9 as input. Loads the corresponding map file, and starts following the trail (at position 0, 0 of that file) as described above. Continues following the trail through other map files as needed. Places an 'X' at the conclusion of the trail and saves the updated treasure map to a new file with 'new_' prepended to the current map filename. Returns a tuple of the row and column index where the 'X' was placed in that file.
- This function is used to create a bank dictionary. The given argument is the filename to load. Every line in the file should be in the following format: key: value The key is a user's name and the value is an amount to update the user's bank account with. The value should be a number, however, it is possible that there is no value or that the value is an invalid number. What you will do: - Create an empty bank dictionary. - Read in the file. - Add keys and values to the dictionary from the contents of the file. - If the key doesn't exist in the dictionary, create a new key:value pair. - If the key does exist in the dictionary, increment its value with the amount. - You should also handle the following cases: -- When the value is missing or invalid. If so, ignore that line and don't update the dictionary. -- When the line is completely blank. Again, ignore that line and don't update the dictionary. -- When there is whitespace at the…1. save_friendsdb This function takes two arguments, friendsdb and filename. It opens up the file specified by filename for writing and stores the information for each friend on a single line. Each line contains a friend's name followed by a tab, then the friend's height, and then a newline (\n). Be careful with this function -- don't accidentally overwrite any important files! Sample calls should look like this: >>> save_friendsdb(my_friends, "friendsdb.tsv") But then when you have made this call, friendsdb.tsv (TSV stands for "tab-separated values") will contain this text: bimmy 600 I 175 Ian Donald Calvin Euclid Zappa (a drawback of Canvas here is that we can't include tabs -- those multiple spaces should be a single tab. Also, we are assuming that friends names do not contain \t or \n characters.)write a batch file which it can Sort based on the column in file. Important that the user can choose which column . Look what is batch file : https://en.wikipedia.org/wiki/Batch_file The textfile : ID Name Weight Long Class Age012 Eric 56 156 7 13045 Richard 78 178 9 17098 Maya 60 164 10 16072 Anna 56 152 8 14034 Helena 76 169 11 18022 Kevin 66 162 6 12093 Peter 99 170 12 19
- astfoodStats Assignment Description For this assignment, name your R file fastfoodStats.R For all questions you should load tidyverse, openintro, and lm.beta. You should not need to use any other libraries. suppressPackageStartupMessages(library(tidyverse)) suppressPackageStartupMessages(library(openintro)) suppressPackageStartupMessages(library(lm.beta)) The actual data set is called fastfood. Continue to use %>% for the pipe. CodeGrade does not support the new pipe. Round all float/dbl values to two decimal places. All statistics should be run with variables in the order I state E.g., "Run a regression predicting mileage from mpg, make, and type" would be: lm(mileage ~ mpg + make + type...) To access the fastfood data, run the following: fastfood <- openintro::fastfood Create a correlation matrix for the relations between calories, total_fat, sugar, and calcium for all items at Sonic, Subway, and Taco Bell, omitting missing values with na.omit(). Assign the…Implement all the functions from the Question 2 and make a login and sign up module, all thedata will be stored in the files and as well as in the linked list, Program will have two modules1. login2. sign upSign Up:In this module the program will ask the user to enter username, password, address, city, phonenumber, gender and will store the data in the linked list. If the username already exists in thelinked list it will ask the user to change the username, all the data will also be stored in the textfile.Login: In this module the user will enter its username and password, the program will check if the dataexists in the linked list, if yes then show “Welcome to home screen”, if not then ask the user toenter the username and password again.Work Flow:1. The program will start and all the data from the files will be loaded in the linked list.2. The login and sign up screen will pop up3. Apply proper checks, if the file exists or not (Hint: you can use try catch to handle theexceptions)…This function is used to create an user accounts dictionary and another login dictionary. The given argument is the filename to load. Every line in the file should be in the following format: username - password The key is a username and the value is a password. If the username and password fulfills the requirements, add the username and password into the user accounts dictionary. To make sure that the password fulfills these requirements, be sure to use the signup function that you wrote above. For the login dictionary, the key is the username, and its value indicates whether the user is logged in, or not. Initially, all users are not logged in. What you will do: - Create an empty user accounts dictionary and an empty login dictionary. - Read in the file. - If the username and password fulfills the requirements, adds the username and password into the user accounts dictionary, and updates the login dictionary. - You should also handle…