Answer:
The solution code is written in Python.
<u>First version (user input through terminal)</u>
- food_price = float(input("Enter food price: "))
- sales_tax = food_price * 0.07
- tips = food_price * 0.15
- total_cost = food_price + sales_tax + tips
- print("Food price: $" + str(food_price))
- print("Sale tax: $" + str(sales_tax))
- print("Tips: $" + str(tips))
- print("Total cost: $" + str(total_cost))
- print("\n")
<u>Second version (input from text file)</u>
- with open("text.txt") as file:
- data = file.readlines()
- for r in data:
- food_price = float(r)
- sales_tax = food_price * 0.07
- tips = food_price * 0.15
- total_cost = food_price + sales_tax + tips
- print("Food price: $" + str(food_price))
- print("Sale tax: $" + str(sales_tax))
- print("Tips: $" + str(tips))
- print("Total cost: $" + str(total_cost))
- print("\n")
Explanation:
<u>First version</u>
In the first version of code, we can create all the necessary variables to hold the value of food price, sales tax, tips and total cost (Line 1 -4). Please note we get the food price using the input() function to prompt user to enter the value through terminal (Line 1).
Next display the values using print() function (Line 5 - 8)
<u>Second version</u>
The second version of code is similar to the first version except that we need to change the code to accept input from a text file (Line 1 -2) instead of using the input function.
We presume there might be multiple values in the text file and therefore it is recommended to use readlines() method to get the value line by line from the text file (Line 2) and use for loop to traverse through each row of food price value and calculate the sales tax, tips and total cost (Line 4-7).
If the hard drive has nothing in it then nothing, if it has any other operating system, make a partition, and install it through dual booting.
You can use it when like confirming a policy
Answer:
C
Explanation:
Scanner and Keyboard are input device.
Answer:
SLE = AV * EF, is the correct answer for the above question. Where SLE refers the "Single loss expectancy", AV refers to the "asset value" and EF refers to the "exposure factor".
Explanation:
- Risk management is used to identify the risk in any project. When the project is going to develop then there is a need to identify the risk which comes under the development of the project.
- The above-defined formula is related to risk management which concludes about the asset risk in any project.
- The asset is a term that can be called for the physical or logical resources of the organization.