I’m working on a python project and need a sample draft to help me study.
Python Final Project
The objectives of this lab assignment are as follows:
- Input data from user
- Perform several different calculations
- Implement conditional logic in loop
- Implement logic in functions
- Output information to user
To properly complete this assignment, you will need to apply the following skills:
- Read string input from the console and convert input to required numeric data-types
- Understand how to use the Python Modulo Operator
- Understand the if / elif / else construct
- Understand how to implement a loop
- Output information back to the user
Assignment User Story
As a user I want an application that will allow me to know which numbers in a range of values are evenly divisible first by 3, then by 5, and then by both 3 and 5.
In this assignment we are asking the user to enter two number values, the starting and ending numbers for our application. Having these values, we then construct a loop that will increment by one (1) from the starting number through (and including) the ending number. Within this loop we will check the current value of our number to see if it is evenly divisible by 3, then by 5, and then by both 3 and 5. We will output all values to the screen and note which are divisible by “3”, “5”, or “Both.”
Important: As part of this assignment the checking to see if a value/number is evenly divisible by 3, by 5, or by both is to be handled within a function or set of functions. How you implement this is up to you. But your project needs to implement at least one function.
For example, if the user enters 1 for the starting number and 100 for the ending, we will loop through all values of 1 through 100, one at a time. For the first value we will print “1”. For the next “2”. But for three we will print “3 – 3”. For five “5 – 5”. But for 15 we will print “15 – Both”.
This should not be difficult work. They key to this is understand for each value whether it is evenly divisible by 3 or 5 or by both 3 and 5. This requires that you use the Modulo operator in Python. All programming languages have a modulo operator.
When complete, your output should be as pictured below:
In this example, my starting value is 1 and the ending value is 25:
In this example, my starting value is 15 and the ending value is 30:
Note: The example output provided above is simply an example. You do not need to format your output to look exactly like mine. You simply need to ensure that you have met the technical requirements for this application and ensure your output is neat and professional looking.
You must ensure that the application you submit meets all technical/grading requirements. Your grade will be based on how well your application follows the application requirements plus the following:
- The name of the application with be FinalProject.py
- You must have a set of comments at the top of the program that identifies the programmer, date, and name of the program file. Furthermore, you must provide a description of what this program is and what it does. Each of these comments must be on individual lines.
- The following two pieces of data will be entered by the user: starting number and ending number
- Using the entered data, you will loop through this range of values one at a time.
- For each value in your range you will determine if it is evenly divisible by 3, by 5, or by both 3 and 5.
- The valuein all caseswill be output to the screen. But if it is evenly divisible by 3, 5, or both you will note that in the output.
- You must demonstrate your knowledge of functions by creating at least one function: to perform the check for whether the current value is evenly divisible by 3, 5, or both. You can create as many functions as you wish, but you must have at least one function.
- How the application looks and how it presents its information to the user is up to you. But it must meet the minimum requirements noted above.
Important: Your output must include all of the following: each value in the range between the starting and ending values entered by the user, and some notation as to whether that value is evenly divisible by 3, 5, or both 3 and 5.
In this final project, you will continue to demonstrate your overall knowledge of the Python language.
In this final assignment you will demonstrate your knowledge of basic Python programming principles. You will employ what you already know while possibly having to look up one new concept (the modulo operator). You will input data from the user, contruct a loop, perform some conditional logic, and implement some of your code in at least one function. You will write an application that will allow the user to see if a number is evenly divisible by 3, by 5, or by both 3 and 5 together.
IMPORTANT: If I find that your code matches code out on the web for this programming part of the Final Exam, it is an automatic zero for it.