Write a program that determines the Riemann integral of a function f on the interval [0,1] in different ways.Output the results of the calculations and the plot for the function f= sin(πx) as an example. First divide the interval into n equal sub intervals and then determine the values of the corresponding upper and lower […]
Python
Write a program that encodes an input plaintextxwith a one-time pad.Start by assigning a number to each letter,a→0,…,z→25, using string.asciilowercase to get the alphabet.
Write a program that encodes an input plaintextxwith a one-time pad.Start by assigning a number to each letter,a→0,…,z→25, using string.asciilowercase to get the alphabet. For simplicity, you can assume that x contains only the letters a,b,c,…z.First write two functions that you can use to convert a given text intoa list of numbers (and back to […]
A donut is defined by the following parameter representation: Write a classDonut whose constructor takes over R and r. ̈Consider sensible default values.
A donut is defined by the following parameter representation: Write a classDonut whose constructor takes over R and r. ̈Consider sensible default values. If R > r does not apply, then issue a warning to the user and adjust R so that the assurance is fulfilled.Use NumPy to implement the methods for x,y and z.Find […]
Create a list of the respective energy values for a mini-drone with a mass of 250g, a midi-drone with a mass of 570g and a maxi-drone with a mass of 900g for the heights 1 to 120 metres (step size 1m).
Attention:You must not use loops in this task! A drone of massem(in kilograms) has a potential energy (in joules) of E=mgh(gis the acceleration due to gravity ofrounded 9.81m/s2) at height h (in metres). Create a list of the respective energy values for a mini-drone with a mass of 250g, a midi-drone with a mass of […]
Python program for an online MoonBucks coffee order.
Coffee is sold by the pound, and the price per pound depends upon the quantity ordered according to the table shown below. Partial pounds are not sold. Shipping is $1.00 per pound, but free for coffee orders over $150 before tax.
Write a program that keeps names and emails addresses in a dictionary as key-value pairs.
First print all keys with their value using for loop.then the program should display a menu that lets user look up a person’s email address, add a new name and email address, change an existing email address and delete an existing name and email address.
Write a program that reads a list of scores and then assigns grades based on the following scheme:
Write a program that reads a list of scores and then assigns grades based on the following scheme: The grade is A if score is >= best – 10. The grade is B if score is >= best- 20. The grade is C if score is > = best – 30 The grade is D […]