Using Python to write a program that displays a square using the function DisplaySquare(n, ch). The function receives n as a parameter for the length of the square, and ch as a character used in the display For example, DisplaySquare(5,’#’) will display the following pattern on screen: ##### ##### ##### ##### #####
Q: A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a…
A: According to the Question below the Solution: Output:
Q: Write a program that computes the fuel efficiency for a multi-leg journey. The program will first…
A: The following algorithm is needed for writing the python program: Input initial reading of 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: The following program loads and displays an image. Complete the draw_border function to draw a black…
A: Actually, python is a easiest programming language. It is a concise(less) code. It is a dynamically…
Q: how can I write a python program that displays a table of pounds and equivalent weights in…
A: Program description: start and stop are user input integer variables used to store the value of…
Q: Rock, paper scissor games. Use a random function for generating the random output by the computer…
A: Solution: Given, Use a random function for generating the random output by the computer side. The…
Q: Write a C++ program, that asks a user to enter the width and length of the rectangle and then find…
A: Coded using C++ Language.
Q: In Python, how do I change my code to display the correct way. The salaries should be floating…
A: employee_names=[]employees_salaries=[] while True: employee_name=input("Enter employee name: ")…
Q: Write a program that displays the following table. Calculate themiddle point of two points.a…
A: Since, programming language is not mentioned in the question, we will answer this question in Java…
Q: The book Id number is represented in the following pattern: 0-07-041183-2. The first part(0)…
A: Python code given below
Q: JPNav is a program to help navigate people, telling them wether or not they can reach their…
A: A string in C is defined as a character array. The character array can be assigned a string value in…
Q: Write a program that displays a Pascal triangle. The program prompts the user to enter the number of…
A: Given: please use java to answer the following question
Q: Write a program to replace a forbidden word with asterisks in a set of text and prints the text to…
A: Please find the answer below :
Q: Accept two integers and determine of the values are equal, if the values are equal print” EQUAL…
A: Introduction of Program: The C++ program takes two integers as input from the user and if both…
Q: In JavaScript, there are two types of comments: 1. Single-line comments start with // 2. Multi-line…
A: Coded using JavaScript.
Q: 1. Write a program that will allow a student to calculate his/her test average of four test scores.…
A: // As per our guidelines we are supposed to answer only one question. Kindly repost other questions…
Q: In JavaScript, there are two types of comments: 1. Single-line comments start with // 2. Multi-line…
A: 1. create the new method and pass a String argument.2. if condition string contains ("/*/") then…
Q: Write a program that displays two chessboards, as shown in Figure 6.13. Your program should define…
A: Program Approach: Import turtle package Defining the main method Draw the first chessboard Draw the…
Q: (A) Using visual basic6 programming language, write a program to print the multiplication table as…
A: You must first enter a number into a TextBox, after which you must select the "Calculate" button to…
Q: Write a program that takes five integer numbers (range 0 to 10). And display horizontal bar chart.…
A: Please find the answer below :
Q: Write a program that can be used by MG-Train to purchase tickets. The train has three cars. Car #1…
A: Answer :
Q: In this assignment you will write a program that shows the valid moves of chess pieces. Your program…
A: C++ Code : bool isValid(int c[][MAX], int n){ int a[] = { 0, -1, 0, 1 }; int b[] = { 1, 0, -1, 0…
Q: IN PYTHON: To estimate pi, generate a series of x, y random pairs, where x and y are in the range -1…
A: The image of the formatted program is given below:
Q: using java language Scanners are handy for reading input that is stored in a file. For this…
A: The below given Java program will obey the following rubrics: Including necessary data packages. In…
Q: Python Language Useful websites: : http://en.wikipedia.org/wiki/Radix…
A: Task :- Write a Python function to find the kth digit for given number. Python program :- def…
Q: In C++ language, create a program that gets quarterly sales from a user, and calculates the total of…
A: pseudocode :
Q: Create a function that finds the maximum range of a triangle's third edge, where the side lengths…
A: The python program for the above problem is given below in step 2.
Q: Write a program that prompts the user for a number of decimal places between 1 and 10 and returns…
A: #include<iostream> using namespace std; int main(){ int count=0;…
Q: write a program in python Write a program that will allow a student to enter their name and then…
A: In order to solve this first we need to initiate count to 0 and the count the correct answers by…
Q: Python Write a program that calculates and prints the value according to the given formula: Q =…
A: Write a program that calculates and prints the value according to the given formula: Q = Square root…
Q: In this java program please explain everyline of this code. Source Code: // Online Java Compiler…
A: The above java program is to find 1. Total iterations made 2. Sum of all iterations Initially, we…
Q: In Python Write a program that computes the fuel efficiency for a multi-leg journey. The program…
A: def main(): #Prompt the user to enter the input. start_odo = float(input("Enter the initial…
Q: Write a full program that display the area of a rectangle. The program calls the following two…
A:
Q: 4.Write a program that displays a Pascal triangle. The program prompts the user to enter the number…
A: The answer is in below steps:
Q: In python. Write a program that calculates the BMI (Body Mass Index) of a person, which is used to…
A: #Taking Inputheight = float(input("Enter height in Meters - ")) weight = float(input("Enter weight…
Q: Use C language: Write a program which asks the user to input a whole number representing the total…
A: Algorithm: Start of the program Declare necessary variable Read the price variable Based on price…
Q: IN JAVA SCRIPT Programming In this challenge you should repeat a specific given char x times. Create…
A: In this problem, we need to provide a solution in javaScript programming language. Input -…
Q: Write a program that displays numbers in a triangular pattern, as shown in Figure 9.25d. The number…
A: Given: Write a program that displays numbers in a triangular pattern, as shown in Figure 9.25d. The…
Q: ow can I write a python program that displays a table of pounds and equivalent weights in kilograms.…
A: for i in range(start,stop,step): print('{:>10}\t {:>10.3f}'.format(i,(i*0.453592)))
Q: Write a program that prompts the user to enter the points of a convex polygon and display its area.…
A: Program using java: import java.util.ArrayList;import java.util.Scanner;class MyPoint{ public…
Q: A python program that lets the user play the game of Rock, Paper, Scissors against the computer. The…
A: import random random.seed(300) def determineWinner(playerChoice, computerChoice): # Checking…
Q: Python please: Write a program that creates an upward-pointing arrow. Choose 2 input characters:…
A: #python program to print upward pointing arraw#reading two characters b = input('Enter char body…
Q: Write a program that given two coordinate pairs and a third single coordinate will linearly…
A: #include<iostream> using namespace std; int main(){ float…
Q: n c++ , write a program that gives the following output as mentioned in image . ( Give answer…
A: Declare count=1,sp=1; for(int i=1;i<=4;i++) { for(int j=4;j>=i;j--) { Display…
Q: 1. Write a program that will allow a student to calculate his/her test average of four test scores.…
A: Code: import java.util.*;public class Main{ public static void main(String[] args) { //declaring…
Q: Write a program that displays a table of pounds and equivalent weights in kilograms. You can find…
A: As no output is provided and no language is specified, I have written the program in Python The code…
Q: e a function called print_hangman() that takes no arguments and prints a hangman corresponding to…
A: We need to implement print_hangman() as given below:
Q: Write a program that extracts from a text all dates written in format DD.MM.YYYY and prints them on…
A: re is the module in python to implement functions related to regular expressions findAll function…
Q: Write a program that calculates and prints the volume of a pyramid given the base (b) and the height…
A: Note: Below is the required program in the C++ language. Program Approach: Defining the necessary…
Q: Java or C++ program to display the given output -----Library System---- 1. Add a Student 2. Add a…
A: /* import packeges and necessary classs */import java.lang.*;import java.util.Scanner;import…
Using Python to write a
For example,
DisplaySquare(5,’#’) will display the following pattern on screen:
#####
#####
#####
#####
#####
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- 3. The following program loads and displays an image. Complete the draw_border function to draw a black border around the image. Don’t change the size of the image - draw 5 black lines across the top and bottom and 5 black lines down the left and right sides of the image. Do not change the main function. import image def draw_border(pic):'''Returns an image with a black border around it'''pass #You can leave this or remove it#Your code here to draw a black border around the image def main():'''Controls the program'''fname = "https://runestone.academy/runestone/static/instructorguide/_static/arch.jpg"img = image.Image(fname)width = img.getWidth()height = img.getHeight()win = image.ImageWin(width, height)draw_border(img)img.draw(win) main() #Run the program***Microsoft Visual Studios (C++)*** Write a program that given two coordinate pairs and a third single coordinate will linearly interpolate or extrapolate the third second coordinate. For example, let's say at 50 degrees Celsius the length of a metal rod is 5.4 cm and at 60 degrees Celsius the length is 5.5cm. I can interpolate the length at 53 degrees Celsius by doing 5.4cm + 3*(.1/10)=5.43cm. Your program does not need to continuously run, but should prompt the user for two coordinate pairs, the third first coordinate and return the extrapolated or interpolated third second coordinate.Write a program in python that defines a function to illustrate 20 random polygons with 3-11 sides, each side ranging in length from 10-50, located at random position (x, y). Select a color at random from red, green, blue, black, or yellow. Produce the code and the output in .ipynb and .html
- In java Develop a menu-based shape-maker, using randomly generated sizes & characters: pyramid, inverted pyramid, diamond, and hourglass. Use functions to perform tasks, including separate functions for generating a random integer in a range and for generating a random character in a range. The four different shapes are made from a randomly generated printable character and a randomly generated maximum width between 4 and 12. Beneath the shape, print a descriptive caption stating the symbol and the maximum width. define the random integer and random character functions in a separate class in a separate source code file and call these functions from the shape maker.In java Develop a menu-based shape-maker, using randomly generated sizes & characters: pyramid, inverted pyramid, diamond, and hourglass. Use functions to perform tasks, including separate functions for generating a random integer in a range and for generating a random character in a range. The four different shapes are made from a randomly generated printable character and a randomly generated maximum width between 4 and 12. Beneath the shape, print a descriptive caption stating the symbol and the maximum width.Define the random integer and random character functions in a separate class in a separate source code file and call these functions from the shape maker.in python “c” represents a crop and “w” represents a water source. Each water source hydrates the eight tiles around it (including itself) Input the number of rows and columns in the crop field:ROWS> 4COLUMNS> 4Input each row of the crop field.ROW0> c c c wROW1> w c c cROW2> c c c cROW3> c w c cNot all crops are watered!OUTPUT FalseThe following crops are not watered:OUTPUT [(2, 3), (3, 3)] Input the number of rows and columns in the crop field:ROWS> 7COLUMNS> 1Input each row of the crop field.ROW0> cROW1> wROW2> cROW3> cROW4> wROW5> cROW6> wAll crops are watered!OUTPUT True
- Why my code given me error’s # Python code to draw snowflakes fractal. import turtle import random # setup the window with a background color wn = turtle.Screen() wn.bgcolor("cyan") # assign a name to your turtle elsa = turtle.Turtle() elsa.speed(15) # create a list of colours scolor = ["white", "blue", "purple", "grey", "magenta"] # create a function to create different size snowflakes def snowflake(size): # move the pen into starting position elsa.penup() elsa.forward(10*size) elsa.left(45) elsa.pendown() elsa.color(random.choice(sfcolor)) # draw branch 8 times to make a snowflake for i in range(8): branch(size) elsa.left(45) # create one branch of the snowflake def branch(size): for i in range(3): for i in range (3): elsa.forward(10.0*size/3) # draw branch 8 times to make a snowflake for i in range(8): branch(slice) elsa.left(45) # create one branch of the snowflake def branch (size): for…Write a program that can be used by a small theater to sell tickets for performances. The theater’s auditorium has 15 rows of seats, with 30 seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the theater. Seats that are taken are represented by an * symbol, and seats that are available are represented by a # symbol: Seats 123456789012345678901234567890 Row 1 ***###***###*########*****#### Row 2 ####*************####*******## Row 3 **###**********########****### Row 4 **######**************##****** Row 5 ********#####*********######## Row 6 ##############************#### Row 7 #######************########### Row 8 ************##****############ Row 9 #########*****############**** Row 10 #####*************############ Row 11 #**********#################** Row 12 #############********########* Row 13 ###***********########**###### Row 14…In this assignment you will write a program that shows the valid moves of chess pieces. Your program will draw a board with 64 squares using the traditional layout, next ask the user to choose a move, and then, depending on the user's choice, redraw the board with the selected chess piece and its valid moves. Please see the examples of valid moves of chess pieces and the traditional chess board layout below:
- The Research team led by Bernadette Wolowitz at Cal-tech University has discovered a new Amoeba that grows in the order of a Fibonacci series every month. They are exhibiting this amoeba in a national. conference. They want to know the size of the amoeba at a particular time instant. If a particular month's index is given, write a program to display the amoeba's size. For Example, the size of the amoeba on month 1, 2, 3, 4, 5, 6,... will be 0, 1, 1, 2, 3, 5, 8.... respectively.The following program loads and displays an image. Complete the draw_lines function to draw a green vertical line from top to bottom, 1/3 of the way from the left edge of the image, and a blue horizontal line all the way across the image, 1/3 of the way from the top. Your program should work regardless of the size of the image. Do not change the main function.python help So, we will try this one from scratch. Implement the function postalLabel() that takes 6 inputs: a first name (as a string) a last name (as a string) an address (as a string) a city (as a string) a state (as a string) a zip code (as an integer) The user will be prompted to enter the six inputs. As noted, the inputs should be entered as strings except for the zip code. Use the string format method to print the label (no other will be accepted). You must provide the appropriate docstring and the comments for every statement. If this information is missing, you will lose points. Your result should look like the example below except it should be your name with other bogus information (do not put in your address, city and state – make them up). This program should consist of input prompts and a string formatted print stamen.>>> postalLabel() >>> Please enter your first name: Parker >>> Please enter your last name: Jones >>> Please enter…