Write a function that displays at the left margin of the screen a solid rectangle of asterisks whose width and height are specified in integer parameters width and height. Use this function in a program. For example, if width is 10 and height is 3, the function displays the following: ********** ********** **********
Q: Write a function that displays at the left margin of the screen a solid rectangle of asterisks whose…
A: The code is as follows import java.util.*;public class Main{ public static void main(String[] args)…
Q: Write a function for a simple game for two players that will generate a random 4 digit number (not…
A: Program Approach: Firstly using the package. Then using the namespace. Define the main Class.…
Q: In python Write a function areaOfCircle(r) which returns the area of a circle of radius r. Test…
A: The following steps need to be taken for the given program: Create function areaOfCircle(r) with…
Q: Write a function number_of_pennies() that returns the total number of pennies given a number of…
A: Total number of pennies = number of dollars * 100 + pennies
Q: IN python, • generate_number(pct_per_digit): Takes one float as input. Returns a random number that…
A: Coded using Python -
Q: ite a function named sumDigits which takes three parameters: f, t and x. sumDigits, then, finds the…
A: the program is an given beloe :
Q: Write a program which requests two lengths in feet and inches (both whole numbers) and prints the…
A: As per the requirement the program has been completed. Please check the following.
Q: For a given number in binary, having combinations of 1s and 0s only, write a program that outputs…
A: NOTE: Since the programming language is not mentioned. Therefore answering questions in Python…
Q: Write a Python function that takes two parameters which are strings, consisting only of digits 0…
A: The required code is given below in Python language. Also, the snapshot of the code and output is…
Q: Write a program in Python with a function perfectcube(n), which returns True if n is a perfect cube…
A: code:-
Q: A prime number is an integer greater than 1 that is evenly divisible by only 1 and itself. For…
A: Lets see the solution.
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: Here I have created the function named exact_change(). Inside the function, I have first of all…
Q: fun_x(13,2), the return value of the * function would be 1 float fun_x (int t, int x=10) 2 3 return…
A: 1. f(13,2) return 13/2 = 6.5 But both t and x are integers. So, the result will be 6. Correct…
Q: Define a function print_total_inches, with parameters num_feet and num_inches, that prints the total…
A: Program code: #define the function print_total_inches()def print_total_inches(num_feet, num_inches):…
Q: Write a function that can calculate the area of an ellipse given the major radius a and minor radius…
A: We know that area of the ellipse is πab where a is major radius and b is the minor radius. Let's…
Q: Implement a function that checks if a number is within a given range. It should accept the range…
A: ## No language is mentioned, we write the program in Python language. # user define function…
Q: Define a function in the Python language that takes two integer parameters a,b and return the sum of…
A: Define a function in the Python language that takes two integer parameters a,b, and return the sum…
Q: Write a program which requests two lengths in feet and inches (both whole numbers) and prints the…
A: I give the code in C# as per your requirement along with output and code screenshot
Q: Write a function named sumDigits which takes three parameters: f, t and x. sumDigits, then, finds…
A: Code def sumDigits(f,t,x): for i in range(f,t+1): sum = 0 for digit in str(i):…
Q: Write a program to take input for a number, if the number is palindrome, then display its half on…
A: Program approach:- // using header file. // using main function. // print the integer type number.…
Q: Write a program that reads a string and outputs the number of times each lowercase vowel appears in…
A: Algorithm: 1. Start 2. Read string 3. Iterate through the string and if the character is an vowel…
Q: There exists a staircase with N steps, and you can climb up either 1 or 2 steps at a time. Given N,…
A: - We have to write a program in c++ to determine the count of steps to reach nth step from start if…
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 function PrintShampooInstructions(), with int parameter numCycles, and void return type. If…
A: Completing the given C++ program so, that it can follow the given rubrics:Firstly, displaying a…
Q: coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular…
A: Lets see the solution.
Q: Write a program, using a function, that will check a single integer to determine if it is prime…
A: As you have not mentioned the programming language in the question, so we have answered this…
Q: roblem 3 Write a program that inputs a line of text and a search string from the keyboard. Using…
A: Actually, C language is a high level language. String is a sequence of characters. The code has…
Q: Write a function that takes a list of hours and returns the total weekly salary. • The input list…
A: 1. Create the Method with the argument of the list of hours 2. return hours with function switch(i)…
Q: Write a program in python with a function repeatPhrase(phrase, n), which prints the given phrase n…
A: In this question, we have to alternatively print in lower case and upper case. We will input string…
Q: Write a program that inputs 10 integers from the user and passes them one at a time to the function…
A: Function is the block of statement which can call by another function is called function. A function…
Q: Write a function int largest(int a[],int n) that will find the largest int in the n ints in a.
A: Assembly code to find the largest number in the array: LXI H 2050 MOV C, M DCR C INX H MOV A, M INX…
Q: Write a program that reads a list of names and total points for students until -1 is entered. After…
A: Given data is shown below: Write a program that reads a list of names and total points for students…
Q: Write a function that takes two integers and returns True if the integers have a common divisor that…
A: Required: Write a function that takes two integers and returns True if the integers havea common…
Q: A pedometer treats walking 2,000 steps as walking 1 miles. Define a function name StepsToMiles that…
A: According to information given:- We have to create a pedometer where walking 2000 steps equals 1…
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: Implement a function that checks if a number is within a given range. It should accept the range…
A: The given program is in the C++ programming language.
Q: Define a function in Javascript that takes two integers x, y as the parameters and returns the sum…
A: Define a function in Javascript that takes two integers x,y as the parameters and returns the sum of…
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: Code : # definition of the exact_change() method...def exact_change(user_total): # fetch the…
Q: Write a Python program that asks the user for an integer n and then prints out all its prime…
A: Solution: isPrime:- isprime() function is a SymPy module built-in function which can be used to…
Q: Write a function that will draw n squares inside each other. The function will receive n (number of…
A: Here is the answer:-
Q: Write a program that prints a pyramid made of letters in the middle of the screen. Use functions…
A:
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 user-defined function that will receive a variable number of input arguments: the length and…
A: ## As no language is mentioned, we write the code in Python. def fun(l, w, *h):…
Q: for python program 1. A prime number is a number that is only evenly divisible by itself and 1. For…
A: Python Code: #please check the indentations properly def isPrime(n) : # Corner cases if (n…
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 python with a function hello(firstname, lastname), which, for example, if called…
A: According to the provided information: We need to write a program in python with a function…
Q: The Research team led by Bernadette Wolowitz at Cal-tech University has discovered a new Amoeba that…
A: Explanation: Include all the necessary header files. Declare the necessary variables. Take the user…
Write a function that displays at the left margin of the screen a solid rectangle of asterisks whose width and height are specified in integer parameters width and height. Use this function in a
Step by step
Solved in 3 steps with 6 images
- Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are x1,x2,x3,x4,andx5, then the mean is x=(x1+x2+x3+x4+x5)/5 and the standard deviation is: s=(x1x)2+(x2x)2+(x3x)2+(x4x2)+(x5x2)5 Your program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation.Write a function that displays at the left margin of the screen a solidrectangle of asterisks whose width and height are specified in integer parameters width and height.For example, if width is 10 and height is 3, the function displays the following: ******************************Write 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 program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies.def exact_change(user_total)Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies.def exact_change(user_total) python please use this in answer # Define your function here if __name__ == '__main__': input_val = int(input()) num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change(input_val) # Type your code here.Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies.def exact_change(user_total) # Define your function here if __name__ == '__main__': input_val = int(input()) num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change(input_val) # Type your code here. python
- 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.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.Write a program that displays two chessboards, as shown in Figure 6.13. Your program should define at least the following function:# Draw one chessboard whose upper-left corner is at# (startx, starty) and bottom-right corner is at (endx, endy)def drawChessboard(startx, endx, starty, endy):
- Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function:void ExactChange(double userTotal, int& numDollars, int& numQuarters, int& numDimes, int& numNickels, int& numPennies)The greatest integer function is defined by int(x) = the greatest integer that is ....................For example, int(2.5) = ................ int(-2.5) = ............... and int(0.5) = ...................Using, HTML,CSS , and javascript Write a program that takes as input the speed of a car e.g 80. If the speed is less than 70, it should print “Ok”. Otherwise, for every 5 km/s above the speed limit (70), it should give the driver one demerit point and print the total number of demerit points. For example, if the speed is 80, it should print: “Points: 2”. If the driver gets more than 12 points, the function should print: “License suspended”.