1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pepsi [2]
2 years ago
9

I have no idea what I’m doing but this is for a class grade and also on Replit Please Help!!

Computers and Technology
1 answer:
Tatiana [17]2 years ago
3 0

Answer:

I've compiled some code below to help you out ;)

Explanation:

# Program make a simple calculator

# This function adds two numbers

def add(x, y):

   return x + y

# This function subtracts two numbers

def subtract(x, y):

   return x - y

# This function multiplies two numbers

def multiply(x, y):

   return x * y

# This function divides two numbers

def divide(x, y):

   return x / y

print("Select operation.")

print("1.Add")

print("2.Subtract")

print("3.Multiply")

print("4.Divide")

while True:

   # take input from the user

   choice = input("Enter choice(1/2/3/4): ")

   # check if choice is one of the four options

   if choice in ('1', '2', '3', '4'):

       num1 = float(input("Enter first number: "))

       num2 = float(input("Enter second number: "))

       if choice == '1':

           print(num1, "+", num2, "=", add(num1, num2))

       elif choice == '2':

           print(num1, "-", num2, "=", subtract(num1, num2))

       elif choice == '3':

           print(num1, "*", num2, "=", multiply(num1, num2))

       elif choice == '4':

           print(num1, "/", num2, "=", divide(num1, num2))

       

       # check if user wants another calculation

       # break the while loop if answer is no

       next_calculation = input("Let's do next calculation? (yes/no): ")

       if next_calculation == "no":

         break

   

   else:

       print("Invalid Input")

I got it from this link, https://www.programiz.com/python-programming/examples/calculator

You might be interested in
What did Francis Ford Coppola and George Lucas create?
garik1379 [7]
. 3d animation markers
7 0
3 years ago
It's a holiday poop in my bitt
Zina [86]

Answer:

bitt

Explanation:

pp

4 0
3 years ago
Read 2 more answers
Cui documents must be reviewed to which procedures before destruction?
Aliun [14]

Answer:

Documents containing CUI must be destroyed by shredding..

Explanation:

Hope it helps you..

Your welcome in advance..

(ㆁωㆁ)

8 0
3 years ago
You and a few friends are having a meal at a pizza restaurant, and the server has just given you the bill. Write a function that
cestrela7 [59]

Answer:

How to calculate the total cost of the meal

For bill inclusive of tax, cost1=cost*(1+tax percentage)

For bill inclusive of tax and tip, cost2=cost1*(1+tip percentage)

Meal cost =(pizza cost*(1+tax percentage))*(1+tip percentage)

Now how to calculate the cost per person

cost per person=meal cost/ number of people.

C language code to solve the above problem is given below with appropriate comments for explanation

Explanation:

#include<stdio.h>

float split_bill(int cost,float tax)

{

//Declaring number of people as int

int number;

//Prompting for number of people

printf("Enter number of people ");

scanf("%d",&number);

//Declaring tip percentage as float

float tip_percent;

//Prompting for tip percentage

printf("Enter tip percentage between 0 and 1 ");

scanf("%f",&tip_percent);

//Calculating total meal cost

float meal=(((float)cost)*(1+tax))*(1+tip_percent);

//Printing total cost of meal

printf("Total cost of meal: %0.2f ",meal);

//Calculating cost per person

float cost_per_person=meal/number;

//Returning cost per person to main function

return cost_per_person;

}

int main()

{

//Declaring pizza cost as int and tax percentage as float

int pizza_cost;

float tax_percent;

//Prompting user for pizza cost

printf("Enter billing amount of pizza ");

scanf("%d",&pizza_cost);

//Prompting user for tax percentage

printf("Enter tax percentage between 0 and 1 ");

scanf("%f",&tax_percent);

//Printing the cost per person by calling the function split_bill

printf("Total cost per person is: %0.2f ",split_bill(pizza_cost,tax_percent));

return 0;

}

8 0
3 years ago
On a leading-trailing system technician A says that both shoes do equal work when stopping while going in reverse. Technician B
sleet_krkn [62]

Based on the scenario above about the leading-trailing system Both technician A and B are incorrect.

<h3>How many brake shoes function?</h3>

There are known to be two shoes function that are said to be working a way where both become either the trailing shoe or leading shoe based on whether the vehicle is moving forward or backward.

Therefore we can say that, Based on the scenario above about the leading-trailing system Both technician A and B are incorrect.

Learn more about trailing system from

brainly.com/question/14367881

#SPJ1

5 0
2 years ago
Other questions:
  • Using a loop, write a program that reads in exactly five integers and outputs the sum.
    11·1 answer
  • WILL MARK BRAINLIEST HELP
    8·2 answers
  • The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
    14·1 answer
  • Can anyone please help with this programming code in python num= 7 if num &gt; 3: print(“3”) if num &lt; 5: print(“5”) if num ==
    6·1 answer
  • Which is the best programming practice?
    6·1 answer
  • What should you do to help prepare yourself for the delivery of your presentation? you can chose more then one
    8·1 answer
  • What is the IP address and TCP port number used by the client computer (source) that is transferring the file to gaia.cs.umass.e
    9·1 answer
  • Need answer ASAP.
    8·1 answer
  • define the term computer hardware and its various types mentioning 5 examples of IP or devices with one diagram each​
    9·1 answer
  • Simple interest will always pay more interest than compound interest.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!