Python Programming: Write a program using unittest.TestCase methods to confirm that the addition and subtraction of date and timedelta objects produce correct results. Important notes: Use the unittest module to create a TestCase to test that the addition and subtraction of date and timedelta objects produce correct results... For example I could create a TestCase with a function that tests the addition of date and timedelta objects; a function that tests the subtraction of date and timedelta and then call unittest's main method at the end. When you run this program, it should tell us whether the text was successful or not. See attached image for what the output should look like.
Q: Bash script Start this part of your script with a comment # Response to Assignment 2, Task 2 echo...
A: Here is the scipt, if it's not too much trouble, go through the remarks for better understanding of ...
Q: rite SQL queries AND Relational algebra expressions (using the relational algebra operators: ρ, σ, π...
A: Q4 SQL Database Queries You are given the following database schema of tables: Hotel (HotelNo, Hotel...
Q: Users can interact with a telephone menu system by speaking instead of pressing buttons on the dial ...
A: Two arguments in support of speech recognition technology: Talking is faster than typing! Voice com...
Q: Write a Java program to take an array of ints, print the number of 9's in that array
A: Take the input from user and while iterating compare each and every element and increment if the ele...
Q: Item Counter Assume that a file containing a series of names (as strings) is named names.dat and ex...
A: I give the code in Python as per your requirement along with output and code screenshot
Q: What information is included in a computer printout, and what automated procedures are used?
A: Let us see the answer:- Introduction Explanation for first part:- A document that is printed from a ...
Q: Task2: In packet switching technology the packet size is an import parameter when it comes to effici...
A: Switching the packet is a way to transfer data to a network in the form of packets. In order to tran...
Q: А В C D E F G H I J K
A:
Q: Please right down the steps you would need to take to do the following in a Vitial Machine! In your...
A: Before you can change the desktop background in Student VM, you need to change the following Group P...
Q: Convert the given decimal to floating point format. -0.09375; 32-bit format .
A:
Q: v) Write a Python program to input two strings s1 and s2 of lengths x1 and x2 respectively. Compute ...
A: Required:- v) Write a Python program to input two strings s1 and s2 of lengths x1 and x2 respectivel...
Q: Pattern Matching: - Create HTML page that: o display a log in form asking for user name, create a pa...
A: HTML,CSS & JavaScript Form Validation with output.
Q: Describe and provide examples of the three possible contexts for concurrency.
A: Intro CONCURRENCY: Concurrency refers to the process to execute more than one instruction simultane...
Q: Explain what may be done with primary keys to prevent key ripple effects from occurring when a datab...
A: Introduction: Eliminating critical ripple effects: A ripple effect occurs when a relation's primary...
Q: What is the significance of a methodology in the execution of information security measures? How doe...
A: Introduction : Methodology is important in information security because it protects data and informa...
Q: What is the function of ASCII?
A: Introduction Purpose of ASCII: ASCII stands for American Standard Code for Information Interchange....
Q: Write a method named stringTimes that is passed a String parameter word and a positive integer num. ...
A: public class Main{ public static String stringTimes(String str,int num){ String ans = ""; // initia...
Q: Given the recorded temperatures for a week: Mon Tue Wed Thu Fri Sat Sun 42 39 52 49 75 83 41 Find th...
A: For this program, the following steps need to be taken: Assigning given temp data into a vector Cal...
Q: The Turing Machine below starts with the input 0101 with the head on the left most 0. What will be i...
A: According to the question we need to answer:
Q: Determine the specific type of addressing mode (SMALL LETTERS only) and compute for the address/es. ...
A: Below is the answer to above question. I hope this will helpful for you...
Q: Show that (-p q) is equivalent to (p -q).
A: Consider both the expressions and covert to possible disjunction or conjunction and then we can comp...
Q: Agile approaches employ quick development cycles to deliver running versions of the system repeatedl...
A: Intro The "agile" methodology is a type of software development where each phase of the software d...
Q: Merge DataFrames df1 and df2 import numpy as np
A: df1.merge(df2, left_on='lkey', right_on='rkey') Output ___ lkey value_x rkey value_y 0 faa 2 faa...
Q: (The sets (BNA) = B\ complement (A true False
A: Here, we are going to check whether two sets are equivalent or not. Using Venn diagram, we can check...
Q: Latest technology of Cloud Computing in Gaming.
A: Cloud computing advancements in gaming have delivered gamer quite far from blowing dust once again f...
Q: What is the most effective strategy for memory management, and why is it the most successful?
A: Introduction: This website has been diverted from the phrase "effective." Side Effect's CD is effect...
Q: Make brief notes on a) the World Wide Web
A: Introduction: Tim Berners-Lee is credited with developing the World Wide Web while working at CERN i...
Q: import java.util.Scanner; public class CircleAndSphereWhileLoop { public static final double MA...
A: import java.util.Scanner; public class VolumeOfSphereUsingMethod { private static Scanner sc; pub...
Q: What are the roles of gluLookAt() and glortho()? In terms of computer graphics
A: Intro Function of gluLookAt(): The gluLookAt function creates a viewing matrix derived from an eye p...
Q: Write a C++ program to take a string from the user, print a new string made of every other char star...
A: Your C++ program is given below as you required with an output.
Q: yd?
A: given - wyd?
Q: When it comes to computer security, what is the relationship between MULTICS and the early developme...
A: Introduction: It was the first operating system designed with security as a fundamental objective. S...
Q: work like half-adder, (> work like a half-subtra = two bits, x and y, acco ns and logic diagram.
A: On the basis of this logic we get the following schematic diagram for a 4 bit adder/subtractor A3 A2...
Q: IN PYTHON Please! Suppose you deposit $100 into a savings account, and it accumulates at 6% interest...
A: Compound interest is calculated based on the accumulation of principal and interest earned on the pr...
Q: main.c 2. Capital - Small = ? by Jemar Jude Maranga Given a string that's guaranteed to only have al...
A: Find the required code in C given as below and output:
Q: Do routers route packets to MAC addresses?
A: Introduction: Do routers route packets to MAC addresses?
Q: please use emu8086 Write a code to store your number(12345678)digits into memory locations starting...
A: Algorithm - Load value stored in 2050 memory space in accumulator ATransfer the amount of accumulato...
Q: v) Write a Python program to input two strings s1 and s2 of lengths x1 and x2 respectively. Compute ...
A: Given : To write python program to input two strings s1 and s2 of lengths x1 and x2 and find the val...
Q: MC1. You are asked to design a flashlight that will last at least eight hours without having to be r...
A: We need to answer:
Q: Formulate pseudocode and draw the flowchart for the following . Create a simple guessing game. The c...
A: Here we have attached code, with output. Flowchart with pseudocode to make you understand better. ...
Q: There is a limit to how many primary partitions can be created on a hard drive.
A: Introduction: Primary division On a standard drive, you may create up to four primary partitions. E...
Q: v) Write a Python program to input two strings s1 and s2 of lengths x1 and x2 respectively. Compute ...
A: ** is the exponential operator which is used as pow function in other languages used for raising a n...
Q: Adding two signed integers encoded in 2's complement, overflow is indicated when O the carry in to t...
A: Solution:-
Q: v) Write a Python program to input two strings s1 and s2 of lengths x1 and x2 respectively. Compute ...
A: Please refer below for your reference: For power of the lengths I have used pow inbuilt function of ...
Q: Construct a PDA that accepts { a#b | a, b in {x, y}* such that a ≠ b and ai = bi for some i, 1 ≤ i ≤...
A: Here, I have to provide a solution to the above question.
Q: To function successfully, the components of a data hierarchy must be recognised all the way up to th...
A: Introduction: To work successfully, the components of a data hierarchy must be recognized all the wa...
Q: Computer Science Investing in stocks is a way to create assets that are supposed to provide financi...
A: Stock.java public class Stock{ //Design a class, Stock, with instance variable cost. private d...
Q: difference between design pattern vs component reuse in OOAD.
A: Design Pattern: A design pattern describes a recurring problem and then describes the core solution...
Q: Describe the technique for views to save reprogramming time.
A: Let us see the answer Introduction The state preservation and restoration procedure relies heavily o...
Q: QUESTION 1 Using 74LS163 4-bit binary counter and any necessary gates, design a counter that produce...
A:
Python
Write a program using unittest.TestCase methods to confirm that the addition and subtraction of date and timedelta objects produce correct results.
Important notes:
Use the unittest module to create a TestCase to test that the addition and subtraction of date and timedelta objects produce correct results... For example I could create a TestCase with a function that tests the addition of date and timedelta objects; a function that tests the subtraction of date and timedelta and then call unittest's main method at the end.
When you run this program, it should tell us whether the text was successful or not. See attached image for what the output should look like.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Turn this into a flowchart/pseudo code. //This is where the functions go void insertfront(int data);void insert(int data);void display();void deletedata(int data);void reverselist();void searchdata(int data);void swap();void datasort();void deleteList(); #include <iostream>#include <stdlib.h>using namespace std; struct Node {int data;struct Node *next;}; struct Node* head = NULL;struct Node* rhead = NULL;int count1; //insert in front for reversedlistvoid insertfront(int data){Node* new_node = (Node*) malloc(sizeof(Node)); new_node->data = data; new_node->next = rhead; rhead=new_node;}//insert at endvoid insert(int new_data){Node* ptr;ptr = head;Node* new_node = (Node*) malloc(sizeof(Node)); new_node->data = new_data; new_node->next = NULL;if (head == NULL) { head = new_node; } else{while (ptr->next!= NULL) { ptr = ptr->next;}ptr->next=new_node;}count1++;}//display listvoid display() {struct Node* ptr;ptr = head;if(head==NULL){cout<<"Sorry the list…Task 2 Get Binary 1: Implement the get_bin_1 function as directed in the comment above the function. If the directions are unclear, run the code, and look at the expected answer for a few inputs. In order to be able to compare your solution to the answer, you cannot simply print out the binary directly to the console. Instead, you have been provided with a very rudimentary stringbuilder implementation that allows you to build a string one character at a time, without the ability to erase. There are comments at the top of the code explaining how to use the stringbuilder, however you could also see how it is being used in task_2_check. Note: if you create a stringbuilder and append ‘a’, ‘b’, then ‘c’, the resulting string will be “abc” when printed. You are free to read through the stringbuilder implementation, but it is quite complicated in order to make it easy to use. As specified in the comment, you may not use division (/) or mod (%) to implement this function (as the check…Q.Create an interesting educational information chat box that asks the user to give an input question and then answers the question given by user with a suitable answer. It should match the question of user with the answer avaliable. Make use of list for different questions and answers. (if possible) Save two to three answers for a single question and then for random selection of elements from those answers use random choice(list) method from random module that returns a random element. Also for a user question that doesn't matches with the questions present in the chat box it should display statement like "oops i can't answer that" "sorry i am not intelligent enough" "could u please ask something else" using random method so that every time one of these statements appear **coding language python ***try using basic programming techniques in python without using arrays and pointers * * * copy paste the program itself and also the screenshot of program and output * * * use any…
- Lab Goal : This lab was designed to teach you more about sorting data with the built-in java sorts. Lab Description : Take a list of words and output the list in ascending order. Use Arrays.sort().Sample Data : abc ABC 12321 fred alexandera zebra friendly acrobatics 435 TONER PRinTeRb x 4 r s y $123 ABC abc 034 dog cat sally sue bob 2a2Sample Output : word 0 :: 12321word 1 :: ABCword 2 :: abcword 3 :: alexanderword 4 :: fred word 0 :: 435word 1 :: PRinTeRword 2 :: TONERword 3 :: aword 4 :: acrobaticsword 5 :: friendlyword 6 :: zebra word 0 :: $word 1 :: 4word 2 :: bword 3 :: rword 4 :: sword 5 :: xword 6 :: y word 0 :: 034word 1 :: 123word 2 :: 2a2word 3 :: ABCword 4 :: abcword 5 :: bobword 6 :: catword 7 :: dogword 8 :: sallyword 9 :: sue I need a code class and a runner classA Lo Shu Magic Square is a grid with 3 rows and 3 columns. Create a Lo Shu Magic Square in Python with these properties:-A grid that contains the numbers 1-9.-The sum of each row, each column, and each diagonal all adding up to the same number.-Simulate the magic square using a two-dimensional list.-It must throw an exception if any character other than 1 – 9 is selected.-The program must give an message explaining that wrong input has been provided.-The program has to prompt the user until the condition has been satisfied. It should prompt the user to enter a number from 1-9.-The program can only use each number once.-When the program starts, it must explain how to play the game. Those who have never heard of it should be able to play. The directions should be clear.-Show an example of a Lo Shu Magic Square after each game.-The program must allow users to play the game until they choose to quit.It also must keep track of wins and losses.The user should be given a choice to choose a…Q.Create an interesting educational information chat box that asks the user to give an input question and then answers the question given by user with a suitable answer. It should match the question of user with a suitable answer avaliable . You can make use of list for different questions and answers. (if possible) Save two to three answers for a single question and then for random selection of elements from those answers use random choice(list) method from random module that returns a random element. Also for a user question that doesn't matches with the questions present in the chat box it should display statement like "oops i can't answer that" "sorry i am not intelligent enough" "could u please ask something else" using random method so that every time one of these statements appear **coding language python ***try using basic programming techniques in python without using arrays and pointers * * * copy paste the program itself and also the screenshot of program and output…
- class BinaryImage: def __init__(self): pass def compute_histogram(self, image): """Computes the histogram of the input image takes as input: image: a grey scale image returns a histogram as a list""" hist = [0]*256 return hist def find_otsu_threshold(self, hist): """analyses a histogram it to find the otsu's threshold assuming that the input hstogram is bimodal histogram takes as input hist: a bimodal histogram returns: an optimal threshold value (otsu's threshold)""" threshold = 0 return threshold def binarize(self, image): """Comptues the binary image of the the input image based on histogram analysis and thresholding take as input image: an grey scale image returns: a binary image""" bin_img = image.copy() return…In python, The function count_contains_x takes a list of strings (wordList) and returns the count of how many strings in the list contain at least one upper- or lower-case 'x'. Hint: Use the accumulator pattern to accumulate the count. Hint: You might want to use the string method count. For example: Test Result strlist = ["xerox", "OXEN", "whiffleball", "XOXOX"] print(count_contains_x(strlist)) 3 fish = ["angel", "gold", "cat", "puffer", "damsel"] print(count_contains_x(fish)) 0 strlist = ["X", "x"] print(count_contains_x(strlist)) 2 list_of_one_x = ["x"] print(count_contains_x(list_of_one_x)) 12. count_fred_and_ted Given a list of strings called names , count up how many of those names are either "fred" or "ted", and return the count. Sample calls should look like: >>> count_fred_and_ted(["sarah", "bimmy", "fred", "eliza", "ted", "ted"]) 3 >> count_fred_and_ted(["sarah", "bimmy", "bimmy", "bimmy", "bimmy"]) >>> count_fred_and_ted(["fred", "ted", "fred", "ted"]) 4 >>> count_fred_and_ted([])
- a. The mean of a list of numbers is its arithmetic average. The median of a list is its middle value when the values are placed in order. For example, if a list contains 1, 4, 7, 8, and 10, then the mean is 6 and the median is 7. Write an application that allows you to enter five integers and displays the values, their mean, and their median. Save the files as MeanMedian.java. b. Revise the MeanMedian class so that the user can enter any number of values up to 20. If the list has an even number of values, the median is the numeric average of the values in the two middle positions. Save the file as MeanMedian2.java.Q2 Answer Q2(a)-Q(d) based on the information given in Figure Q2. to record daily information of at Liney Restaurant. The program creates a linked list in /"This program is meant the menu available which each node contains data such as menu name, price per unit, preparation time, quantity ordered and a pointer. The declaration of the structures MenuData and MenuNode are given in the program.*/ tinclude tinclude tinclude #define SIZE 20 struct Menubata char menuName (20]; double price PerUnit; double prepzime; int quantityordered, typedef struct Menubata MenuData; struct MenuNode MenuData data; struct MenuNode *next; typedef struct Menutode MenuNode, void showPrepTime (MenuNode *fftr): int main () MenuNode *front = NULL, *newNodePtr; MenuData input Data, for (int i=l; i<=SIZE, i++) printf ("\nEnter menu name: "): gets (inputData.menuName): printf ("\nEnter price per unit: "); scanf ("$lf", 5inputData.pricePerUnit); printf("\nEnter preparation time (hours): "): scanf ("lf", &input…import Prelude hiding (lookup) data Exp = Num Int | Add Exp Exp | Sub Exp Exp | Mul Exp Exp | Div Exp Exp | Var String | Let String Exp Exp | App Exp Exp | Fnc String Exp deriving (Show) type Env = [(String, Val)] data Val = CVal Int | FnVal String Exp Env | Error String deriving (Show) {-Implement a function lookup:: Env -> String -> Val that looks up the value of a variable within a context. This function returns the value of the variable if found and returns an error otherwise. -} lookup :: Env -> String -> Val -- code here-- {- Implement a function eval:: Exp -> Env -> Val to evaluate an expression with an initial context and return a value. Errors occur in the following cases: (a) Left-hand-side of a function application is not a function. (b) Use an undefined variable (c) Arithmetic expression where operand is not a number -} eval :: Env-> Exp -> Val -- code here --