Answer:
C. Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.
Explanation:
Byte pair encoding is a form of encoding in which the most common pairs of consecutive bytes of data are replaced by a single byte which does not occur within the set of data.
For example, if we has a string ZZaaAb, it can be encoded if the pairs of string ZZ are replaced by X and the second pair by Y. So, our data now becomes XYAb.
To get our original data, that is decode it, we just replace the data with the keys X = ZZ and Y = aa thus allowing our original data to be restored.
Since our original string is restored without loss of data, it implies that <u>byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.</u>
Answer:
no_of_shares = int(input("Enter the number of shares: "))
purchase_price = float(input("Enter the purchase price of the stock: "))
sale_price = float(input("Enter the sale price of the stock: "))
total_stock_price = purchase_price*no_of_shares
total_spend_on_buying = total_stock_price + (0.03*total_stock_price)
total_sale_price = sale_price*no_of_shares
commission_while_selling = total_sale_price*0.03
net_gain_or_loss = total_sale_price - (total_spend_on_buying + commission_while_selling)
if(net_gain_or_loss<0):
print("After the transaction, you lost {} dollars".format(abs(net_gain_or_loss)))
else:
print("After the transaction, you made {} dollars".format(abs(net_gain_or_loss)))
Answer:
//class Name
class Name {
// attributes gave you 3
String first_name;
String last_name;
int length = 0;
//constructor with 2 parameters
Name(String first_name, String last_name){
}
//methods
public String find_printed_name(){
return first_name + " " + last_name;
}
public void find_sortable_name(){
return last_name + ", " first_name.charAt(0);
}
public static void main(String[] args){
// instantiate the class
Name test_name = new Name("David", "Joyner");
System.out.println(test_name.first_name);
System.out.println(test_name.last_name);
System.out.println(test_name.find_printed_name());
System.out.println(test_name.find_sortable_name());
}
Explanation:
You didn't specify a language so I did it in Java.
You should know how to declare methods in Python.
Answer:
Phishing means cyber theft in which the cyber thief sends the target PC a malicious email, which looks like coming from some known source, and they ask for certain critical information, which must not be leaked. Similarly, In ransomware, they send the phishing email with malicious code, and they hack the computer system. They then ask for a ransom as a return for reactivating your PC. Distributed Denial of service attack happens when the traffic flood the bandwidth and the resources of a PC, and finally a lot of are denied of access to them. Ransomware, when it attacks a bank account, becomes a Denial of service attack, as multiple users are stopped from accessing their account. All of these are hence, almost the same and revolves around the phishing email.
Explanation:
Please check the answer.