A pedometer treats walking 2,000 steps as walking 1 miles. Define a function name StepsToMiles that takes an integer as a parameter, representing the numbers of steps, and returns a float that represents the number of miles walked. Then, write a main program that reads the number of steps as an input, calls function StepsToMiles() with the inputs as an argument, and outputs the miles walked.
Q: Write a Python program that inputs five positive integer numbers, finds their maximum and sort them…
A: please find the answer below
Q: Write a python program that takes in name and pay rate and the number of hours worked in a week by…
A: Algorithm : main function() Step 1 : setting number of persons(3) to a variable. Step 2 : declaring…
Q: In the real world, functions are mathematical representations of input-output situations. A vending…
A: We define the following variables: Weekly Salary = WSalary Hourly Pay Rate = HPayRate Number of…
Q: write a program that simulates coin tossing. for each toss of the coin the program should print…
A: For simulating tossing of a coin using java program, following steps can be followed: Import the…
Q: Write a Python program that calculates the brightness of a star, given its distance, from the…
A: I have mentioned my code in step 2.
Q: Write a function that takes a DrawingPanel as a parameter and draws the horizontal pyramid shape as…
A: from tkinter import *WIDTH = 300HEIGHT = 200N_RECT = 10class DrawingPanel: def __init__(self,…
Q: IN python, • generate_number(pct_per_digit): Takes one float as input. Returns a random number that…
A: Coded using Python -
Q: Write a program that calculates the potential energy of 3 charges q1 = 1, q2 = 2, q3 = 3 located at…
A: For the given points (1, 2, 3), (3, -4, -5) and (-4, 2, -6) The rij is the distance between charges…
Q: Write a Python program that inputs five positive integer numbers, finds their maximum and sort them…
A: Required:
Q: Implement a function priceTShirt in Python that computes and returns the price of a T-shirt. The…
A: Python code for the given question :- def priceTshirt(size, slogan): price = 0 # add base…
Q: Illustrating your answer using the buggy code below, explain in your own words what it means for…
A: A variable is said to be local when it's declared within body of method.
Q: Write a Python function that takes an Integer number, N (num of triangles), and string which…
A: def findMaxArea(N,values): #Defining function findMaxArea with N and string parameter values…
Q: Write a Python program that converts miles to kilometers and kilometers to miles. The user will…
A: logic:- take choice input from user. pass it to function, and do conversion as per the above…
Q: I need assistance with writing the below in Python. Toll roads have different fees based on the…
A: Solution: Given, Weekday Tolls Before 7:00 am ($1.15) 7:00 am to 9:59 am ($2.95) 10:00 am to…
Q: Write a program that automates the table used by a surveyor to transform compass headings in degrees…
A: compass_heading=float(input("Please enter the Compass heading in Degrees from 0 to 360: "))…
Q: Write a Python program that will input three integers numbers, computes their average and sort them…
A: #getValue function def getValue(msg): return map(int,input(msg+": ").split()) #ascsortNavg…
Q: Write a Python function that takes an Integer number, N (num of triangles), and string which…
A: Algorithm : Step 1 : split the string into my_list. Step 2 : create empty lists for heights ,…
Q: A pedometer treats walking 1 step as walking 2.5 feet. Define a function named feet_to_steps that…
A: - We need to code the provided feet to step conversion in python.
Q: Write a program which will take marks of three quizzes as input, then call a function void…
A: Program Plan:- Initialize the header files. Take the marks of the quizzes from the user. pass them…
Q: A pedometer treats walking 1 step as walking 2.5 feet. Define a function named feet_to_steps that…
A: Answer :
Q: Write a function print_daily_totals(rainfalls) that prints the total rainfall for each day of…
A: #note no programming language is mentioned so i was used python programing def…
Q: IN PYTHON A pedometer treats walking 1 step as walking 2.5 feet. Define a function named…
A: def feet_to_steps(user_feet): return int(user_feet * 2.5) if __name__ == '__main__':…
Q: Write a Python function that takes an Integer number, N (num of triangles), and string which…
A: Question given: Total number of triangles are given and their base and height is given in a…
Q: write a program that computes student average use a function with 4 parameter(name, math,…
A: Given: write a program that computes student average use a function with 4 parameter(name, math,…
Q: A pedometer treats walking 1 step as walking 2.5 feet. Define a function named feet_to_steps that…
A: Code: Please the below input for.the answer ..... Take the input from the user in float which…
Q: Define a function main that will draw a circle with the following parameters when the program is…
A: Python code is as follows:-
Q: Write a Python (or R) program that asks the user to enter an integer (X), then: • Determines if X is…
A: Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: PROGRAM CODE:…
Q: In Coral Please Write a program whose inputs are three integers, and whose outputs are the largest…
A: A Coral program is as follows, Function LargestNumber(integer num1, integer num2, integer num3)…
Q: Define a function print_total_inches, with parameters num_feet and num_inches, that prints the total…
A: #get feed and inches values from user and convert to intfeet = int(input())inches = int(input())…
Q: MATLAB has a function called round that rounds a number to the nearest integer. As an example, round…
A:
Q: In a store, you want to give change to customers and only have coins of the following types: 25…
A: Algorithm: The minimum number of coins for a value V can be computed using the below recursive…
Q: In Python: Write a program with total change amount as an integer input that outputs the change…
A: NOTE: - The program prints one coin type per line. Three functions are being used here. def…
Q: In python, create a program, "change.py", that has a function that takes 4 arguments that correspond…
A: We assume A penny is worth 1 cent A nickel is worth 5 cent A dime is worth 10 cent A…
Q: Write a Python program using functions that will ask the user for a number, then based on the…
A: The answer is below step:
Q: In Python Write a function so that the main program below can be replaced by the simpler code that…
A: GIVEN: Develop a python program that uses a function to find the miles traveled. Convert the given…
Q: Implement a function alterCase in Python that converts a word to "alterCase". Given a word, using…
A: Input Data : The string from the user Output Data : Altering the string as per the given…
Q: . Write a c++ program that tells what coins to give out for any amount of change from 1 cent to 99…
A: Programming instructions: Declare the required variables. Use a do-while loop that allows the user…
Q: Write a Python program that inputs five positive integer numbers, sorts them in descending order and…
A: Code: #Function to enter positive and distinct integers.def getValue():#Variable that runs loopflag…
Q: Write a simple JavaScript program to calculate the average mark and to calculate the grade of a…
A: We need to write a JavaScript language program to find the Average marks of the student and the…
Q: The ceiling of a floating-point number x is the smallest integer that is still larger than or equal…
A: ANSWER:-
Q: Exercise : Make a program that calculates the volume of water in a rectangular fish tank by - taking…
A: To Do: To write the python code.
Q: Write a Python function that takes an Integer number, N (num of triangles), and string which…
A: Here I have created a function named largestTriangleArea(). In this function, I have used the…
Q: Write a python program with total change amount as an integer input that outputs the change using…
A: def exact_change(user_total): dollars = user_total // 100 user_total %= 100 quarters =…
Q: Write a Python program using functions that WIll ask the user for a humber, then based on tne…
A: program code: '''def main(): #toread input a=input("input number:")…
Q: Write a Python function that gets the abbreviation of a currency and the queried day of the year as…
A: We can use dictionaries with country names to salve this problem.We need to store all currencies in…
Q: Write a program in python with a function hello(name), which prints "Hello" followed by the value of…
A: CODE:- def hello(name): print("Hello " + str(name))name=str(input("enter the name :…
Q: Write a program in C language to simulate tossing a “fair” coin. Allow the user to enter the number…
A: Write a program using c language that will take a number of tosses as input and find the number of…
Q: Write a Python program that inputs five positive integer numbers, finds their maximum and sort them…
A: Program code: import sys#define a function getValue()def getValue(): #array of values numList = []…
A pedometer treats walking 2,000 steps as walking 1 miles. Define a function name StepsToMiles that takes an integer as a parameter, representing the numbers of steps, and returns a float that represents the number of miles walked. Then, write a main program that reads the number of steps as an input, calls function StepsToMiles() with the inputs as an argument, and outputs the miles walked.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- IN PYTHON A pedometer treats walking 1 step as walking 2.5 feet. Define a function named feet_to_steps that takes a float as a parameter, representing the number of feet walked, and returns an integer that represents the number of steps walked. Then, write a main program that reads the number of feet walked as an input, calls function feet_to_steps() with the input as an argument, and outputs the number of steps. Please show your code.Write a program in python with a function hello(name), which prints "Hello" followed by the value of name. For example, hello('James') would print "Hello James". Write a program that asks the user for their name, and then uses the function to greet the person.Implement a function priceTShirt in Python that computes and returns the price of a T-shirt. The function accepts two arguments: a) the size of the T-shirt, one of 'S','M','L' and b) a str containing a slogan to be written on the shirt. The shirts have a base price of 12 dollars for small shirts, 15 dollars for medium and 18 dollars for large. The cost of the slogan depends on the amount of ink used to print the characters:each lower case letter costs 25 cents,each upper case letter costs 30 cents,each punctuation mark, anyone of marks appearing in .,!'"?: cost 20 cents,whitespace, either a space or newline character, cost 0 cents (no ink!).you may assume the slogan has no characters other than those mentioned above
- Write a program in Python, C++, or C that gets an integer from the user, prints out that value, then passes that value to a function, that doubles the number and returns back out the doubled number back to the main function and prints out that value to the screen.Write a program in python with a function hello(firstname, lastname), which, for example, if called with hello('James', 'Don'), would print two lines: Hello James Don Hello Don, James Use the function in a program where you ask the user for first and last name and then call the function.IN python, • generate_number(pct_per_digit): Takes one float as input. Returns a random number that is constructed as follows. First, use the function above to get a random number. This number will correspond to the length (number of digits) that the number generated by this function should have. For example, if that function returns 3, then this function should generate and return a random number with three digits. Note that in the case of a multi-digit number (2 digits or greater), the first digit cannot be 0. >>> random.seed(1337) >>> generate_number(0) 9 >>> random.seed(9002) >>> generate_number(0.5) 41700
- In Python Write a function so that the main program below can be replaced by the simpler code that calls function mph_and_minutes_to_miles(). Original main program: miles_per_hour = float(input()) minutes_traveled = float(input()) hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('Miles: {:f}'.format(miles_traveled)) Sample output with inputs: 70.0 100.0 Miles: 116.666667 ''' Your solution goes here ''' miles_per_hour = float(input())minutes_traveled = float(input()) print('Miles: {:f}'.format(mph_and_minutes_to_miles(miles_per_hour, minutes_traveled)))Write a simple JavaScript program to calculate the average mark and to calculate the grade of a student. Pass the rest parameter prefixed with three dots (...) as an argument to implement the function calculateAverageMark() - calculateAverageMark(...args)Calculate the average mark of the student and return it. Then, this average is used to determine the corresponding grade. Return the output with 2 decimal places. Implement the calculateStudentGrade() function to calculate the student grade based on the average mark.The average mark returned by the function calculateAverageMark() is passed as argument to this function.The grades are computed as follows: Range Grade <50 F <60 D <70 C <80 B <90 A <100 O Note: You may verify the correctness of your function by invoking it from within console.log as shown in sample input and output Sample Input and Output:Sample Input1:console.log(calculateAverageMark(80, 77, 88, 95,…Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N: Lather and rinse." numCycles times, where N is the cycle number, followed by "Done.". End with a newline. Example output with input 2: 1: Lather and rinse.2: Lather and rinse.Done.Hint: Declare and use a loop variable. #include <iostream>using namespace std; /* Your solution goes here */ int main() {int userCycles; cin >> userCycles;PrintShampooInstructions(userCycles); return 0;} Please help me with this problem using c++.
- Hi, I've been trying to solve this problem to drawCircle using Python and Mindtap. Define a function main that will draw a circle with the following parameters when the program is run: X = 50 Y = 75 Radius = 100 import turtle import math def draw_circle(radius, x, y): turtle.up() turtle.goto(x, y + radius) turtle.down() for i in range(120): turtle.forward(2 * math.pi * radius/120.0) turtle.right(3.0) return draw_circle(100, 25, 75) answer is giving me 0.04% differenceWrite a program in python that prints a pyramid made of letters in the middle of the screen. Use functions with parameters for this assignment. The base width of the pyramid is determined by a character the user enters. If the user enters the letter o, the following pyramid will be printed. It can be assumed that the screen width is 80 characters. a aba abcba abcdcba abcdedcba abcdefedcba abcdefgfedcba abcdefghgfedcba…Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a number of pennies.input: 5 6 4 Output: 506 400 My Code: def number_of_pennies(dollars=0, pennies=0): numer_of_pennies = (dollars * 100) + pennies return number_of_pennies print(number_of_pennies(int(input()), int(input()))) # Both dollars and penniesprint(number_of_pennies(int(input()))) # Dollars only However, this is the output that I am getting: <function number_of_pennies at 0x7f6a5e1d7e50> <function number_of_pennies at 0x7f6a5e1d7e50>