Answer:
G = 6.673e-11
M = 5.98e24
accel_gravity = 0.0
dist_center = float(input())
accel_gravity = (G * M) / (dist_center * dist_center)
print('Acceleration of gravity: {: .2f}'.format(accel_gravity))
Explanation:
The G, M, and accel_gravity are already initialized
The user is asked to enter the dist_center which is the only missing thing in the formula
In order to calculate the accel_gravity, you just need to put the variables in the formula (Note that the formula is (G*M)/(d^2), not d)
Then, the calculated value of accel_gravity is printed
These are files called cookies. =)
Answer:
Go to explaination for the step by step answer.
Explanation:
a)Code
function[y]=operation(x) % this function takes x as input and returns y as output
y=(-0.2*x^3+7*x^2)*exp(-0.3*x)
end
% call this function in command widow by typing operation(value of x) like shown in figure in the first attachment.
b. write a code of above function in one script window and save the code with same name as name of function that is name of script should be saved as operation.Now copy paste the below code in new script window and run the code
clc
clear all
x=-2:.1:6
n=length(x)
for i=1:1:n
a=x(i)
y(i)=operation(a)
end
plot(y,x)
xlabel('X')
ylabel('Y')
Please kindly check attachment for pictorial answers that supports the code.
The solution is to keep all values in the Function Call Stack until the stack is empty. When the stack is empty, place all held items at the bottom of the stack one by one.
What is Recursive Function?
Recursive functions in code frequently rely on loop setups, in which the initial variable is called on multiple times while the loop is changing it. The factorial is a simple example of a recursive function in which an integer is multiplied by itself while being incrementally lowered. Many other self-referencing functions in a loop, for example, where n = n + 1 given an operating range, could be called recursive functions.
In addition to simpler recursive functions, programmers and others have created much more complex functions that also use recursion principles. Some, such as the Fibonacci sequence, have applications in finance and other fields, while others are esoteric and largely restricted to the IT community.
To learn more about Recursive Function, visit: brainly.com/question/28540529
#SPJ4
Answer:
<h2>Following are the java script code for the above question. </h2>
Explanation:
Program :
var percentage= prompt("Enter the percentage of the student"); // take the input from the user.
if(percentage>=90)//check condition for greator than 90.
alert("your grade is \"A\"");
else if(percentage>=80) // check condition for 80 and 89.
alert("your grade is \"B\"");
else if(percentage>=70) // check condition for 70 and 79.
alert("your grade is \"C\"");
else if(percentage>=60) // check condition for 60 and 69.
alert("your grade is \"D\"");
else // check condition for less than 60.
alert("your grade is \"F\"");
Output:
- If the user input 60, it will prints D.
- If the user inputs 59, it will prints f.
Code Explanation:
- The above code is in a javascript language, In which the first line is used to display the message and take the input from the user in the alert box.
- Then the percentage is checked by the help of in if, else if and else statement and print the grade.
- Then the grade is printed with the help of an alert box.