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:
a thing that happens or takes place, especially one of importance.
Answer:
chemlab1.doc stored in biology folder which stored in folder studies which stored in mydocs folder which is in C local disk
Explanation:
Answer:
length = float(input("Enter length of the backyard in foot: "))
width = float(input("Enter width of the backyard in foot: "))
sod_price = float(input("Enter the price of sod per square foot: "))
fencing_price = float(input("Enter the price of fencing per foot: "))
area = length * width
perimeter = 2 * (length + width)
cost = sod_price * area + fencing_price * perimeter
print("The cost of landscaping is $" + str(cost))
Explanation:
*The code is in Python.
Ask the user to enter the length, width, sod_price, and fencing_price
Calculate the area and perimeter of the backyard
Calculate the cost, sod_price * area + fencing_price * perimeter
Print the cost
Answer:
The program to this question can be describes as follows:
Program:
#include <stdio.h> //defining header file
int main() //defining main method
{
int n,i,x=0; //defining integer variable
printf("Enter a number: "); //print message
scanf("%d",&n); //input value from the user
printf("%d\n",n); //print input value
for(i=1;i<n;i++) //loop to count reverse number
{
x=n-i; //calculate value
printf("%d\n",x); //print value
}
return 0;
}
Output:
Enter a number: 3
3
2
1
Explanation:
- In the above program, three integer variable "n,i and x" is declared, in which variable n we take input from the user end and the variable i and x is used in the loop to calculate the value in the reverse order.
- In the next step, a loop is declared, in which the variable x calculates the value in reverse order and uses a print method to print its value.