In: Computer Science
CODE IN PYTHON
1. Write a program that asks the user for the number of slices of pizza they want to order and displays the total number of dollar bills they owe given pizza costs 3 dollars a slice. Note: You may print the value an integer value.
2. Assume that y, a and b have already been defined, display the value of x:
x = ya+b
3. The variable start_tees refers to the number of UD T-shirts at the start of New Student Orientation (NSO) and dist_tees refers to the number of UD T-shirts distributed to students at NSO. Write an expression that calculates the total number of UD T-shirts left after NSO and assign it to the variable end_tees.
Note: you should NOT assign values to start_tees and dist_tees! It will be assigned before your code is run!
4. Write a program that asks the user for the number of slices of pizza they want to order and displays the total number of dollar bills they owe given pizza costs 3 dollars a slice. Note: You may print the value an integer value.
Answer: here is the answer for your question :
part 1 & 4) since , your part 1 and 4 are same. i will answer it only once as both are same questions:
here in the python code :
---------------------------------------------------------------------------------------------------------------------------------------
print("PIZZA BILLING PROGRAM!!!!")
no_of_slices=int(input("Enter the number of slices that you want to
order:"))#taking input from user
print("your total bill for pizza is {} dollar
".format(no_of_slices*3))#printing output to the screen
----------------------------------------------------------------------------------------------------------
CODE SNIPPET AND OUTPUT:
------------------------------------------------------------------------------------------------------
Part 2)
python code:
---------------------------------------------------------------------------------------------------------------------------------------
print("PART 2")
a=10
b=8
y=5
x=y*a+b #assign value to x
print("value of y is {}".format(y))#printing value to console
---------------------------------------------------------------------------------------------------------------------------------------
CODE SNIPPET AND OUTPUT:
PART 3:
python code:
---------------------------------------------------------------------------------------------------------------------------------------
print("PART 3")
start_tees=int(input("Enter no of t-shirts at starting:"))#geting
input for start tees from user
dist_tees=int(input("Enter no of t-shits that are distributed:
"))#geting input for dis_tees from user
end_tees=start_tees-dist_tees
print("no fo tees remaining after distribution is
{}".format(end_tees))#printing value to console
---------------------------------------------------------------------------------------------------------------------------------------
CODE SNIPPET AND OUTPUT:
-------------------------------------------------------------------------------------------------------------------------------------------
I hope this would help you out
If you have any doubt, you can provide comment /feedback below the answer
Thanks