c. would be the best answer.
Answer:
Follows are the code to the given question:
def steps_to_miles(user_steps):#defining a method steps_to_miles that takes a variable user_steps
return user_steps/2000#use return to calculate the steps
user_steps = int(input())#defining a variable user_steps that holds value from the user-end
print('%0.2f' % steps_to_miles(user_steps))#defining print that calls the steps_to_miles method
Output:
5345
2.67
Explanation:
In this code a method "steps_to_miles" that takes "user_steps" in the parameter inside the method a return keyword is used that calculates the user steps and return its values.
Outside the method, a "user_steps" variable is declared that inputs the value from the user-end pass into the method and prints its value.
Explanation:
Object Oriented Programming (OOPS or OOPS for Object Oriented Programming System) is the most widely used programming paradigm today. While most of the popular programming languages are multi-paradigm, the support to object-oriented programming is fundamental for large projects. Of course OOP has its share of critics. Nowadays functional programming seems the new trendy approach. Still, criticism is due mostly to misuse of OOP.
Answer:
The code for this class is shown in the explanation section
Explanation:
public class Circle {
private double radius;
private double diameter;
private double area;
public Circle(double radius, double diameter, double area) {
this.radius = 1;
this.diameter = diameter;
this.area = area;
}
public void setRadius(double radius) {
this.radius = radius;
diameter = radius*2;
area= Math.PI*(radius*radius);
}
public double getRadius() {
return radius;
}
}