Write a Python script that allows the user to enter a number

Assignment Help Python Programming
Reference no: EM132285355

Introduction to Programming Assignment -

To get started: Create a new folder cs104PA1.

Leap Year

As the earth orbits around the sun, it takes 365 and one-quarter days to complete an orbit. To make the adjustment for the quarter day, we add one day every 4 years to the calendar and that's the origin of the leap year. However, in so doing, there is a slight error that creeps in and to compensate for this error, years those are divisible by 100, but not by 400 are not considered leap years.

So, to summarize the definition of a leap year:

  • If a number is not divisible by 4, it is not a leap year.
  • If a number is divisible by 100 but not by 400, it is not a leap year.
  • If a number is divisible by 100 and 400, it is a leap year.
  • If a number is not divisible by 100 but divisible by 4, it is a leap year.

You have to write a Python script that allows the user to enter a number greater than 100 as the year and print a message saying whether it is a leap year or not. Note that, if the user enters a number less than or equal to 100, then your program should display an error message.

Shoppers Paradise -

Shoppers paradise wants an application that displays the number of reward points a customer earns each month. The rewards points are based on the customer's membership type and total monthly purchases amount as follows:

Membership Type

basic

standard premium

Write a complete Python monthly purchases amount integer. The user interface of your script may look like as follows: Save your script as "PA1_Question2.py" in the cs104PA1 folder.

Documentation and style -

The file should begin with a descriptive comment explaining what it is for.

Use meaningful names for variables.

Use helpful prompts when asking the user to enter values.

Provide a meaningful description as part of the output.

Do not worry about formatting the number of decimal places in the output.

Attachment:- Assignment File.rar

Reference no: EM132285355

Questions Cloud

Discuss various aspects : Discuss various aspects, advantages, disadvantages, application scenarios, comparison, etc.. of the RAD model.
Create an external assessment report : As a senior executive of LinkedIn, you have been asked to create an external assessment report as to the threat posed by Facebook,
Equipment and servers in particular : Why is it si important to keep track of who had access to the equipment and servers in particular
About organisation for economic co-operation and development : Describe about Organisation for Economic Co-operation and Development (OECD)? What is the main Objectives of the OECD?
Write a Python script that allows the user to enter a number : COMS 104 Introduction to Programming Assignment, Iowa State University, USA. Write a Python script that allows the user to enter a number greater than 100
Understanding the science behind change : Case 4: Blue cross and blue shield, and other: understanding the science behind change. page 521
What did it mean in the century european context : We often here the term "Imperialist" bandied about these days. What did it mean in the 19th-century European context?
Understanding the science behind change : Case 4: Blue cross and blue shield, and other: understanding the science behind change.
Biasing effect of reference points : The chapter identifies three steps of making a risky choice free of the biasing effect of reference points. What are these three steps?

Reviews

len2285355

4/16/2019 10:04:39 PM

Submission - Submit a zip file containing ONLY the files PA1_Question1.py and PA1_Question2.py via the Programming Assignment 1 Submission link in Canvas. Software Requirement - For those who are using personal Computer/Laptop required to install Python 2.7 interpreter. Be sure you get VERSION 2.7.x, not VERSION 3.

len2285355

4/16/2019 10:04:33 PM

Important: NO LATE ASSIGNMENT WILL BE ACCEPTED without a valid reason. Feel free to talk to the instructor or a TA if you need any help to complete the assignments. SOLUTIONS SHOULD BE ORIGINAL AND INDEPENDENTLY DEVELOPED. No consultation of other people's solutions is permitted. No sharing of answers is permitted. Assistance by others (except the instructor or TAs. Please start the programming assignment as soon as possible and get your questions answered early!

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd