<jupyter_start><jupyter_text>ENGR 1330 Exam 1 Sec 003/004 Fall 2020Take Home Portion of Exam 1 Full name R: HEX: ENGR 1330 Exam 1 Sec 003/004 Date:  Question 1 (1 pts):Run the cell below, and leave the results in your notebook (Windows users may get an error, leave the error in place)<jupyter_code>#### RUN! the Cell ####
import sys
! hostname
! whoami
print(sys.executable) # OK if generates an exception message on Windows machines<jupyter_output>theodores-MBP
theodore
/opt/anaconda3/bin/python<jupyter_text>Question 2 (9 pts):- __When it is 8:00 in Lubbock,__    - __It is 9:00 in New York__    - __It is 14:00 in London__    - __It is 15:00 in Cairo__    - __It is 16:00 in Istanbul__    - __It is 19:00 in Hyderabad__    - __It is 22:00 in Tokyo__ __Write a function that reports the time in New York, London, Cairo, Istanbul, Hyderabad, and Tokyo based on the time in Lubbock. Use a 24-hour time format. Include error trapping that:__1- Issues a message like "Please Enter A Number from 00 to 23" if the first input is numeric but outside the range of [0,23].2- Takes any numeric input for "Lubbock time" selection , and forces it into an integer.3- Issues an appropriate message if the user's selection is non-numeric.__Check your function for these times:__- 8:00- 17:00- 0:00<jupyter_code># Code and run your solution here:<jupyter_output><empty_output><jupyter_text>Question 3 (28 pts): Follow the steps below. Add comments to your script and signify when each step and each task is done. *hint: For this problem you will need the numpy and pandas libraries.- __STEP1: There are 8 digits in your R. Define a 2x4 array with these 8 digits, name it "Rarray", and print it__- __STEP2: Find the maximum value of the "Rarray" and its position__- __STEP3: Sort the "Rarray" along the rows, store it in a new array named "Rarraysort", and print the new array out__- __STEP4: Define and print a 4x4 array that has the "Rarray" as its two first rows, and "Rarraysort" as its next rows. Name this new array "DoubleRarray"__- __STEP5: Slice and print a 4x3 array from the "DoubleRarray" that contains the last three columns of it. Name this new array "SliceRarray".__- __STEP6: Define the "SliceRarray" as a panda dataframe:__    - name it "Rdataframe",    - name the rows as "Row A","Row B","Row C", and "Row D"    - name the columns as "Column 1", "Column 2", and "Column 3"- __STEP7: Print  the first few rows of the "Rdataframe".__- __STEP8: Create a new dataframe object ("R2dataframe") by adding a column to the "Rdataframe", name it "Column X" and fill it with "None" values. Then, use the appropriate descriptor function and print the data model (data column count, names, data types) of the "R2dataframe"__- __STEP9: Replace the **'None'** in the "R2dataframe" with 0. Then, print the summary statistics of each numeric column in the data frame.__- __STEP10: Define a function based on the equation below, apply on the entire "R2dataframe", store the results in a new dataframe ("R3dataframe"), and print the results and the summary statistics again.__  $$ y = x^2 - 5x +7 $$- __STEP11: Print the number of occurrences of each unique value in "Column 3"__- __STEP12: Sort the data frame with respect to "Column 1" with a descending order and print it__- __STEP13: Write the final format of the "R3dataframe" on a CSV file, named "Rfile.csv"__- __STEP14: Read the "Rfile.csv" and print its content.__** __Make sure to attach the "Rfile.csv" file to your midterm exam submission.__<jupyter_code># Code and Run your solution here:<jupyter_output><empty_output><jupyter_text>Problem 4 (32 pts)Graphing Functions Special Functions Consider the two functions listed below:\begin{equation}f(x) = e^{-\alpha x}\label{eqn:fofx}\end{equation}\begin{equation}g(x) = \gamma sin(\beta  x)\label{eqn:gofx}\end{equation}Prepare a plot of the two functions on the same graph. Use the values in Table below for $\alpha$, $\beta$, and $\gamma$.|Parameter|Value||:---|---:||$\alpha$|0.50||$\beta$|3.00||$\gamma$|$\frac{\pi}{2}$|The plot should have $x$ values ranging from $0$ to $10$ (inclusive) in sufficiently small increments to see curvature in the two functions as well as to identify the number and approximate locations of intersections. In this problem, intersections are locations in the $x-y$ plane where the two "curves" cross one another of the two plots.  By-hand evaluate f(x) for x=1, alpha = 1/2 (Simply enter your answer from a calculator)f(x) =  By-hand evaluate g(x) for x=3.14, beta = 1/2, gamma = 2 (Simply enter your answer from a calculator)g(x) =<jupyter_code># Define the first function f(x,alpha), test the function using your by hand answer
# Define the second function g(x,beta,gamma), test the function using your by hand answer
# Built a list for x that ranges from 0 to 10, inclusive, with adjustable step sizes for plotting later on
# Build a plotting function that plots both functions on the same chart
# Using the plot as a guide, find the approximate values of x where the two curves intercept (i.e. f(x) = g(x))
# You can either use interactive input, or direct specify x values, but need to show results<jupyter_output><empty_output><jupyter_text>Bonus Problem 1. Extra Credit (You must complete the regular problems)!__create a class to compute the average grade (out of 10) of the students based on their grades in Quiz1, Quiz2, the Mid-term, Quiz3, and the Final exam.__| Student Name  |   Quiz 1   |   Quiz 2   |   Mid-term   |   Quiz 3   |  Final Exam  || ------------- | -----------| -----------| -------------| -----------| -------------|| Harry         | 8          | 9          | 8            | 10         | 9            || Ron           | 7          | 8          | 8            | 7          | 9            || Hermione      | 10         | 10         | 9            | 10         | 10           || Draco         | 8          | 7          | 9            | 8          | 9            || Luna          | 9          | 8          | 7            | 6          | 5            |1. __Use docstrings to describe the purpose of the class.__2. __Create an object for each car brand and display the output as shown below.__"Student Name": **Average Grade**  3. __Create and print out a dictionary with the student names as keys and their average grades as data.__<jupyter_code>#Code and run your solution here:<jupyter_output><empty_output><jupyter_text>Bonus 2 Extra credit (You must complete the regular problems)! Write the VOLUME Function to compute the volume of Cylinders, Spheres, Cones, and Rectangular Boxes. This function should:- First, ask the user about __the shape of the object__ of interest using this statement:*"Please choose the shape of the object. Enter 1 for "Cylinder", 2 for "Sphere", 3 for "Cone", or 4 for "Rectangular Box""*- Second, based on user's choice in the previous step, __ask for the right inputs__.- Third, print out an statement with __the input values and the calculated volumes__. Include error trapping that:1. Issues a message that **"The object should be either a Cylinder, a Sphere, a Cone, or a Rectangular Box. Please Enter A Number from 1,2,3, and 4!"** if the first input is non-numeric.2. Takes any numeric input for the initial selection , and force it into an integer.4. Issues an appropriate message if the user's selection is numeric but outside the range of [1,4]3. Takes any numeric input for the shape characteristics , and force it into a float.4. Issues an appropriate message if the object characteristics are as non-numerics. Test the script for:1. __Sphere, r=10__2. __r=10 , Sphere__3. __Rectangular Box, w=5, h=10, l=0.5__- __Volume of a Cylinder = πr²h__- __Volume of a Sphere = 4(πr3)/3__- __Volume of a Cone = (πr²h)/3__- __Volume of a Rectangular Box = whl__<jupyter_code>#Code and Run your solution here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09037453662277899, 'fraction_numerical': 0.028633516553751757, 'mean_word_length': 3.4862385321100917, 'pattern_counts': {'":': 1, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '223866', 'license': 'CC0-1.0', 'n_tokens_mistral': 2423, 'n_tokens_neox': 2231, 'n_words': 1120, 'path': '5-ExamProblems/Exam1/Exam1/fall2020/Exam1-Deploy-Student-Version.ipynb', 'repo_name': 'dustykat/engr-1330-psuedo-course', 'size': '7823'}