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

1. Here is a list of integers. Find the elements that are the square of any number m.
2. The sequence of natural numbers a1, a2, ..., an is given. Replace the terms greater than the given number Z. with this number. Calculate the number of substitutions.
3. The sequence of natural numbers a1, a2, ..., an is given. There are positive and negative elements in the chain. Calculate the product of negative elements P1 and the product of positive numbers P2. Compare the modules P2 and P1, indicate which of the modulus is greater.
The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.



Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.

Off you go!

Activity #5 – Applying Functions The output of this activity will be the same as activity #3 but instead you are required to use a function for the following algorithm:

1. A function for getting the length of each string

2. A function to get the shortest string

3. And a function to get the longest string Assume that each string has its own unique length.


Sample Run:


Sample Run A


Enter value of X: 3

Enter string value: a

Enter string value: ab

Enter string value: abc

a - total length is 1

ab - total length is 2

abc - total length is 3

The shortest string is a

The longest string is abc


Sample Run B


Enter value of X: 4

Enter string value: chico

Enter string value: strawberry

Enter string value: banana

Enter string value: guyabano

chico - total length is 5

strawberry - total length is 10

banana - total length is 6

guyabano - total length is 8

The shortest string is chico

The longest string is strawberry


how to print the following half pyramid pattern of numbers

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
3. The sequence of natural numbers a1, a2, ..., an is given. There are positive and negative elements in the chain. Calculate the product of negative elements P1 and the product of positive numbers P2. Compare the modules P2 and P1, indicate which of the modulus is greater.
2. The sequence of natural numbers a1, a2, ..., an is given. Replace the terms greater than the given number Z. with this number. Calculate the number of substitutions.
1. Here is a list of integers. Find the elements that are the square of any number m.

You are assisting a Coffee Shop create a program to run at their kiosk for customers to purchase their items. You will create a program to create a dictionary of their current coffee products and prices:

Coffee item Price

Hot brew $4.25

Latte  4.75

Mocha  4.99

Cold brew  3.95

Cappuccino  4.89

Donut        1.50

Create a program in Python to accept input from a customer inquiring what item they would like to purchase. Customers can purchase more than one item. Test to see if the item they request is in your dictionary – if not display a message that you don’t currently carry that item. Total up the costs of all the items they wish to purchase and then display to them their total bill, including 7% tax.  


Write a statement that asks the user to enter the year and convert it to an integer. Store the resulting information in a variable called year.


 Calculate the first 50 perfect cubes and store them in a list. Do not calculate them individually with fifty separate calculations. Use a loop. Each time through the loop, the program should calculate a perfect cube and append it to the list. 2. Use another loop to traverse the list and display the numbers in order.


LATEST TUTORIALS
APPROVED BY CLIENTS