The python program allows the user to enter the Sales amount and Actual cost of a Product. Next, Python calculates the Loss Amount or profit Amount based on those two values using if-elif-else Statement
Write Pseudocode and draw flow chart of the following problem . The python program allows the user to enter the Sales amount and Actual cost of a Product. Next, Python calculates the Loss Amount or profit Amount based on those two values using if-elif-else Statement. Answer- Pseudocode Input the Actual cost of Product Input the Sales Amount if(actual_cost > sale_amount): amount = actual_cost - sale_amount print("Total Loss Amount") elif(sale_amount > actual_cost): amount = sale_amount - actual_cost print("Total Profit ") else: print("No Profit No Loss!!!") Flow chart- Python Code- #Input Actual cost of Product actual_cost = float(input(" Please Enter the Actual cost of Product:")) # Input Sales Amount sale_amount = float(input(" Please Enter the Sales Amount: ")) #calculate Loss Amount if(actual_cost > sale_amount): amount = actual_cost - sale_amount print(...
Comments
Post a Comment