# We Helped With This Python Programming Assignment: Have A Similar One?

SOLVED
Category Programming Python College Solved Python Assignments

## Short Assignment Requirements

I have five labs that I need to submit by EOD tomorrow. I can send the last two later, but they are all the same format. They are all "beginner" Python coding Labs and should only take minutes for someone who knows what they're doing.

## Assignment Description

Purpose. The purpose of this exercise is to provide more practice in writing programs that (1) read numbers from an input file, (2) perform calculations, and (3) show output results.

Background. You know how to read multiple values from an input file. You know how to store them as numbers. You know how to addition, multiplication, and division. And you know how to echo input values and print calculated results. That's all you need to know in order to do this exercise.

Your Turn. Write a program that reads five numbers from input prompts, adds them to get their total, and calculates their average by dividing their total by 5. For these numbers, use the present temperatures from 5 different cities in the world — degrees C or F — your choice. The output should something like this:

The total of 67.6 87. 7 67.8 56. 8 89.9 1 s 369 . 8øØØØØØOØøø007

The average of 67.6 87. 7 67.8 56. 8 89.9 1 s 73. 96øØØØØØØØØ001

But wait — let's do something about all those zeros! Here's how to round off a number to a maximum of two decimal digits, using a variable name "average" for storing the calculated average:

 overage overage

Statements like this belong in the calculations code block, after the variable "average" gets calculated and before "average" gets printed in the output code block, like this:

 G average averaoe b c d average

This is the first time we're seeing a calculation that has the same variable name appearing twice. In this case, the original number stored in average (in this case, 73.96000000000001) gets replaced with an updated, rounded-off value (in this case, it should be 73.96). Apply this, so that your program shows something like this:

The total of 67.6 87.7 67.8 56.8 89.9 is 369.8

The average of 67.6 87. 7 67.8 56.8 89.9                                  73.96

I also rounded the total to one decimal digit before printing it, using the following: notice the pattern?

Submitting Your Work. Submit your work as you did in previous exercises, submitting the contents of the repl.it "edit" box.

Comsc 101                                                             Page I of2                                    Programming Exercise 7

For the second program:

Calculate the total miles driven, the average miles driven for the five days.

The amount of gas used to drive these total miles and the miles per gallon used for the total trip.

Use all the information you learned at the beginning of this lesson.

This is the log for the trip. Input the following.

 Day I 256 miles driven using 1 1 gallons Day 2 276 miles driven using 13 gallons Day 3 296 miles driven using 16 gallons Day 4 210 miles driven using 1 1 gallons Day 5 83 miles driven using 9 gallons

Submitting Your Work. Submit your work as you did in previous exercises, submitting the contents of the repl.it "edit" box. Name this program: Exercise 7 B

Comsc 101                                                             Page 2 of 2                                   Programming Exercise 7

## Assignment Description

Programming Exercise 6: Doing The Math

Purpose. The purpose of this exercise is to show the difference between two types of data — text and numbers, and how math computations can be performed with numbers. It also demonstrates how comments can be placed anywhere — not just in the comment block. See the sample below.

Background. In all previous exercises, the input got read as text. That's the default for Python. Even if the text involves digits and is intended as a number, it is still just text. That is, the computer does not distinguish between letters and numbers on the keyboard — it's all just series of keystrokes. Remember adding the first and last names in the previous assignment? Adding 1 and 1 in the same way would result in 11. Try this:

 12345     6 b  input('b: ')8                                                                          9                 c       a         b10  11  print (a, 'plus' , b I plus i equalB Il None

To specify that a variable should store a number, do something like this, for a decimal use float or for a whole number use int . )

 1 z 3 4S 68911 Pot, St                 L xe ec•i ss_ab   floatanput('b: t            cal c                           print (a, )) bloc Kequals' , c) 1.0 plug 1.0 equals 2.0 None

"float" is an abbreviation for "floating point number". The "floating point" is the decimal in numbers that have a fractional part — like 1% is 1.5, and the period in 1.5 is the "floating point".

PROGRAM 1: Your Turn. Write a program that converts a temperature (from an input prompt) from degrees Centigrade to degrees Fahrenheit. The calculation is f 9 * c / 5 + 32, where c is the temperature in degrees C (the input), and f is degrees F (the output). You recognize the plus sign, but what are these others — the slash and the asterisk? / is for division; * is multiplication. This multiplies 9 times degrees C, divides that result by 5, and then adds 32.

Comsc 101     Page I of 2      Programming Exercise 6 Your output should look like this: 100 . 0 degrees c equals 212 . 0 degrees F. It should "echo" the value read from an input prompt (in this case, 100.0) and print the calculated variable (here, 212.0), with nice labeling to identify each.

Check your work by comparing these easy reference points: -40C is -40F (the only point where C and F are the same), OC is 32F (the freezing point of water), and IOOC is 212F (the boiling point of water)

Convert the following: 12 c, 45 c, 32 c 75 c.

Submitting Your Work. Do a snippet of the code and printout, and paste the image to a word document or copy and paste the code onto a word document and Submit your work as you did in previous exercises. Label the program Exercise 6.

Program 2: When given an unknown length in inches, calculate how many centimeters it is.

Write a program in which a user will input a number in inches and the computer will convert the inches to centimeters.

The input number must be a decimal number.

Input these numbers: 34.75,         45.67,       10,       12.5

There are 2.54 centimeters per inch.

Copy the codes to word document and submit as program "Exercise 6C

Comsc 101                                                             Page 2 of 2                                   Programming Exercise 6

## Assignment Description

##### Programming Exercise 5A: Doing Text “Concatenation”

Purpose. The purpose of this exercise is to show how text stored in variables can be concatenated, or joined, to form new text sequences. It allows you to control spacing!

This introduces a new code block that comes between the variables code block and the output code block. It’s the “calculations code block”. It creates additional variables, but their values are not hard-coded, and not interactive (from input statements). They are calculated based on values stored in other variables.

Background. Here’s how to concatenate variables containing text. Presuming that the variables myFirstName and myLastName already exist, we can create new variables like this:

Then you can simply print one of these new variables, like this: print(myName).

Note that concatenation does not include spacing like the print statements with multiple, comma-separated values does. So the programmer has to put these in, like the text with one spacebar character separating first and last name above, and the space after Ms. above.

Your Turn. Rewrite the program from exercise 4 so that there are no print statements with multiple, comma-separated values. Create concatenated variables in a calculations code block to combine into new variables what’s in each of exercise 4’s print statements. Even if a print statement has just one text value (like print('Congratulations!')), store that is a variable in the calculations code block. Each print statement should print a variable, only.

Don’t get the idea that print statements should always print just variables, and that text should always be concatenated for later printing – that’s not the case at all. We’re just doing so here in order to show how concatenation works.

Submitting Your Work. Use the Snippet’s edit program.  Copy the code you used and the results. Submit your work contents of the repl.it “edit” box.

Is it free to get my assignment evaluated?

Yes. No hidden fees. You pay for the solution only, and all the explanations about how to run it are included in the price. It takes up to 24 hours to get a quote from an expert. In some cases, we can help you faster if an expert is available, but you should always order in advance to avoid the risks. You can place a new order here.

How much does it cost?

The cost depends on many factors: how far away the deadline is, how hard/big the task is, if it is code only or a report, etc. We try to give rough estimates here, but it is just for orientation (in USD):

 Regular homework \$20 - \$150 Advanced homework \$100 - \$300 Group project or a report \$200 - \$500 Mid-term or final project \$200 - \$800 Live exam help \$100 - \$300 Full thesis \$1000 - \$3000

How do I pay?

Credit card or PayPal. You don't need to create/have a Payal account in order to pay by a credit card. Paypal offers you "buyer's protection" in case of any issues.

Why do I need to pay in advance?

We have no way to request money after we send you the solution. PayPal works as a middleman, which protects you in case of any disputes, so you should feel safe paying using PayPal.

Do you do essays?

No, unless it is a data analysis essay or report. This is because essays are very personal and it is easy to see when they are written by another person. This is not the case with math and programming.

Why there are no discounts?

It is because we don't want to lie - in such services no discount can be set in advance because we set the price knowing that there is a discount. For example, if we wanted to ask for \$100, we could tell that the price is \$200 and because you are special, we can do a 50% discount. It is the way all scam websites operate. We set honest prices instead, so there is no need for fake discounts.

Do you do live tutoring?

No, it is simply not how we operate. How often do you meet a great programmer who is also a great speaker? Rarely. It is why we encourage our experts to write down explanations instead of having a live call. It is often enough to get you started - analyzing and running the solutions is a big part of learning.

What happens if I am not satisfied with the solution?

Another expert will review the task, and if your claim is reasonable - we refund the payment and often block the freelancer from our platform. Because we are so harsh with our experts - the ones working with us are very trustworthy to deliver high-quality assignment solutions on time.

Customer Feedback

"Thanks for explanations after the assignment was already completed... Emily is such a nice tutor! "

Order #13073

Find Us On