program partitioning computer science homework help

TELE HEALTHCARE 1
January 12, 2021

program partitioning computer science homework help

Respond to each question in 150 words or more

1 of 2

There are many advantages to partitioning out your program into subdivisions such as easier referencing of your code (just like writing HTML and having an external CSS file) and also so changes can be made easier without disrupting the rest of your program. This enables programmers to use separate modules, which complete a specific task of the program and then link back to the original program module once it has run through. This really cleans up a programmers work while allowing them to test individual modules at a time, or even better, have many people working on separate modules to complete a task quicker. Methods are used within modules to link items to the same class while also enabling the programmer the ability to reference these classes throughout their program.

In order to use a method, you will have to create a class. In my example I have made a class of “dealCards”. When you deal cards you usually deal out 7 cards per person, depending on the game. I have created a method of “useCards” because once you get dealt cards you will use them. During “useCards,” using a loop, I have used 1 card at a time and the program will tell me how many cards I have left and when I’m out of cards. I then have to set constrictor to run the part of program I would like it to run. Because dealCards is the class, I then specify what part of the class I would like to use (ex. If I had multiple methods in the “dealCards” class, I would have to specify) which in this case is .useCards. So when my module runs, I get the following

2 of 2

Hi class,

The practice of subdividing programs provides many advantages, some include being able to reuse code already made, inherit properties, allow for smaller chunks to be debugged, and can even allow for different coding languages to be used in a program.

By using the import statement, you are able to import modules or methods into your current Python script or session. Of course, before you import that module/method you’ll need the code you are importing to be complete, and hopefully debugged prior to importing that portion into your project. For my example I created a classes.py where I declared a few classes, and then in main.py I created some objects that were derived from those classes.

I was able to document my program through the use of comment lines and comment blocks. A comment line is used for a singular line of commented out, or not executed code, which is declared with a single #, and the following text is considered a comment for the rest of the line. A comment block starts with three “, and then all the text between there, and the next three “ are commented text, no matter how many lines that covers. If you review my attached example you will see examples of my comment lines and blocks.

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Buy Custom Nursing Papers