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
- In python programming A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a palindromic prime. Write a function that displays n palindromic prime numbers, display 10 numbers per line. displayPalindromicPrime(n), where n – is the number of palindromic prime numbers to display Prompt the user to enter how many numbers to display. These are 20 palindromic prime numbers: 2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929See the sample outputs for more clarification. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Programmer's full name Project number Project due date Processing Requirements Use the following template to start your project: #include using namespace std; // Global constants // The number of rows in the array // The number of columns in the array // The value of the smallest number // The value of the largest number const int ROWS = 3; const int COLS = 3; const int MIN = 1; const int MAX = 9; // Function prototypes bool isMagicsquare(int arrayRow1[], int arrayRow2 [], int arrayRow3[], int size); bool checkRange (int arrayRow1[], int arrayRow2[], int arrayRow3[], int size, int min, int max); bool checkUnique(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size); bool checkRowSum (int arrayrow1[], int arrayrow2[], int arrayrow3[], int size); bool checkColiSum(int arrayrow1[], int…You have been asked to develop the new system. You are to write an application to assign seats in an airline. Assume a small airplane with 28 seats (7 rows 4 wide) as follows: 1 A B C D 2 A B C D 3 A B C D 4 A B C D 5 A B C D 6 A B C D 7 A B CD The program should display the seat pattern, with an X marking the seats already assigned. 1 X B C D 2 A X C D 3 A B C D 4 A B X D 5 A B C D 6 A B C D 7 A B C D The program then requests a choice of seat. If the seat if available,then the seating display is updated. Otherwise, the program requests another choice of seat. If the user types in a seat that is already assigned, the program should say that that seat is occupied and ask for another choice. This continues until all seats are filled or until the user says that the program should end.
- JAVA CODE PLEASE Functions With No Parameters but With Return Values Practice II by CodeChum Admin Create a function named askInput that asks the user an integer input if called. The function will return the string “Even” if the integer is even, and “Odd” if otherwise. In the main function, call the askInput function and store the returned value in a variable then print it in a newline. Input 1. One line containing an integer Output Enter·a·number:·10 EvenIN C PROGRAMMING LANGUAGE A resistor is a circuit device designed to have a specific resistance value between its ends. Resistance values are expressed in ohms (Ω) or kilo-ohms (kΩ). Resistors are frequently marked with colored bands that encode their resistance values, as shown in the Figure. The first two bands are digits, and the third is a power-of-ten multiplier. The Table below shows the meanings of each band color. For example, if the first band is green, the second is black, and the third is orange, the resistor has a value of 50 × 103 Ω or 50 k Ω. The information in the Table can be stored in a C program as an array of strings. char COLOR_CODES[10][7] = {"black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "gray", "white"}; Notice that “red” is COLOR_CODES[2] and has a digit value of 2 and a multiplier value of 102. In general, COLOR_CODES[n] has digit value n and multiplier value 10n. Write a program that prompts for the colors…ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits. Your task is to create a function that takes a string and returns true if the PIN is valid and false if it's not. Examples validatePIN("1234") ➞ true validatePIN("12345") ➞ false validatePIN("a234") ➞ false validatePIN("") ➞ false Notes ● Some test cases contain special characters. ● Empty strings must return false.
- IN PYTHON Write a script which uses the input function to read a string, an int, and a float, as input from keyboard prompts the user to enter his/her name as string, his/her age as integer value, and his/her income as a decimal. For example your output will display as: Mark is 30 years old and his income is 2000 Please show code.Write a program in Visual Basic language that finds the smallest number out of four numbers, as follows The four numbers are entered using the Input box function. When the program is run directly, the Input box with the message Input () in first and the address (. F irst no) appears, and when the user finishes entering the first number, it appears successively. A second input box with the same message and address, but replaces the word first with the word Second, and so on with the next two boxesWrite 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):
- The text presented the Sierpinski triangle fractal. Inthis exercise, you will write a program to display another fractal, called the Kochsnowflake, named after a famous Swedish mathematician. A Koch snowflake iscreated as follows:1. Begin with an equilateral triangle, which is considered to be the Koch fractalof order (or level) 0, as shown in Figure a.2. Divide each line in the shape into three equal line segments and draw an outwardequilateral triangle with the middle line segment as the base to create aKoch fractal of order 1, as shown in Figure b.3. Repeat Step 2 to create a Koch fractal of order 2, 3, . . . , and so on, as shownin Figures c and d.In c language Using function strtod(), Create a character string that contains the following string: “78.3% is the average success rate” Divide this string into double and display the rest of the string The output will be: The original string is: 78.3% is the average success rate The extracted double value is: 78.3 The remainder of the string is: % is the average success rateWrite a python application to simulate an Online Book Shop. Notes: Option 1 and Option 2 must display the list of books to the user. The Main function accounts for invalid options. Program displays error message for invalid user option, invalid ISBN number or any invalid title.The programmer can create the book title, price, and ISBN information for the books. Each item consists only one string of comma-separated data: book ISBN number, title, and price. A customer can purchase some books either by ISBN number and/or by title. If the user input an invalid number or book title, the program should display an error message. The user can stop shopping with “checkout” option , which triggers the checkout() function that computes the total cost of the books in the cart. A customer will be provided the following menu option while shopping at the book shop: Option 1. Purchase by ISBN: User can purchase a book by its ISBN number. ISBN stands for International Standard Book Number. This is a…