Answer:
Time Complexity of Problem - O(n)
Explanation:
When n= 1024 time taken is t. on a particular computer.
When computer is 8 times faster in same time t , n can be equal to 8192. It means on increasing processing speed input grows linearly.
When computer is 8 times slow then with same time t , n will be 128 which is (1/8)th time 1024.
It means with increase in processing speed by x factor time taken will decrease by (1/x) factor. Or input size can be increased by x times. This signifies that time taken by program grows linearly with input size n. Therefore time complexity of problem will be O(n).
If we double the speed of original machine then we can solve problems of size 2n in time t.
Answer:
#here is code in python.
# read the food bill
tot_bill=float(input("Please enter the food bill:"))
# tax on food
tax=0.06
#choice for tip by user
choice=int(input("enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)"))
// calculate the total food bill
if choice==1:
tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.15)
elif choice==2:
tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.18)
elif choice==3:
tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.2)
else:
print("invalid choice:")
#print the total food bill
print("total food bill is ",tot_food_bill)
Explanation:
Read the food bill from user and assign it to variable "tot_bill".Initialize the tax=0.06 (i.e. 6%) on the bill.Then ask user to give his choice for tip. if the choice is 1 then tip will be 15%, if 2 then 18% and if choice is 3 Then tip will be 20% of the bill.Calculate the total food bill and assign it to variable "tot_food_bill".
Output:
Please enter the food bill:100
enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)2
total food bill is 124.0
Answer: 83.17
Explanation:
By definition, the dB is an adimensional unit, used to simplify calculations when numbers are either too big or too small, specially in telecommunications.
It applies specifically to power, and it is defined as follows:
P (dB) = 10 log₁₀ P₁ / P₂
Usually P₂ is a reference, for instance, if P₂ = 1 mW, dB is called as dBm (dB referred to 1 mW), but it is always adimensional.
In our question, we know that we have a numerical ratio, that is expressed in dB as 19.2 dB.
Applying the dB definition, we can write the following:
10 log₁₀ X = 19.2 ⇒ log₁₀ X = 19.2 / 10 = 1.92
Solving the logarithmic equation, we can compute X as follows:
X = 10^1.92 = 83.17
X = 83.17
Answer:
//here is code in java.
import java.util.*;
class Solution
{
// main method of class
public static void main (String[] args) throws java.lang.Exception
{
try{
// declare an initialize first string variables
String st1="hello";
// declare an initialize first string variables
String st2="world";
// create another string variable
String st3;
// exchange the value of both string variables
st3=st1;
st1=st2;
st2=st3;
System.out.println("value of first String after exchange: "+st1);
System.out.println("value of second String after exchange: "+st2);
}catch(Exception ex){
return;}
}
}
Explanation:
declare and initialize two string variables.Create another string variable "st3". first assign value of "st1" to "st3" after then value of "st2" to "st1" and then assign value of "st3" to "st2". This will exchange the values of both the string.
Output:
value of first String after exchange: world
value of second String after exchange: hello
D. <span>You have just used the Undo function to delete a paragraph, and you want that paragraph back.</span>