ITECH1400 Foundations: Developing a Biorhythm Program in Python

Verified

Added on  2023/03/30

|2
|660
|309
Project
AI Summary
This Python project, likely for a Foundations of Programming course (ITECH1400), implements a biorhythm calculator. It takes a user's birthdate and a target date, calculates the physical, emotional, and intellectual cycles using sine wave functions, and then plots these cycles on a graph using the matplotlib library. The program imports necessary libraries like math, datetime, and matplotlib, defines key variables, calculates the biorhythm values for each day, and displays the results graphically, providing insights into the user's biorhythmic patterns. The program is well-documented and provides a clear example of using Python for mathematical calculations and data visualization. The report discusses the importance of syntax, libraries (math, datetime, matplotlib), and algorithm definition in the program, highlighting Python's user-friendly features and the benefits of using it for complex calculations and graphical representations. Download this solved assignment and other resources on Desklib.
Document Page
Introduction
Python programming language is the most used because of its simplicity. Its syntax enables
programmers to use less code in their programs. Python also has so many features make it more
suitable and advisable to use in all of our daily activities (Beirnaert et al., 2019).
Discussion
Use of the syntax in any programming language is very important. In python programming, the
syntax are very simple and direct. Such syntax are brackets, parenthesis, full colon, and forward
slash among others. The main functions is to define the objects and also specify their functions with
their relationships (Schneider, Moss, & Goldenholz, 2019).
Libraries are also very important for easy calculations. In our case we have imported math,
datetime, matplotlib.pyplot as plt, from pylab import plot,show,title,legend,xlabel,ylabel, and from
math import pi. These libraries are build in python programming language and they are used in
calculations hence you don’t have to define all the math inside the program since this will help do
calculation automatically. This feature make python language favorite and user friendly (Pernold, K.
2019).
Next step is to define the character. By doing so, it will make it easy for the programmer to
understand all the characters in the program and hence used appropriate in the coding. Characters
used are userName, dateofBirth, dateofTarget, date1, date2, and numDays. Therefore the
programmers will then but English words in the brackets of each character so that the users in front-
end the users can understand without seeing the coding (Park et al., 2019).
Now algorithm part is the next and the main part of the program. In algorithm, the program is
defined and instructions are given all series of the actions that should take place in the program. We
have define how the program should start and follow some processes until the final execution of the
program is done. Our algorithm is define by physical, emotional, intellectual, plt.grid(True), and
myPlot which should follow each other appropriately because the program will follow such
instructions before the final execution. The program is now finally executed by the command
“print” which will execute all the program (Park et al., 2019).
Inside the program, we can also get the graph of legend(["Physical", "Emotional", "Intellectual"]),
title("Biorhythm"), xlabel("Date"), and ylabel("Value") by the use of the command show(myPlot).
Python programming language give us the privilege of plotting of the graphs of the variables in the
program by just use of the string show(myPlot) after defining clearly which strings should be shown
and where in the graph (Pitkänen, M. 2019).
The graph obtained depends on the data that was imputed. According to our data collected, all
values have curved graphs. In physical, it starts with 0 the shots to 1 and fall to -1 then shots up
again, emotional starts at 0.60 then shots to 1 before falling to -1 then shots up and finally
intellectual starts with -1 then shots straight to 1 the starts falling (Beirnaert et al., 2019).
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Conclusion
Python program has simplify our work. We imported libraries which enabled us to calculate all the
mathematics in our program with the need of defining. We have also plotted the graph by just
execution of instructions. We highly recommend the use of this language because of its diverse
features (Schneider, Moss, & Goldenholz, 2019).
Reference
1. Schneider, L. D., Moss, R. E., & Goldenholz, D. M. (2019). Daylight saving time transitions are
not associated with increased seizure incidence. Epilepsia.
2. Pernold, K. (2019). Home-cage monitoring of mouse behaviours across life-span.
3. Pitkänen, M. (2019). GENES AND MEMES: PART I.
4. Beirnaert, C., Peeters, L., Meysman, P., Bittremieux, W., Foubert, K., Custers, D., ... & Laukens,
K. (2019). Using expert driven machine learning to enhance dynamic metabolomics data analysis.
Metabolites, 9(3), 54.
5. Park, M., Thom, J., Mennicken, S., Cramer, H., & Macy, M. (2019). Global music streaming data
reveal diurnal and seasonal patterns of affective preference. Nature Human Behaviour, 3(3), 230.
6. Bulley, J., & Arts, S. SOUNDING MATERIALITY.
chevron_up_icon
1 out of 2
circle_padding
hide_on_mobile
zoom_out_icon