What are the main challenges for IOT management?
In: Computer Science
Python programming:
Instructions:
In: Computer Science
Write a C++ program that asks the user for the values of three resistances. We suppose that the user will not enter a negative value. The program then asks the user whether he has a series or parallel montage. The user will answer with S or s for series and P and p for parallel. (If the user enters a wrong answer, he will see a message on the screen alerting him, and the program will end.) Finally, the program displays the total resistance value. (Note that for a parallel circuit, if one of the resistances is zero, the total resistance is zero)
In: Computer Science
PHP Language
I have XAMPP and I don't know how to display my PHP code. For instance, when I create a basic HTML webpage I just open the code into a web browser and it shows me a basic web page. When I try to show a PHP calculation it doesn't show. What are the steps in displaying my PHP doc?
In: Computer Science
Write a method, twoSumSorted2, that solves the following variant of the Two-Sum problem:
Given a sorted array of integers where each element is unique and a target integer, return in an Array List, the indices of all pairs of elements that sum up to the target. Each pair of indices is also represented as an Array List (of two elements). Therefore, the method returns an Array List of an Array List of size 2. If no pair in the input array sums up to the target, then the method should return an empty list.
public class Hw2_p1 {
// HW2 Problem 1 Graded Method
public static
ArrayList<ArrayList<Integer>> twoSumSorted(int[] A, int
target) {
ArrayList<ArrayList<Integer>> ans = new
ArrayList<>();
// Your code starts
// Your code ends
return ans;
}
// Test driver for twoSumSorted2
public static void main(String[] args) {
}
}
The following are two sample runs:
Input: ? = [−7, −5, −2, 0, 1, 6, 7, 8, 9], ?????? = 1
Return value: [0,7], [1, 5], [3, 4]
Explanation: The pairs in the input array that sum up to 1 are [−7, 8], [−5, 6] and [0, 1]. Their indices are [0, 7], [1, 5] and [3, 4] respectively.
Input: ? = [−2, 0, 1, 6, 7, 8], ?????? = 3
Return value: [ ]
Explanation: No pair of elements in input array sums up to 3. The returned list is thus empty.
Your method must have time complexity ?(?), where ? is the length of the input array.
In: Computer Science
Task G. Checkerboard (3x3)
Write a program checkerboard3x3.cpp that asks the user to input width and height and prints a checkerboard of 3-by-3 squares. (It should work even if the input dimensions are not a multiple of three.) Don't use function. Please explain in detail and make it simple. And be clear with the {}. Thank you in advance.
Example 1:
Input width: 16 Input height: 11 Shape: *** *** *** *** *** *** *** *** *** *** *** * *** *** * *** *** * *** *** *** *** *** *** *** *** *** *** *** * *** *** *
Example 2:
Input width: 27 Input height: 27 Shape: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
In: Computer Science
Vigenère Cipher
The Vigenère Cipher was more or less completely unbreakable from its introduction sometime in the 1500s until well into the 1800s.
The key in Vigenère is a key word that is used over and over again to give a different key to the Caesar cipher for each letter of the encryption (and decryption), with 'A', in good Python form, representing a rotation of 0. (We Pythonistas start at 0, not 1!)
So if the key is ABACUS, then we encrypt:
Back in the 1800s people wanting to use this system would make use of a Vigenère square, also known as the tabula recta, shown in the middle of the Wikipedia entry for the Vigenère cipher, but we can use Python.
Vigenère part of the homework: Write vig_encrypt() and vig_decrypt() functions. Each takes two strings as inputs, with the first being the plaintext/ciphertext, and the second being the key. Both should be calling functions you wrote earlier to help make the work easier.
The key will be a string consisting only of letters, but the letters might be in upper, lower, or mixed case. Important: If the plaintext to be encrypted has non-alphabetic characters (e.g., spaces or punctuation):
One check on your work: vig_encrypt('ATTACKATDAWN', 'LEMON') should return the string LXFOPVEFRNHR; another is that vig_encrypt('Hi Mom!', 'LEMON') should return the string SM YCZ!
In: Computer Science
Write code to reverse the order of elements on a stack S.c++
ii. Using one additional queue.
iii. using an additional stack and a non array variable
c++ .
In: Computer Science
Suppose we are given two skip lists, one storing a set A of m keys, and the other storing a set B of n keys. Describe and analyze an algorithm to merge these into a single skip list storing the set A ∪ B in O(n + m) expected time. Do not assume that every key in A is smaller than every key in B; the two sets could be arbitrarily intermixed.
In: Computer Science
Write a program that uses a loop to read 10 integers from the user. Each integer will be in the range from -100 to 100. After all 10 integers have been read, output the largest and smallest values that were entered, each on its own line in that order.
Avoiding using the max or min functions from Python, and definitely use a loop to read the integers instead of 10 input statements.
In: Computer Science
Given a BST and a sum, write pseudo code to determine if the tree has a root- to-leaf path such that adding up all the values along the path equals the given sum. Given the below BST and sum = 49, the array is (8, 4, 10, 1, 0, 3, 9, 15, 16). Return true, as there exist a root-to-leaf path 8− > 10− > 15− > 16 which sum is 49.
In: Computer Science
Write a class Store which includes the attributes: store name and sales tax rate. Write another class encapsulating a Book Store, which inherits from Store. A Book Store has the following additional attributes: how many books are sold every year and the average price per book.
Code the constructor, accessors, mutators, toString and equals method of the super class Store and the subclass Book Store; In the Book Store class, also code a method returning the average taxes per year.
You should create a test class which creates 1 Store object and 2 Book Store objects, then calls your set methods, get methods, toString and equals methods and average taxes per year for the Book Store objects..
In: Computer Science
What are software requirement tools? What are the two major categories of these requirement tools? Write some key features that must be considered while choosing the requirement tools? Also, give some real-world examples for some of these tools.
NO HANDWRITING PLEASE... THANK YOU.
In: Computer Science
Python - You are given a sorted (from smallest to largest) array A of n distinct integers which can be positive, negative or zero. Design the fastest algorithm you can for deciding if there is an index i such that A[i] = i.
In: Computer Science
• P8.2 Simulate a tally counter that can be used to admit a limited number of people. First, the limit is set with a call public void setLimit(int maximum) If the count button was clicked more often than the limit, simulate an alarm by printing out a message “Limit exceeded”.
In: Computer Science