Create an algorithm (pseudocode, flowchart or actual Python code. Choose one of these) which performs the following task: a) Asks for an n positive integer, then draws a right-angled triangle of height n on the screen (similar to the example below). The _-s are just denoting the "spaces", so you do not need to actually draw them. n=5 b) Asks for a positive integern and draws an isosceles triangle of height n on the screen (similar as in the example) n=5
Q: A regular polygon has n number of sides with each side of length s. The area of a regular polygon is…
A: Please check the step 2 for Python Program for find area and perimeter of regular polygon
Q: 01: Draw a flowchart for work the traffic lights ? Q2: Write the algorithm required to find the…
A: Q1 flowchart is as given below :
Q: Write a program to display fruit sales receipts. Python language only Apple: Pink Lady -…
A: type1 = input("Which kind of apples would you like: (P)ink Lady 4.99/kilo (F)uji 5.99/kilo: ")qt1 =…
Q: In python, Write a program that prompts for an odd integer that is between 50 and 100, inclusive.…
A: PSEUDO CODE: BEGIN //Heading WRITE "Checking for odd value between 50-100" //Reading input from the…
Q: Write a program to calculate and display ticket price. using python The flight ticket price…
A: ALGORITHM:- 1. Take input from the user for all the variables. 2. Calculate the cost of the ticket…
Q: 3.1 How many seconds are in an hour? Use the interactive interpreter as a calculator and multiply…
A: 3.1 How many seconds are in an hour? Use the interactive interpreter as a calculator and multiply…
Q: Write a program that generates 1,000 lowercase letters randomly, counts the occurrence of each…
A: Program Plan: • In HistoGram class, o Create a window, set its title. o Create a canvas and add it…
Q: Write an algorithm and draw a flowchart that prints all the odd numbers in the number from 1 to 20.
A: Algorithm: Step 1: StartStep 2: Assign i=0Step 3: Repeat steps 4,5&6 until i=20 reachesStep 4:…
Q: 1i - Second Smallest Take an unknown number, larger than two, of positive integers as input.…
A: 1i The code of second_smallest.py program is shown below. #function to print second largest…
Q: Write a program that prompts the user to enter the radius of the rings and draws an Olympic symbol…
A: Define module turtle. Define object for turtle as p. Define thickness of then pen p as 6. Define…
Q: The code below is given a sequence of positive integers to find the longest increasing and the…
A: Longest Increasing Subsequence of a sequence is a subsequence such that it is sorted ( lowest to…
Q: Create a new version of the program below that uses Boolean expressions for making the required…
A: def valid_triangle(a,b,c): if a+b>=c and b+c>=a and c+a>=b: return True else:…
Q: (3) Suppose we have a box with n balls. Every ball has one color only, however we have 10.000…
A: Data Given:- Box with 'n' balls Different colors of ball : 10 To Find:- Count of balls of each…
Q: The volume of a cylinder can be computed by multiplying the area of its circular base by its height.…
A: The answer for the above mentioned question is given below in step 2.
Q: write a Python program that asks the user for the amount of a sale, and outputs the final sale after…
A: Given : To write a python program that asks user to enter amount of sale and outputs the final sale…
Q: Can you create a flowchart for the follwoing python code. # printing the very first row with X,…
A: Screenshot #1:
Q: The vase shown below can be described as a cylinder with a varying radius. Using a y-coordinate…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Write an algorithm using pseudocode and draw the flowchart for the given problem. The Jungle…
A: Hello Student. Warm welcome from my side. Hope you are doing great. I will try my best to answer…
Q: Write a program that asks the user for two integers that will correspond to the numbering of the…
A:
Q: 1a - VAT Write a program that takes the price of an article including VAT and prints the price of…
A: """Program that takes the price of an article including VAT and printsthe price of the article…
Q: Given a positive integer n, the following rules will always create a sequence that ends with 1,…
A: 1)Read the n value using int(input()) function 2)print n value 3)repeat while until n!=1 4)…
Q: Repeatedly print the value of the variable xValue, decreasing it by 0.5 each time, as long as xValue…
A: Please find the answer below :
Q: In a retail store, they offer an anniversary sale for their specially designed T-shirts (A, B, and…
A: Hi. Let's move on to the code in the next step. I have included comments in the code that will…
Q: Design an algorithm for the following problem: "Given a set of n points in the Cartesian plane,…
A: - We have to develop an algorithm to check whether the n points of cartesian plane lies in a…
Q: PYTHON!!! For this question, we will use a simplified version of the Roman Numerals System to…
A: CODE : #include<iostream> using namespace std; //This function returns decimal value of given…
Q: Given a positive integer n, the following rules will always create a sequence that ends with 1,…
A: As per the requirement program is developed. Note: Here in the question programming language is not…
Q: In a 50-person class, students with grades below 70 are considered unsuccessful. Write an algorithm…
A: Algorithm: Step 1: Start Step 2: Declare grade variable Step 3: Input grade Step 4: if…
Q: Using Python, create a program that asks the user for a non-negative amount of money (in Pesos).…
A: - We need to have a menu based python program for currency.
Q: Phyton: Make a program that is useful to determine if the integers X, Y and Z, provided by the…
A:
Q: Create an algorithm that will convert change in the form of quarters, dimes, nickels, and pennies to…
A: ANSWER;-
Q: Suppose that the city of Sochi can be described as a 2D matrix. Each cell may or may not contain a…
A: Given we have to develop a python code to print the minimum number of baskets that will be required…
Q: ** Below is the image of my code so far, but it still needs work** * This program asks the user…
A: PROGRAM: import java.util.Scanner; //Create a class class Main{ //Define main() method…
Q: please code in python A classic example of this process is known as the "Drunkard’s Walk": a…
A: Solution: The python code for the above problem is given below. The screenshot of code and output…
Q: Given a positive integer n, the following rules will always create a sequence that ends with 1,…
A: Algorithm: 1. input a number 2.Condition checking that is number must be greater than 1 3.number is…
Q: Write this program with Python. Ask the user to enter a month with Zeller’s Algorithm, in text (e.g.…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: 3.1 How many seconds are in an hour? Use the interactive interpreter as a calculator and multiply…
A: >>> 60 * 603600
Q: Write a program in python to find the factorial of number and sum of digits if number..If the…
A: Program approach - Prompt user to enter the number. IF the number is less than equal to 10, then…
Q: python code
A: Prompt the user to input a starting balance and an interest rate. Compute the balance after 10…
Q: Given a positive integer n, the following rules will always create a sequence that ends with 1,…
A: for whitespaces of \t use end=‘\t’ , but if you don’t want these whitespaces , you can use end=‘ ’
Q: A regular polygon has n number of sides with each side of length s. The area of a regular polygon is…
A: Introduction : Here we have to write a program and the output of the program should be the area and…
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: Write and implement an algorithm that gets the amount of electricity used in kilowatt-hours and the…
A: Actually, the answer has given below:
Q: Please do this in Python Programming and provide screenshots The output should be exact same like in…
A: Please do this in Python Programming and provide screenshots The output should be exact same like in…
Q: Write a program with loops to solve each of the following (comment each block of code): Compute…
A: Given: Write a program with loops to solve each of the following (comment each block of code):…
Q: Do this using java script. Declare five variables a, b, c, d, e, and f. Assign a a number literal…
A: Step 1:- Note:-As per policy, we are entitled to answer the first three subparts only. JavaScripts…
Q: Complete the following program that collects an input word from the keyboard and finds if the word…
A: PROGRAM CODE: word = input("Enter a word: ") // take the word from the…
Q: Convert this flowchart into a java program code optimize your code by using only one for loop…
A: Program Explanation: Create a header file. Inside the main function take the for loop from 0 to 100…
Q: Create a program that will take a string ‘s’ and some integer ‘i’ from the user. Then proceed to…
A: Given:- Create a program that will take a string ‘s’ and some integer ‘i’ from the user. Then…
Q: Write a program vhich prompts the user for the values of a and b, and then prints out the value of…
A: Required: Java program to calculate Pythagoras theoram.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- The code below is given a sequence of positive integers to find the longest increasing and the longest decreasing subsequence of the sequence. draw the flowchart for the python code below. def prints(arr): for x in arr: print(x, end=" ") print() def constructPrintLDS(arr, n): l = [[] for i in range(n)] l[0].append(arr[0]) for i in range(1, n): for j in range(i): if arr[i] < arr[j] and (len(l[i]) < len(l[j]) + 1): l[i] = l[j].copy() l[i].append(arr[i]) maxx = l[0] for x in l: if len(x) > len(maxx): maxx = x prints(maxx) def constructPrintLIS(arr, n): l = [[] for i in range(n)] l[0].append(arr[0]) for i in range(1, n): for j in range(i): if arr[i] > arr[j] and (len(l[i]) < len (l[j]) + 1): l[i] = l[j].copy() l[i].append(arr[i]) maxx = l[0]…create an algorithm using flowchart that will show on how to cook spaghetti.Write and implement an algorithm that gets the amount of electricity used in kilowatt-hours and the cost of electricity per kilowatt-hour. Its output is the total amount of the electric bill, including an 8% sales tax. Write your answer to the following as multiple line comments at the beginning of your program.1. What are the data requirements of your program?2. Outline your algorithm using a pseudocode.
- *Can you create a flowchart for the follwoing python code. # printing the very first row with X, for i in range(0,13): if i == 0: print("X",end="\t") else: print(i, end="\t") print("\n") # nested for loop to print multiplication values for i in range(1,13): print(i, end="\t") #prints the first column for j in range(1,13): print(i*j, end="\t") # prints the multiplication value print("\n") i = 0 # initializing i for running the while loop # printing the very first row with X, because this row is static while i < 13: if i == 0: print("X",end="\t") else: print(i,end="\t") i = i + 1 # increasing the value of i by 1 each time print("\n") # nested for loop to print multiplication values index = 1 # initializing index for running the while loop while index < 13: print(index, end="\t") # it prints the first column j = 1 while j < 13: print(index*j, end="\t") # it prints the multiplication value j = j + 1 # increasing the value of j by 1 each time index = index + 1 #…in python, Write a wholly creative quiz program that consists of three original questions that you make up according to the specifications below. Provide positive or negative feedback to the user immediately after each question is answered. The quiz doesn't have to be scored. One question should require user input of type int One question should require user input of type float One should require a string input Plan each program by writing pseudocode. Write all of your pseudocode as comments immediately after your name and 2380093 Add more comments as needed in each program to explain your code. Choose descriptive variable names in all programs. Currency format. There should be no space between the $ sign and the first digit. See sep on page 66 to cancel the space automatically added when print items are separated by commas. Display commas as needed for values over $1,000.** Below is the image of my code so far, but it still needs work** * This program asks the user to enter an integer from 3 to 9* and prints a pattern of numbers based on that number.* For example, given the number 4 as input, the output would be:* * 1** 21** 321** 4321** 321** 21** 1** * Print a newline between the prompt and the beginning of the stars.* Note that no input validation is required.
- In a retail store, they offer an anniversary sale for their specially designed T-shirts (A, B, and C). For every Php 1000 total purchases, you will get a 5% discount on Shirt A. Assume that the prices for Shirts A, B, and C are Php50, Php75, and Php100, respectively. Write a program (using python) (with algorithm) that will accept the number of T-shirts purchase (or quantity) for each kind and will display the total purchases, discounted amount, and the amount to be paid (i.e. total purchase – discount). Sample Program Output 1 (with 5% discount): Sample Program Output 2 (with 2 x 5% discount):. A palindrome is a number or text phrase that reads the same backwards or forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a python program that reads a 5 digit integer and determines whether it is a palindrome. Hint: One way to do this is to use division (/) and modulus (%) operators to separate the number into individual digits.Given a positive integer n, the following rules will always create a sequence that ends with 1, called the hailstone sequence: If n is even, divide it by 2 If n is odd, multiply it by 3 and add 1 (i.e. 3n +1) Continue until n is 1 Write a program that reads an integer as input and prints the hailstone sequence starting with the integer entered. Format the output so that ten integers, each separated by a tab character (\t), are printed per line. The output format can be achieved as follows:print(n, end='\t') Ex: If the input is: 25 the output is: 25 76 38 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 this is what i have n = int(input())count = 1while n != 1: if count%10==0: print(n,'\t') else: print(n, end='\t') if n%2==0: n = int(n/2) else: n = int(n*3 + 1) count = count + 1 print(n) the output is correct but theres whitespaces that arnt needed
- Given a positive integer n, the following rules will always create a sequence that ends with 1, called the hailstone sequence: If n is even, divide it by 2 If n is odd, multiply it by 3 and add 1 (i.e. 3n +1) Continue until n is 1 Write a program that reads an integer as input and prints the hailstone sequence starting with the integer entered. Format the output so that ten integers, each separated by a tab character (\t), are printed per line. The output format can be achieved as follows:print(n, end='\t') Ex: If the input is: 25 the output is: 25 76 38 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 python please explain so i understandGiven a positive integer n, the following rules will always create a sequence that ends with 1, called the hailstone sequence: If n is even, divide it by 2 If n is odd, multiply it by 3 and add 1 (i.e. 3n +1) Continue until n is 1 Write a program that reads an integer as input and prints the hailstone sequence starting with the integer entered. Format the output so that ten integers, each separated by a tab character (\t), are printed per line. The output format can be achieved as follows:print(n, end='\t') Ex: If the input is: 25 the output is: 25 76 38 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 I can't figure out where the new line space is supposed to beGiven a positive integer n, the following rules will always create a sequence that ends with 1, called the hailstone sequence: If n is even, divide it by 2 If n is odd, multiply it by 3 and add 1 (i.e. 3n +1) Continue until n is 1 Write a program that reads an integer as input and prints the hailstone sequence starting with the integer entered. Format the output so that ten integers, each separated by a tab character (\t), are printed per line. The output format can be achieved as follows:System.out.print(n + "\t"); Ex: If the input is: 25 the output is: 25 76 38 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 (NEED HELP IN JAVA PLEASE)