Answer:
Written in Python
G = 6.673 *pow(10,-11)
M = 5.98 *pow(10,24)
d = float(input("Distance: "))
g = (G * M)/(pow(d,2))
print("Acceleration of gravity: "+str(g))
Explanation:
This line initializes the gravititational constant
G = 6.673 *pow(10,-11)
This line initializes the mass of the earth
M = 5.98 *pow(10,24)
This line prompts user for object distance
d = float(input("Distance: "))
This line calculates the object's gravity
g = (G * M)/(pow(d,2))
This line prints the calculated gravity without approximating
print("Acceleration of gravity: "+str(g))
Answer:
a. grep 'b[au]nk$' myLine
Explanation:
grep is a command used for searching a specified pattern in a given text.
Our goal is to match the character sequence - bank or bunk at the end of line in a given line referenced by myLine.
The regular expression for the specified match criterion is:
b[au]nk$
The second character can be either a or u.
$ indicates match at end of line.
So the overall grep command is :
grep 'b[au]nk$' myLine