Answer:
1) Execute Shell Script Using File Name. Use the shell script file name to execute it either by using it's relative path or absolute path as shown below
2) Execute Shell Script Using Source Command.
Answer:
bill = float(input("Enter the bill amount: "))
rating = int(input("Choose a rating: 1 = Totally satisfied, 2 = Satisfied, 3 = Dissatisfied.: "))
if rating is 1:
tip = bill * 0.2
elif rating is 2:
tip = bill * 0.15
elif rating is 3:
tip = bill * 0.1
print("The rating is: " + str(rating))
print("The tip is: $%.2f" % (tip))
Explanation:
*The code is in Python
- Ask the user for the <em>bill</em> and <em>rating</em>
- Depending on the <em>rating</em>, calculate the <em>tip</em> using <u>if else</u> statement i.e. If the rating is chosen as 1, calculate the tip by taking 20 percent of the bill.
- Print the <em>rating</em> and the <em>tip</em>
Use ctrl + or - or if in microsoft word, use the zoom tool
Answer:
Monitor backlighting
Explanation:
Dylan haven done some troubleshooting on his computer to find out what the problem was but couldn't restore its brightness.
It then means that the Monitor backlighting caused the screen to be very dim.
The Monitor backlighting is bad or faulty.
Answer:
def main():
# Accept data from the user
n=int(input('Enter the value of n:'))
k=2;
sum=0
print('The list of the prime numbers are as follows:')
# This loop runs from k to n
while k<=n:
# Call is_prime() method,
# to check whether k is a prime or not
sum=sum+is_prime(k)
k=k+1
print('Sum of the prime numbers:',sum)
# is_prime() Method
def is_prime(k):
prime=0
i=1
# Check k is a prime or not
while i<=int(k):
# Find the factors of k
if (k % i) == 0:
prime=prime+1
i=i+1
# If k as two factors
if(prime==2):
print(k)
return k;
# If k as more than two factors
else:
return 0;
# Call the main() method
main()
Explanation: