Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

(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.


# 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 3: For lines 22-24, how do I include an "and" word to always be included for 2 or more flavors regardless if I respond to the input code with "Chocolate Vanilla Strawberry" or "Chocolate Vanilla and Strawberry"?


Example Output: You have selected Chocolate, Vanilla and Strawberry flavors


My Output: You have selected Chocolate, Vanilla, Strawberry flavors


# 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: For lines 22-24, how do I hide the comma's when responding to the input code with choosing 2 or less flavors?


Example Output: You have selected Chocolate and Vanilla flavors


My Output: You have selected Chocolate, and, Vanilla flavors


# 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: For lines 22-24, how do I add a comma for just the first flavor when responding to the input code with choosing 3 or more flavors?


Example output: You have selected Chocolate, Vanilla and Strawberry flavors


My Output: You have selected Chocolate, Vanilla, and, Strawberry flavors