Provide a comparison of at least 10 Internet of Things communication protocols. Provide your answer in a table format labelling each comparison parameter with a suitable heading. Use at least 5 parameters for comparison.
In: Computer Science
There are various methods which organizations can use to acquire a new system. Some of these include: outsourcing, off-the-shelf software and in-house development. Select two of these three methods to acquire software and discuss the advantages and disadvantages of each. Which do you believe is the preferred method of systems acquisition
In: Computer Science
Calculate the Area and Perimeter for shapes using functions in Python.
Your goal is to match the sample output below:
Welcome to my area and perimeter calculator ====================================================== Circle : area = 39.82, perimeter = 22.37 Square : area = 85.19, perimeter = 36.92 Rectangle: area = 41.24, perimeter = 34.24 Triangle : area = 21.16
Here is the code to use for your program (Note you may have to type this code into Trinket directly)
import math # Add your code here # TODO -> Add welcome function here # TODO -> Add circle area function here # TODO -> Add circle perimeter function here # TODO -> Add square area function here # TODO -> Add Square perimeter function here # TODO -> Add rectangle area function here # TODO -> Add rectangle perimeter function here # TODO -> Add triangle area function here # ===================================================================== # Main Code - DO NOT EDIT ANYTHING BELOW. Add your functions above displayWelcome() radius = 3.56 area = calcAreaCircle(radius) perimeter = calcPerimeterCircle(radius) print('Circle : area = {0:.2f}, perimeter = {1:.2f}'.format(area, perimeter)) side = 9.23 area = calcAreaSquare(side) perimeter = calcPerimeterSquare(side) print('Square : area = {0:.2f}, perimeter = {1:.2f}'.format(area, perimeter)) width = 2.9 height = 14.22 area = calcAreaRect(width, height) perimeter = calcPerimeterRect(width, height) print('Rectangle: area = {0:.2f}, perimeter = {1:.2f}'.format(area, perimeter)) base = 7.97 height = 5.31 area = calcAreaTriangle(base, height) print('Triangle : area = {0:.2f}'.format(area))
In: Computer Science
Open two windows in Ubuntu, and list the content of the /dev/fd folder. Can you explain the difference observed from the two windows? The name /dev/fd is actually a symbolic link to /proc/self/fd. The name self is also a symbolic link pointing to a number, which is the process ID of the current process. Therefore, the number pointed to by self is different if viewing from different windows.
In: Computer Science
URGENT PLZ - BASIC PYTHON
Use the following format for each of your files in the header.
# Name:
# Date:
# Description:
You programs should be FULLY COMMENTED.
Mr. Zapanta has locked himself out of his laptop and completely forgotten his password (the password is “cardinalcarter123” or “CardinalCarter123”). Write a program that generates a password entry. The program will display an appropriate message if Mr. Zapanta enters the wrong password. The program will allow a maximum of 5 tries to enter. If he exceeds 5 tries, the program will stop and display “Your laptop has been locked”. (5 marks Thinking) (Use a while loop)
Sample Output 1:
Enter the password: mr. zapanta
That is not the correct password! Try again.
Enter the password: cardinal carter
That is not the correct password! Try again.
Enter the password: ilovecompsci
That is not the correct password! Try again.
Enter the password: carter123
That is not the correct password! Try again.
Enter the password: chicken321!
That is not the correct password! You’ve reached the max number of tries.
Your laptop has been locked.
Sample Output 2:
Enter the password: mr. zapanta
That is not the correct password! Try again.
Enter the password: cardinalcarter123
Welcome, Mr. Zapanta.
In: Computer Science
B) DML and SQL Query
For this DB Schema, answer the below questions:
Employee (Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary,
Super_ssn, Dno)
Department (Dname, Dnumber, Mgr_ssn, Mgr_start_date)
5. Delete from Employee table, those who have First name:
James.
6. Delete from Employee table, those who have Salary more than
4000.
7. What happens if you try to delete one department?
8. Retrieve the data of all employee.
9. Retrieve the data of all male employee.
10. Retrieve the Fname, Lname of all male employee.
11. Retrieve the Fname, Lname and Salary of all employee
12. Retrieve the Fname, Lname and Salary of all employee with
Salary more than 4000
13. Retrieve the Fname, Lname and Salary of all female employee
with Salary more than 4000
14. Retrieve the Fname, Lname and Address of all female employee
with Salary more than 4000 and Birthdate after 1-1-1990.
15. Retrieve the Address and Salary of all employee with Fname =
John or James.
16. Retrieve the Address and Salary of all employee with Fname =
John or Birthdate after 1-1-1990
17. Retrieve the Name and Number of all Departments
18. Retrieve the Name and Number of all Departments with Manager
SSN=123456
19. Retrieve the Employee Fname, Lnameand Department number for all
employees.
20. Retrieve the Employee Fname, Lnameand Department number and
Department Name for all employees.
21. Retrieve the Employee Fname, Lnameand who works in Department
name = Research
22. Retrieve the Employee Fname, Lnameand who works in Department
name = Research and IT
23. Retrieve the Employee Fname, Lnameand who works in Department
name = Research OR IT
24. Retrieve the Department Name ,Number , Manager SSN
25. Retrieve the Department Name ,Number , Manager SSN, Manager
FName
26. Retrieve the Department Name, Manager SSN, Manager FName for
departments with Manager Start Date > 1-1-2010
please write it in computer word not pin and thank you
In: Computer Science
need algorithm not code otherwise will downvote 10
times use ms team or latex code or pdf only
Consider an n-node complete binary tree T, where n = 2d − 1 for
some d. Each node v of T is labeled with a real number xv. You may
assume that the real numbers labeling the nodes are all distinct. A
node v of T is a local minimum if the label xv is less than the
label xw for all nodes w that are joined to v by an edge.
You are given such a complete binary tree T, but the labeling is
only specified in the following implicit way: for each node v, you
can determine the value of xv by probing the node v. Show how to
find a local minimum of T using only O(logn) probes to the nodes of
T.
Note:- dont use handwritten image
In: Computer Science
This question concerns writing a Student class to model a
student's name, composed
of a first name, middle name and last name. The Student class
should meet the
following specification:
Class Student A Student object represents a student. A student has a first name, middle name and last name. Methods public void setNames(String first, String middle, String last) // Set the first, middle and last names of this Student object. public String getFullName() // Obtain the full name of this Student with the middle name converted to an initial only. |
2
Thinking of the problem in terms of testing, there are three
requirements that must be
met:
1. The setNames() method sets the names stored in the object i.e.
the values of
firstName, middleName, lastName.
2. The getFullName() method obtains the name of the student with
the middle name
converted to an initial only.
3. The getFullName() method does not change anything – i.e. it does
not modify the
values of firstName, middleName, lastName
HINT: To start your Student class, we suggest using the following
instance variables:
Instance variables
private String firstName;
private String middleName;
private String lastName;
In order to test the requirement above create a java class called
StudentTest that allows
the user to enter the first name, middle name and last name. These
values must be set
using the created set meothod and afterwards displays the
information back to the
console, however the Middle name is an initial ONLY
In: Computer Science
Complete Answer Must Compile in Visual Code in template Form Code, Must Reflect in UI.
1. Add a new text box - Mavenlink Project Name
2. Once we enter project name and project code , on tab change Mavenlink Project Name should be set as
Project Code - Project Name
Example :
Project Code = T1002
Project Name = TEST123
So in this case Mavenlink Project Name will be T1002 - TEST123
In: Computer Science
Write a program that does the following in order:
1. Asks the user to enter a name
2. Asks the user to enter a number “gross income”
3. Asks the user to enter a number “state tax rate”
4. Calculates the “Federal Tax”, “FICA tax” and “State tax”
5. Calculates the “estimated tax” and round the value to 2 decimal places
6. Prints values for “name”, “gross income” and “estimated tax”
The program should contain three additional variables to store the Federal tax, FICA tax, State tax, gross income, and estimated tax.
Federal Tax = gross income * 9.45%
FICA Tax = gross income * 7.65%
State Tax = gross income * your state tax percent
Estimated Tax = Federal tax + FICA tax + State tax
NOTE: Percentages must be converted to decimal values, for example:
15.9%=15.9*0.01=0.159
An example of the program’s input and output is shown below:
Enter your name: Belinda Patton
Enter your gross income: 53398.12
Enter your state income tax rate: 4.27
Tony Johnbull estimated tax is $11411.08 based on a gross income of $53398.12
In: Computer Science
1-Using the Note class and make it Comparable. A Note is larger than another note if it is higher in frequency. 2-In the driver program create a few objects and compare them . then create a list of those objects and sort them. 3. Rewrite the Note class so that a list of Notes is sorted first by length of note, then within that by frequency.
import java.io.*; import java.math.*; public class NoteTester { public static void main(String[] args) throws IOException { //Declare variables to hold user input double noteValue; String noteLength; int tempLength; //Create BufferedReader object wrapped with InputStreamReader to hold user input BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //Retrieve starting value from user System.out.println("Please enter a value for your note\n"+ "between -48 and 39:"); noteValue = Double.parseDouble(br.readLine()); //While loop ensures a valid number while(noteValue < -48 || noteValue > 39) { System.out.println("Please enter a valid value for your note\n"+ "between -48 and 39:"); noteValue = Double.parseDouble(br.readLine()); } //Retrieve starting length from user System.out.println("Please enter the number between 1-5\n" + "you would like to represent\n" + "the length of your note.\n"+ "1. Whole\n" + "2. Half\n" + "3. Quarter\n" + "4. Eighth\n" + "5. Sixteenth"); tempLength = Integer.parseInt(br.readLine()); //While loop ensures a valid length while(tempLength > 5 || tempLength < 1) { System.out.println("Please enter the number between 1-5\n" + "you would like to represent\n" + "the length of your note.\n"+ "1. Whole\n" + "2. Half\n" + "3. Quarter\n" + "4. Eighth\n" + "5. Sixteenth"); tempLength = Integer.parseInt(br.readLine()); } //If else statement assigns strings to the user's choice of int if(tempLength == 1) { noteLength = "whole"; } else if(tempLength == 2) { noteLength = "half"; } else if(tempLength == 3) { noteLength = "quarter"; } else if(tempLength == 4) { noteLength = "eighth"; } else if(tempLength == 5) { noteLength = "sixteenth"; } else { noteLength = "Invalid"; } //Create demoNote object Note demoNote = new Note(noteValue, noteLength); //Print user the information about their note System.out.print("Your value was " + demoNote.getValue() + ", your length was a(n) " + demoNote.getLength() + " note, your note's \nletter value was " + demoNote.getLetter() + " which is a " + demoNote.getSharp() + " note. \nThe frequency of your" + " note is " + demoNote.getFreq() + " hz." ); } } class Note { /*Declare variables privately so they cannot be accessed from outside the class. Set the value default to middle C and the length default to quarter.*/ private double value = 0; private String length = "Quarter"; private String letter; private String sharp; private double freq; /** * Constructor * @param value the note's starting value * @param length the note's starting length */ public Note(double value, String length) { this.value = value; this.length = length; } //Setters //Assigns this.value to variable value void setValue(double value) { this.value = value; } //Assigns this.length to variable length void setLength(String x) { this.length = length; } //Getters //@return The value of the note public double getValue() { return value; } //@return The length of the note public String getLength() { return length; } //@return The letter of the chromatic scale the value is assigned to public String getLetter() { if(value == 0 || value == 12 || value == 24 || value == 36 || value == -12 || value == -24 || value == -36 || value == -48) { letter = "A"; } else if(value == 1 || value == 13 || value == 25 || value == 37 || value == -11 || value == -23 || value == -35 || value == -47) { letter = "A#"; } else if(value == 2 || value == 14 || value == 26 || value == 38 || value == -10 || value == -22 || value == -34 || value == -46) { letter = "B"; } else if(value == 3 || value == 15 || value == 27 || value == 39 || value == -9 || value == -21 || value == -33 || value == -45) { letter = "C"; } else if(value == 4 || value == 16 || value == 28 || value == -8 || value == -20 || value == -32 || value == -44) { letter = "C#"; } else if(value == 5 || value == 17 || value == 29 || value == -7 || value == -19 || value == -31 || value == -43) { letter = "D"; } else if(value == 6 || value == 18 || value == 30 || value == -6 || value == -18 || value == -30 || value == -42) { letter = "D#"; } else if(value == 7 || value == 19 || value == 31 || value == -5 || value == -17 || value == -29 || value == -41) { letter = "E"; } else if(value == 8 || value == 20 || value == 32 || value == -4 || value == -16 || value == -28 || value == -40) { letter = "F"; } else if(value == 9 || value == 21 || value == 33 || value == -3 || value == -15 || value == -27 || value == - 39) { letter = "F#"; } else if(value == 10 || value == 22 || value == 34 || value == -2 || value == -14 || value == -26 || value == -38) { letter = "G"; } else if(value == 11 || value == 23 || value == 35 || value == -1 || value == -13 || value == -25 || value == -36) { letter = "G#"; } else { letter = "invalid"; } return letter; } //@return Whether or not the note is sharp public String getSharp() { if(value == 1 || value == 13 || value == 25 || value == 37 || value == -11 || value == -23 || value == -35 || value == -47 || value == 4 || value == 16 || value == 28 || value == -8 || value == -20 || value == -32 || value == -44 || value == 6 || value == 18 || value == 30 || value == -6 || value == -18 || value == -30 || value == -42 || value == 9 || value == 21 || value == 33 || value == -3 || value == -15 || value == -27 || value == - 39 || value == 11 || value == 23 || value == 35 || value == -1 || value == -13 || value == -25 || value == -36) { sharp = "sharp"; } else { sharp = "natural"; } return sharp; } //@return The frequency of the note public double getFreq() { freq = (440 * Math.pow(2, value / 12)); return freq; } }
In: Computer Science
The UA record app can provide personalised advices to a specific user by collecting and analysing personal data. Please list one example for each of the following data types, categorical, ordinal and numerical, in the context of the case study. [5 marks]
2. The UA Record app collects the data from a lot of users, and thereby the backend system can do trend analysis over these data. However, the data could be collected through different versions of different devices and apps, in different countries, at real time by sensors or manually. What kind of data quality issues do you think there could exist? Please list at least three different data quality issues and briefly explain them. [5 marks]
In: Computer Science
Discuss how you would set up control measures in your organization or even your home? What considerations must you include in your risk analysis? How do those differ when analyzing risk for hardware, software, and cloud services?
In: Computer Science
Situation (Data Structures and Sorting C++)
You have been employed at BmoCel, an internet service provider.
Data is sent as packets from their
server to their clients. Each packet has a fixed size of 16
alphanumeric characters. However, they are
currently having problems with managing their data transmissions.
Your bosses have asked you to
rectify the problem
The client manages the packets in a First‐In, First‐Out manner. Due to transmission limitations of the client, only 8 packets can be transmitted in the transmission pipeline at any given time. If another packet is to be transmitted, the first packet that was transmitted will be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LjdpyOBdhM9tSQz
yw3WDQbeSkk5Cu2A
yy7ZuOAnTkjkmStU
z0okwHZXCJQLpbxn
zXHrwXca5XKzFuLc
zkvwe94xoV58JRyk
zuCqRmtzhcwiXJ1U
In: Computer Science
To create a home budget, you want to find out your net income,
which is your income minus your expenses.
Write a Java method that takes an input string and computes the
income minus the expenses.
The income components are indicated by numbers; while the expenses
from your spending are numbers starting with a minus sign
'-'.
The input string may contain lowercase and uppercase letters, as
well as other characters.
Note that Character.isDigit(char) tests if a char is one of the
chars '0', '1', ..., '9'. Also recall that Integer.parseInt(string)
converts a string to an int.
Test cases :
calcNetIncome("salary 15000yuan bonus2000 rent -1000Y") →
16000
calcNetIncome("25000 gross income, -200 water, electricity:-300") →
24500
In: Computer Science