a nonpalindromic prime number whose reversal is also a prime. For example, 17 is a prime, and 71 is a prime, so 17 and 71 are emirps. Write a function that displays the first n emirps, display 10 numbers per line. displayEmirps(n), where n – is the numbe
Q: Example: (H.W) Given a quadratic equation as follows: ax2 + bx + c = 0 if b*b-4*a*c_is greater than…
A: ! ---------------------------------------------------! Solve Ax^2 + Bx + C = 0 given B*B-4*A*C…
Q: Write a program in python Suppose a right triangle is placed in a plane as shown below. The…
A: Let the coordinates of three corners be (x1, y1), (x2, y2) and (x3, y3). And coordinates of the…
Q: Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers…
A: PROGRAM: #while loop while True: #Getting input from the user phoneNum = input('Enter the number…
Q: A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a…
A: Since programming language not mentioned, using C++
Q: Write a function that converts milliseconds to hours, minutes, and seconds using the following…
A: Steps to convert milliseconds to seconds, minutes, and hours as follows Total seconds = Milli…
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: Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers…
A: Answer:
Q: 10) Write a program that translates a letter grade into a number grade. Letter grades are A, B, C,…
A: note:- always mention programming language name in question, this is done in python. logic:-…
Q: Write a program for a pharmacy to generate bills. The program should ask about the code associated…
A: The program is written in C++ #include <iomanip> #include <iostream> using namespace…
Q: Q1/ Write a program that reads from the user the number of students in the class and their grades in…
A: Note: As no language is mentioned, therefore answering in python Input : Number of students Grade…
Q: Science P4.13The dew point temperature T. can be calculated (approximately) from the relative…
A: We have to write JAVA Code for following question:
Q: Write a program continuously asks the user to enter a sentence until they type "-999". It should…
A: As you have not mentioned the programming language, I have written the program in java import…
Q: Write a program continuously asks the user to enter a sentence until they type "-999". It should…
A: #the function definition for uppercasedef Uppercase(sentence,n): upper='' for i in range(n):…
Q: Write a program that accepts four parameters "lowerLimit", "upperLimit", "A", and "B". The program…
A: Algorithm Start Var l, u Accept l from user Accept u from user for i=l to u, go to step 6 else to…
Q: Write a program that reads from a student his/her name and his/her ID which is formed of 8 digits.…
A: The solution to the given problem is below. **Note: As programing language is not mentioned in the…
Q: Q2: Write a JavaScript function that accepts a number from a user as input and checks if the number…
A: I give the code in javascript along with output and code screenshots
Q: Write a program called KiloToPoundTable that prints the below table. Useprintf()and while statement.…
A: A constant is defined for holding the conversion factor. printf function is used to format the print…
Q: Code should be in Python. Given the code that reads a list of integers, complete the number_guess()…
A: Algorithm: Create function number_guess call random.seed(900) Iterate over the list Generate a…
Q: 5) Write a program to determine the number of thousands, hundreds, tens, and ones in a given integer…
A: #include <stdio.h> int main() { int n=8532; // declare and initialize the digit int…
Q: Exercise 30 defines the number e and Exercise 31 shows how to approximate the value of e using a…
A: Since no programming language is mentioned. I am attempting this in python. if you need it in any…
Q: Using Python to write a program that displays a square using the function DisplaySquare(n, ch). The…
A: PROGRAM CODE: def DisplaySquare(n,ch): for i in range(n): for i in range(n):…
Q: A number in base 2 (binary) is a number such that each of its digits is 0 or 1. To convert from…
A: import java.util.Scanner;public class Main{ public static void main(String args[])…
Q: A prime number is called a Mersenne prime if it can be writtenin the form 2 p - 1 for some positive…
A: Since the programming language is not mentioned, assuming the programming language to be C language.
Q: The international standard letter/number mapping for telephones is shown below. DEF 123 ABC GHI JKL…
A: In step 2, you will get C++ code. In step 3, you can see the sample output.
Q: This assignment requires you to plot (in text) a quadratic function at certain points. • Ask the…
A: Correct code def q(a,b,c,x): return a*x**2 + b*x +c def pq(a,b,c,x): print(f'At x= {x} ,y=…
Q: Complete the program so that it runs like the following (user input is bolded) : #include…
A: Note: The comments have been included in the code itself to have a better understanding of the code.…
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: 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: A number in base 2 (binary) is a number such that each of its digits is 0 or 1. To convert from…
A: Since the programming language is not mentioned, we are providing the answer in Java language.
Q: IN PYTHON Write a script which uses the input function to read a string, an int, and a float, as…
A: In Python, input() method is used to take the input from the user. int() method is used to convert…
Q: Write a program that finds the negative integer solutions of the following equation ax³ + bx² + cx'…
A: The objective of the given problem is to find the negative integer solution in the range of -200 to…
Q: Write a program which input radius of circle and compute area of it. Then input the length of side…
A: EXPLANATION - Create a program . Declare three variable radius , length , area1 , area2 . Take…
Q: Python please: Given an integer representing a 10-digit phone number, output the area code, prefix,…
A: phone_number = int(input()) x = str(phone_number) print("("+x[:3]+") "+x[3:6]+"-"+x[6:])
Q: 1. Write a program that will read an employee name (use your Name as input in employee name),…
A: Solution - Programming Language - C All necessary comments are included in program code. Program…
Q: Write a program that prompts the user to enter an integer (n) and a sum value (s). The program…
A: Algorithm: Step1: Declare variable n. Step2: Declare variable to store sum value, difference value…
Q: 1. Write a program that computes the area of each color in an archery target. For simplicity, we…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: 2. Write a program that automates the table used by a surveyor to transform compass headings in…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
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: Using Python, Many documents use a specific format for a person's name. Write a program whose input…
A: Algorithm and explanation: In the given problem, we can solve it by using string and list concepts.…
Q: 3. Given the value of n from the user, write a program that will display the first n even numbers.…
A: The problem is based on the basics of loops in java programming language.
Q: Your program must generate random fraction questions using the basic math operators, ask the user…
A: To get correct answer, calculate the question given by the random() in your console and paste the…
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: A number in base 2 (binary) is a number such that each of its digits is 0 or 1. To convert from…
A: code '; def main(): binary = input("Enter a 5 digit binary number: ") #input the binary…
Q: diagram last two digits of your student number (For example, if your student number is 1910602041,…
A: Here value of n is 34 So T = 34%25 = 1 i=2 j=0 i<9 -> True j=2 j<10 -> True T= T+j+i =…
Q: 1. Write a program that computes the area of each color in an archery target. For simplicity, we…
A: ANSWER:-
Q: In Python using the Pandas Module: Find the Player with the Highest Batting Average from 2019, only…
A: I have created the database of 3 years of player data in CSV naming player.csv.You can use your…
Q: Given a square matrix with the elements 0 or 1, write a program tofind a maximum square submatrix…
A: Program: import java.util.Scanner; public class AKS{public static int[] findLargestBlock(int[][] m){…
In python
An emirp is a nonpalindromic prime number whose reversal is also a prime. For example, 17 is a prime, and 71 is a prime, so 17 and 71 are emirps.
Write a function that displays the first n emirps, display 10 numbers per line.
displayEmirps(n), where n – is the number of palindromic prime numbers to display
Prompt the user to enter how many numbers to display.
Trending now
This is a popular solution!
Step by step
Solved in 4 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 929In Python, program a function called "capitalizePhrases", with the following heading: # capitalizePhrases: str -> str# It receives a string with several sentences separated by ".", Where all its letters are in # uppercase and delivers the same string but with the first letter of each sentence in uppercase# and the others in lowercase:# Example: capitalizePhrases("HELLO.THAT WELL IT DIDN'T RAIN SO MUCH TODAY.BE CAREFUL."),# must deliver: "Hello.That well it didn't rain so much today.Be careful."# Observation: both in entry and exit, there is no space after a point.# Also suppose that both input and output do not include accents. (á, ó, etc.)def capitalizePhrases(upperText):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”.
- Write a program in python with a function repeatPhrase(phrase, n), which prints the given phrase n times, alternating between lowercase and uppercase. For example, repeat('The sky is yellow', 5) would print: the sky is yellow THE SKY IS YELLOW the sky is yellow THE SKY IS YELLOW the sky is yellow Use the function in a program where you ask the user for the phrase and the value of nWrite a function that asks the user how many Fibonacci numbers to generate and then generates them. Make sure to ask the user to enter the number of numbers in the sequence to generate. The Fibonacci sequence is a sequence of numbers where the next number in the sequence is the sum of the previous two numbers in the sequence. The sequence looks like this: 1, 1, 2, 3, 5, 8, 13, § You could assign your input integer to a variable num by num = int(input("How many fib. numbers you want to generate?:")). § You have to consider exceptions, such as the input integer is zero, negative numbers or floats. § Please submit your code and console screenshots to Blackboard. Code containing syntax error will be graded zero. § Example: The prompt asks, “How many fib. numbers you want to generate?Write a function that asks the user how many Fibonacci num-bers to generate and then generates them. Make sure to ask the user to enter the numberof numbers in the sequence to generate. The Fibonacci sequence is a sequence of num-bers where the next number in the sequence is the sum of the previous two numbers inthe sequence. The sequence looks like this: 1, 1, 2, 3, 5, 8, 13,You could assign your input integer to a variable num by num = int (input ("Howmany numbers that generates?: "))• You have to consider exceptions, such as the input integer is zero, negative num-bers or floats.• Please submit your code and console screenshots to Bartleby. Code contain-ing syntax error will be graded zero.• Example: The prompt asks "How many numbers that generates?" If your input is10, then the function will return a list of 10 integers 1, 1,2,3,5,8, 13, 21, 34, 55
- This is python programming Create a function based on the following information: You are given two strings with words separated by commas. Try to find what is common between these strings. The words in the same string don't repeat. Your function should find all of the words that appear in both strings. The result must be represented as a string of words separated by commas in alphabetic order. Input: Two arguments as strings. Output: The common words as a string. Return: Nothing is returnedplease code in python Write a function that receives a string and a number (n) as parameters and returns a new string that contains only every nth letter from the given string. print(everyNth('banana', 2)) # should return aaaprint(everyNth('carrot', 3)) # should return rtprint(everyNth('pear', 1)) # should return pearWrite the following function to draw a regular polygon:def drawPolygon(x = 0, y = 0, radius = 50, numberOfSides = 3):The polygon is centered at (x, y) with a specified radius for the bounding circle for the polygon and the number of sides. Write a test program that displays a triangle, square, pentagon, hexagon, heptagon, and octagon, as shown in Figure 6.12a.
- write a function sequence in Python that accepts an number ( int ) and that prints a sequence of numbers that starts at the given number and obeys the following rules:the number 1 is the last number in the sequence (e.g stop )if the number if even, the next number is half of itif the number is odd, the next number is one moreSpecifications:use a while loopprint each number in the sequence one per line example usage: >>> sequence(3)3421Write a function in python that takes an acrostic as the input and will return the secret message to the user. Include optional arguments to state what makes the first line, as well as what position should be used.a) SATOR\nAREPO\nTENET\nOPERA\nROTAS\n1. Use each index position 0 through 4 b)Elizabeth it is in vain you say\t“Love not” – thou sayest it in so sweet a way:\tIn vain those words from thee or L.E.L.\tZantippe’s talents had enforced so well:Ah! If that language from thy heart arise,\tEndymion, recollect, when Luna tried\tTo cure his love – was cured of all beside\tHis folly – pride – and passion – for he died.“An Acrostic” by Edgar Allen PoeString: abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba Make a program that: reads a letter from standard input print the above string up to this letter For example, if the letter was c, the output would be: abcba Must use a function.