Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

ME/MSE 241 Engineering Computations Homework Assignment

ME/MSE 241 Engineering Computations Homework Assignment

ME/MSE 241 Engineering Computations Homework Assignment – 1

Instructions:

1) Include comments for every few lines (or even each line) of code as relevant.

2) Use a consistent naming convention.

3) If using Python scripts (.py), create one file for each problem solution. Name the files __.py.

4) If using the notebook format (.ipynb), use a single cell for each problem solution. Name the file _.ipynb.

5) Do not hesitate to ask for help, there are no trivial questions!

Note: 1. All the problems can be solved using the concepts we covered in the lectures.

2. Do not use modules or create functions. Just write plain scripts for this assignment.

Problem 1 (12 pts)

Write a simple program using string indexing and slicing to modify a given string (use the input

function). The modified string should be reversed except the first and last characters. For example, if the

input is “Pullman” the output should be “Pamllun”.

Problem 2 (12 + 12 + 12 pts)

Write a program using a for loop to:

(a) Compute the reverse of a given string by accumulating it in a new string object (do not use slicing

to reverse the string).

(b) Print the movie quote below with each word reversed and uppercase characters replaced by

lowercase characters (assume the punctuation characters are part of the word):

“You see, in this world there’s two kinds of people, my friend: Those with loaded guns and those

who dig. You dig.”

This is the expected output: “uoy ,ees ni siht dlrow s’ereht owt sdnik fo ,elpoep ym :dneirf esoht

htiw dedaol snug dna esoht ohw .gid uoy .gid”

(c) Print the following pattern consisting of asterisks separated by spaces (you may have additional

spaces before and after the pattern).

Note: Write a generic program that can be easily extended to similar looking patterns, do not

specialize for this specific pattern. For example, I should be able to generate a wider pattern by

just changing a single value in the program. The goal of a program should always be automation.

Hint: Variables can be used in format specification. Example:

w = 6

f”{1.1545: >{w}.2}”

Problem 3 (12 + 20 + 20 pts)

Again, use a for loop to do the following (do not use the built-in function sum):

(a) Write a short program to determine the sum of the squares of first ?? natural numbers where ?? is a user input obtained through the input function.

(b) Given a set of temperatures in Fahrenheit as a tuple,

tempDataF = (36, 40, 28, 32, 22, 52, 44, 35, 40, 37)

write a program to convert the units to Celsius and compute the mean value in Celsius and

Fahrenheit. Present the results in a tabulated form as shown below.

(c) Construct a list consisting of the first 50 Fibonacci numbers through an accumulator. The

Fibonacci numbers satisfy these conditions:

??1 = 1,??2 = 1

????+2 = ????+1 + ????

Here, ???? is the ?? th number in the sequence.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Blackboard Experts only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Blackboard Experts are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Blackboard Experts is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Blackboard Experts, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.