Python coding | programming logic and design

For this lab, and every lab: comment your code. If you  use/adapt code from the internet, you must add a comment with the source  of the code.

Reading: Chapter 3 https://automatetheboringstuff.com/2e/chapter3/

Activity – Python Tutor: Try at least one program in Python Tutor http://www.pythontutor.com/ 

Question 1: Greetings Function! (4 points)

Start with the greeting program, the first program with functions we  used in Python Tutor. This time, the computer is very happy to meet  you.  Modify the function to return the user’s name in uppercase, with  !!!! after it.  So, if the user’s name is Miriam, the greeting function  will return ‘HELLO MIRIAM!!!!’

Question 2: Quiz question function (6 points)

Write a function that takes two arguments – a quiz question and the correct answer. 

In your function, you will print the question, and ask the user for  the answer. If the user gets the answer correct, print a success  message. Else, print a message with the correct answer.   Your function  does not need to return anything.

Call your function with two example quiz questions.   Here’s some suggestions, 

  • Q: What year did Apollo 11 land on the moon? A: 1969
  • Q: Who painted the Mona Lisa? A: Leonardo da Vinci

Question 3: Windows 10 Upgrade (10 points)

When installing Windows 10, a user can either wipe everything from  their computer and do a clean install.  Or if their computer meets  system requirements, the user can upgrade to Windows 10 without erasing  their current operating system.

To do the upgrade, according to Microsoft, a computer needs to have  at least 1GB of memory, and at least 1GHz processor, and either Windows 7  or Windows 8 currently installed.   All three requirements must be  met. 

Write a program that asks the user for

  • The current memory in their computer, in GB.  (For example, a user with 8GB of memory would enter 8)
  • The current processor speed, in GHz. (For example, a user with a 2.6GHz processor should enter 2.6)
  • The name of their current operating system. (For example, a user could enter Windows 8 or Windows 7 or Windows XP)

Write a can_upgrade function that takes three arguments, the amount of memory, the processor speed, and current operating system.

In can_upgrade, use conditions to figure out if the  user’s computer can be upgraded to Windows 10 or not.  Your function  should return one of the Boolean values True (if the computer can be  upgraded) or False (if it can’t be upgraded).

Call your can_upgrade function from main(), and use the return value to print a message to the user telling them if they can, or can’t, upgrade.

Extra Credit Question: (+5 points)

Start with the College ID card program from https://gist.github.com/claraj/b993219477d015d58341c4f3c1950a22.  This has no functions but it would benefit from being re-organized into  functions. Refactor this program. Suggestions – functions for  validation, functions to help print the college ID card, for example  printing a line of —-, printing centered text, printing text in  color. 







Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Get 15% OFF on your FIRST order. Use the coupon code: new15