Answer:
Here is the Python program:
COOKIES_PER_BAG = 40 #sets constant value for bag of cookies
SERVINGS_PER_BAG = 10 #sets constant value for serving in bag
CALORIES_PER_SERVING = 300 #sets constant value servings per bag
cookies = int(input("How many cookies did you eat? ")) #prompts user to input how many cookies he or she ate
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG)); #computes total calories consumed by user
print("Total calories consumed:",totalCalories) #displays the computed value of totalCalories consumed
Explanation:
The algorithm is:
- Start
- Declare constants COOKIES_PER_BAG, SERVINGS_PER_BAG and CALORIES_PER_SERVING
- Set COOKIES_PER_BAG to 40
- Set SERVINGS_PER_BAG to 10
- Set CALORIES_PER_SERVING to 300
- Input cookies
- Calculate totalCalories: totalCalories ← cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG))
- Display totalCalories
I will explain the program with an example:
Lets say user enters 5 as cookies he or she ate so
cookies = 5
Now total calories are computed as:
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG));
This becomes:
totalCalories = 5 * (300/40/10)
totalCalories = 5 * (300/4)
totalCalories = 5 * 75
totalCalories = 375
The screenshot of program along with its output is attached.
If a headset plugged into computer is not working properly than one can go for updating the device driver. The correct option is B.
<h3>What is a device driver?</h3>
A device driver is a type of software application that allows one hardware device (such as a computer) to communicate with another hardware device (such as a printer). A device driver is indeed referred to as a software driver.
A driver, also known as a device driver, is a collection of files that instructs a piece of hardware on how to operate by communicating with a computer's operating system.
Every piece of hardware, from internal computer components like your graphics card to external peripherals like a printer, requires a driver.
If a headset plugged into a computer is not working properly, the device driver can be updated.
Thus, the correct option is B.
For more details regarding device driver, visit:
brainly.com/question/14054807
#SPJ12
Properties is the information about the file
Answer:
TCP
Explanation:
Transmission control protocol ensures packets loss and performs retransmission
TCP works with Internet Protocol (IP)
TCP/IP defines how computers send data packets to each other.
TCP allows transmission of information in both the direction.
Bit rate :defines the rate at which bits are transferred from one place to another