# Python

Problem 1 15pts: 1a) 3pts-In NumPy, create an array of points between -5 and 11.323 with spacing .0285. If you can not do this exactly, how close can you g 1b) 3pts - Using vectorization, plot f(x) = 3x¹+3x²+2 for-5≤ x ≤ 11.323. Make sure your graph is labeled. 1c) 3pts - Using vectorization in Python, find the sum + (( 4 )*'- * (4) + ¹) for n = 30, 50. 1d) 3pts - For the integers less than 10,000, what is the sum of those numbers which are divisible by 7, 13, or 18?

Problem 11.4 - Keeping track of Time Elapsed in a Race Write a function called mul_time that takes a Time_Elapsed object and a number and returns a new Time_Elapsed object that contains the product of the original object and the number. Then use mul_time to write a function that takes a Time_Elapsed object that represents the finishing time in a race, and a number that represents the distance, and returns a Time object that represents the pace (time per mile). The function should return a nicely formatted pace in hour, minutes and second per mile

Problem 11.3 Let's say that we want a class to represent a rectangle which is located somewhere in the XY plane. To keep things simple, assume that the rectangle is oriented either vertically or horizontally, never at an angle. posn is a Point object specifying the upper left corner of the rectangle.

Problem 11.2 Add a method slope_from_origin() which returns the slope of the line joining the origin to the point.

11HW Object Oriented Programming Problem 11.1 Add a method reflect_y to the Point class (the one we built in the lecture) which returns a new Point, one which is the reflection of the point about the y-axis.

Write a Perl/Python script (1ab1p2.py or labip2.pl) to do the following: 1. Generate 1000 samples from a gaussian distribution with mean 480mV and standard deviation of 5%. 2. For each generated sample V₁ (among the 1000 samples), calculate the corresponding Subthreshold and ON Current. 3. Generate a file variation_analysis.txt containing 4 columns as shown below, fist column contains the Sample Number, second column enumerates the value of V₁, third column represents the calculated Subthreshold Current and fourth column represents the ON Current values. 4. The final row should contain the maximum and minimum ratio of Imax Imin of the values in columns 3 and 4.

ENGR 102 - Fall 2022 Lab: Topic 8 (team) Deliverables: There are several deliverables for this team assignment. Please submit the following files to Canvas and zyBooks: • ascii_clock_planning.pdf • ascii_clock_XX.py where XX represents the initials of the team member • ascii_clock.py Activity #1: Top-Down Design of a Program - team Following the process described in the lecture, as a team perform a top-down design for the program described below. AFTER you plan your program, write the code. Write a program to take as input from the user a time and display that time using ASCII art. Format your output using the examples shown below. Draw each digit three (3) characters wide and five (5) characters tall, using only spaces and that digit. Draw one space between numbers. Draw the colon one (1) character wide. You do NOT need a leading zero or blank space for times earlier than noon.

Assignment-1 (35pts) Implement totally ordered multicasting using Lamport's algorithm. Each process conducts local operations and numbers them as PID.EVENT_ID. After each operation is done, a process multicasts the event to all other processes in the distributed system. The expected outcome of this assignment is that events occurred at different processes will appear in the same order at each individual process. To realize such a total order of events, each process maintains a buffer for received events and follow the rules on slide 19 in Lecture 6 when delivering the events. In this assignment, the delivery of events is simply printing them on screen, in the format of CURRENT_PID: PID.EVENT_ID. HINT: You may use two threads in each process to handle the communication and deal with message delivery, respectively. Refer to the multi-threaded server example discussed in class. The communication thread enqueues updates in a buffer, from where the delivery thread enforces a total order of events. The communication thread is also responsible for sending acknowledgements for received messages.

Practice writing assertions in Python Shell. (You can test: min(), max(), len(), .split(),.remove(), .pop(), str(), int() or whatever your heart desires!)

I Complete the function favoriteFlower). Note that the program will not run as is because the function is incomplete. The purpose of the function is to determine if the given flower is in the top three of my favorite flowers. The starter file defines a list of favorite flowers that is ordered most favorite to least favorite. Please pass the flower name and the flower list as arguments in the function. The expected output is