Design the logic for a program that allows a user to enter 10 numbers, then displays the element number, value in the element, and its squared.
The language is Python
I have included my code and screenshots in this answer. In case, there is any indentation issue due to editor, then please refer to code screenshots to avoid confusion.
--------------------main.py--------------------
numbers = [] #Create an list for storing the numbers
for i in range(10):
num = int(input("Enter number " + str(i+1) + ": "))
#read 10 numbers from the user
numbers.append(num) #store each num in the list by
appending
print("\n\nOutput")
for i in range(10): #for each number, print its position, value and
square
print("\nElement number " + str(i+1) + " : Value = " +
str(numbers[i]) + ", Square = " +
str(numbers[i]*numbers[i]))
--------------------Screenshot of main.py--------------------
--------------------Output-----------------------
-------------------------------------------------
I hope this helps you,
Please rate this answer if it helped you,
Thanks for the opportunity
Design the logic for a program that allows a user to enter 10 numbers, then displays...
Design the logic for a program that allows a user to enter 10 numbers, then displays all of the numbers, the sum and average of the numbers. (Use array and loop.) the pseudocode in python please
Design the logic for a program that allows the user to enter a maximum of 10 numbers. If the use enters a -1 the input loop stops early. The value -1 is not data but a quit flag value that is not entered into the array. Then the program displays the count of the numbers entered and numeric average of the numbers (not including the -1 of course). After display the average of all the entered numbers, the program will...
a. Design the logic for a program that allows a user to enter 12 numbers, then displays them in the reverse order of entry. b. Modify the reverse-display program so that the user can enter any amount of numbers up to 12 until a sentinel value is entered. ( I really could use more of a pseudocode rather than actual code. also an explanation of each step. The answer I got last time was just c++ code that including a...
write a python program that allows the user to enter two integer values, and displays the results when each of the following arithmetic operators are applied
Design a program that allows the user to enter 5 names into a String array. Sort the array in ascending (alphabetical) order and display its contents. Search the array for a specific name that the user wants. For this problem you will be submitting python homework, no flowchart
write pseudocode to represent the logic of a program that allows the user to enter a value for the radius of a circle. The program calculates the diameter by multiplying the radius by 2, and then calculates the circumference by multiplying the diameter by 3.14. The program outputs both the diameter and the circumference.
must be in python p p+ 1 endwhile 2. Design a program that allows a user to enter any quantity of numbers until a negative number is entered. Then display the highest number and the lowest number
The Assignment Design a Visual Logic flowchart for a program that prompts the user to enter ten numbers one at a time. Use Console I/O (not the GUI interface). After the user has entered all ten number the program will then print out the total of those ten number and quit. Here is one example of what the program might look like when run: Please enter a number: 5 Please enter a number: 10 Please enter a number: 2 Please...
the author's pseudocode it follows this template 3 Design the logic for a program for Nos Encanta Tu Interés credit card company that a) Allows the user to enter their name, credit card number, beginning balane and monthly interest rate b) For the next full year (12 months), 1. Outputs the month number and the balance at the beginning of the month 2. Allows the user to enter the amount of their payment, and the amount of their purchases for...
Write a program that asks the user to enter number, and displays all the numbers that are multiples of 2 and 5 smaller than or equal to the number entered by the user. Hint: A number n is a multiple of 2 if the remainder of the division of n by 2 is equal to zero. Your program should have an output similar to the following: Please enter a number: 50 The multiples of 2 and 5 less than or...