Following are the program to calculate the power of two:
Program Explanation:
- Defining an integer variable "i" that hold an integer value.
- Defining a for loop that checks "i" value in between 20, inside this it calculates power of two.
- At the last use print method to print its value.
Program:
i=1#holding integer value in i
for i in range(20):#defining a for that starts 1 to 20
i = 2 ** i#calculate power of 2 in i variable
print(i)#print value
Output:
Please find the attached file.
Learn more:
brainly.com/question/23170807
Answer:
b) public static double calcShippingCost(double weight) { double cost; if(weight < 10) { cost = 10.0; }else{ cost = 15.5; } cost = cost + calcTax(cost); return cost; }
The method is called twice with arguments 7.5 and 17.5 respectively.
Explanation:
The Java program defines three user methods including the main. In the main, the calShippingCost method is called twice with 7.5 and 17.5 respectively to return double number values to cost1 and cost2.
Answer:
d. refresh
Explanation:
The Excel software does not allow a user to change values/data directly in the Pivottable. You will get an error message like "Cannot change this part of a PivotTable report" when you try to type data directly. You will have to edit the Excel Table and then refresh to reflect the updated data.
Answer:
B) recipient subject body signature
Answer:
value=int(input("Enter the value from where the user wants to starts: "))#Take the value from the user.
i=1#intialize the value of a variable by 1.
while(value<1000) and (i<9):#while loop which prints the value.
print(value,end=" ")# print the value.
value=value*2#calculate the value to print.
i=i+1#calculate the value for the count.
Output:
If the user enter 5, then the output is : "5 10 20 40 80 160 320 640".
If the user enter 5, then the output is : "3 6 12 24 48 96 192 384".
Explanation:
- The above code is in python language, in which the first line of the program is used to render a message to the user, take the input from the user and store it into value variable after converting it into an integer.
- Then the loop will calculate the double value and then it prints the value with the help of print function.
- The end function puts the spaces between numbers.