Idk what language so this is java
int count_occurrences(String a, String b) {
int count = 0;
for(int i =0; iif(a.charAt(i) == b.charAt(0)) {
count++;
}
}
return count;
}
The data that a function takes in is called an argument.
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))
1. Digital Electronics: An Introduction To Theory And Practice by William Gothmann H