A company is offering a special discount to its customers based on an algorithm. Two range values are fed to the algorithm and in return t will calculate the discount to offer to the customers. The discount is calculated as the sum of all the prime numbers within the defined range including the range values if the range values are the prime numbers
Write an algorithm to find the special discount given to the customers
Input
The first line of the input consists of
an integer-rangelet remeng
the minimum boundary wabererte
given range finding the p
values)
A company is offering a special discount to its customers based on an algorithm. Two range values are fed to the algorithm and in return t will calculate the discount to offer to the customers. The discount is calculated as the sum of all the prime numbers within the defined range including the range values if the range values are the prime numbers
Write an algorithm to find the special discount given to the customers
Input
The first line of the input consists of
an integer-rangelet remeng
the minimum boundary wabererte
given range finding the p
values)
Develop a python code to accept two numbers from the user to check whether those number
are divisible by both 3 and 5 or not .
(Geometry: area of a regular polygon) A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular). The formula for computing the area of a regular polygon is Here, s is the length of a side. Write a program that prompts the user to enter the number of sides and their length of a regular polygon and displays its area. Here is a sample run:
how to get right angle triangle when input is 5
Create a program that checks as to which stage an age is
Question #301749
Write a program to print W pattern of N lines using a asterisk(*) character
NOTE : There is a space after each asterisk (*) character.
Input:
The first line is an integer N
Explanation:
For N=5
The output should be
* * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
Create a program that displays the fare based on the entered destination. The starting station is Araneta-Cubao Use the code destination to shorten the user's input
Write a program to calculate the sum of cubes of differences of consecutive prime numbers entered from the keyboard. For e.g. for numbers 1,7,4,5,2,6,8,11 and 3, the program should calculate (7-5)3+(5-2)3+(2-11)3+(11-3)3
# Various Icecream flavors
menu_item1 = "Chocolate"
menu_item2 = "Vanilla"
menu_item3 = "Strawberry"
order = input("\nWhich flavors would you like on your icecream today?\n\n" +
"\n".join([menu_item1, menu_item2, menu_item3]) + "\n\n")
# Convert input to list of flavors.
order = order.lower().split()
plural = "s" if len(order) > 1 else " "
print("\nYou have selected " + ", " .join(order) + " flavor" + plural)Question 4: For lines 22-24, How do I get the code to be organized after the previous 3 questions have been answered and correct with the right code?
Example Output:
If:
Else:
My Output: Check Code above.