Cloud computing allows computers from all around the world that are not being used to be able to do extra computations. This removes many of the limitations of a single computer and lets the user calculate things much faster.
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)))
In terms of music taking one song and incorporating it into your own song
Answer:
def fizzbuzz (num):
for item in range(num):
if item % 2 == 0 and item % 3 == 0:
print("fizzbuzz")
elif item % 3 == 0:
print("buzz")
elif item % 2 == 0:
print("fizz")
else:
print (item)
fizzbuzz(20)
Explanation:
Using Python programming Language
Use a for loop to iterate from 0 up to the number using the range function
Within the for loop use the modulo (%) operator to determine divisibility by 2 and 3 and print the required output
see attached program output screen.
Answer:
The value variable will contain the lowest value in the numbers array.
Explanation:
Given
The given code segment
Required
The result of the code when executed
The illustration of the code is to determine the smallest of the array.
This is shown below
First, the value variable is initialized to the first index element
int value = numbers[0];
This iterates through the elements of the array starting from the second
for (int i = 1; i < numbers.length; i++) {
This checks if current element is less than value.
if (numbers[i] < value)
If yes, value is set to numbers[i]; which is smaller than value
value = numbers[i];
<em>Hence, the end result will save the smallest in value</em>