Hire Experts For Answers
Order NowRelated Study Services
- Homework Answers
- Coursework writing help
- Term paper writing help
- Writing Help
- Paper Writing Help
- Research paper help
- Thesis Help
- Dissertation Help
- Case study writing service
- Capstone Project Writing Help
- Lab report Writing
- Take my online class
- Take my online exam
- Do my test for me
- Do my homework
- Do my math homework
- Online Assignment Help
- Do my assignment
- Essay Writing Help
- Write my college essay
- Write my essay for me
DESCRIPTION
Posted
Modified
Viewed
10
I have an assignment for my CSCI 1301 class today. I need assistance with it by 3pm est today. We are using the Intro to Python book and the assignment covers chapters 1-3
Attachments
Make sure you read everything on this homework assignment. The difference between getting an A or a C can come down to paying attention to and implementing the details of the assignment.
A couple important notes/requirements:
· Name your file Assignment2.py
· Make sure you include the proper white space. Each programming statement should be on its own line.
· Include a docstring “header” comment block at the top of the file with the name of the file, an ample description of the assignment, your name and date created/modified.
· Include a docstring “header” comment block above each of the three functions that you create. This function header should include a short description of the purpose of the function along with a list of the formal parameters(if any) and a short description of each.
· Include a decent amount of comments inside the file for calculations and other notable code. You should have at least 6 good single line comments in the file in addition to the “header” comment block at the top of the program and the function headers
· Make sure all variables have meaningful names. Do not create any variables that are single letters or abbreviations that are so short that they aren’t obvious what they represent.
· You may work together on the assignment or ask for assistance. You are NOT allowed to copy someone else’s work or have someone do the assignment for you.
· DO NOT:
· Do not use anything not covered in the first four chapters in the book.
· Do not use a break or continue statement
· Do not use poor variable names (Yes, I know I already mentioned it)
Assignment #2 Specifics- Solve the tortoise and the hare program (problem 4.12 on page 152), but with the following guidelines and modifications
1. The book requires that you create two functions. I want you to create three functions:
a. One function will take no parameters and return a move value for the hare
i. Give this function a meaningful name. For example: hare_move
ii. The function should generate a random number and with an if statement should determine how big a move is to be made.
iii. Return a numeric value that represents the size and direction of the move
iv. The function shouldn’t do anything beyond this
b. One function will take no parameters and return a move value for the tortoise
i. Give this function a meaningful name.
ii. The function should generate a random number and with an if statement should determine how big a move is to be made.
iii. Return a numeric value that represents the size and direction of the move
iv. The function shouldn’t do anything beyond this
c. One function will take two parameters and will not return a value. This function will be responsible for printing the results of each second/movement.
i. Give this function a meaningful name.
ii. The function will use two parameters that are passed to it. One of the parameters will be the position of the hare and the other will be the position of the tortoise
iii. The function must use a for loop to loop seventy times to mark each of seventy positions in a turn. Make sure you do it 70 times and not 69.
1. At each of the 70 positions you will determine whether to print a ‘T’, a ‘H’, an ‘Ouch’, or a period
2. Note: the book tells you to print nothing if the position is not a T, H, or Ouch. I want you to print a . (a period) so that it is easier to judge the distance.
3. The book is a bit confusing when it talks about a second. They are just trying to explain a single movement of both the hare and tortoise.
4. Each time this function is called, it will print a single line to output. On this line there should be either 68 or 69 periods along with a T and H or an Ouch respectively.
iv. Example output of the text after finishing/exiting the loop ……………H…..T…………………………………………
v. The function shouldn’t do anything beyond this
2. The main program will initialize the location of the hare and the tortoise at position #1.
3. Use a while loop to repeat until either the tortoise or the hare’s position is equal to or exceeds 70.
a. Call the hare moving function and update the position of the hare. If that position causes the position to go below 1, reset the value to 1. For example, the hare cannot be placed in position 0 or lower.
b. Call the tortoise moving function with the same requirements as with the hare.
c. After the “movement”, call the function to print the hare and tortoise location for this “turn”
d. After calling the print function, in the main program- print out the hare and tortoise’s numeric position. For example, Tortoise position: 7 Hare position: 1 This should be on the same line as the location of the two animals and the periods. But after this is printed, it should move down to the next line for the next “animal movement”.
4. Outside of the while loop, with an if statement, determine which of 3 possible outcome statements to print.
Note: I solved this problem with 52 lines of code. This did not include any blank lines. It also didn’t include comments or header comments for the file or the functions. I give you this number just so you know approximately how many lines of code it takes to solve the problem. Your program may be shorter or longer than my amount and still be perfectly fine.
Suggestions
1. Did you meet all the requirements? Go back and reread the requirements in the book and reread all the requirements/modifications I have made.
2. Fully test your code. Does it work for every scenario?
a. Do you get three different results: The tortoise wins some/the hare wins some/there is a chance of a tie. Note: I had to run my program over 20 times before I got a tie.
b. Does your program have both characters move both forward and backward?
c. Does your program have the possibility that both the hare and tortoise end up on the same space?
d. Have you traced your program to see that it is looping correctly and choosing the correct if options?
3. Give all your variables meaningful names. To you i might seem like a good variable name for a loop control variable, but counter would be better.
Explanations and Answers
0
No answers posted
Post your Answer - free or at a fee
NB: Post a homework question for free and get answers - free or paid homework help.
Get answers to: Help On Python Turtle & Hare Assignment or similar questions only at Tutlance.
Related Questions
- Penetration Testing Midterm Report
- Cis 120 Project That Needs To Be Done By Tommorrow At 12:30Pm Eastern Time
- Week 6 Quiz Needs To Be Done As Well
- Cis 120 Project That Needs To Be Done By Tommorrow At 12:30Pm Eastern Time
- Write A Program In C++ To Determine If Numbers Are Palindromes Using A Stack-Based Method For Testing.
- Write A Program In C++ To Determine If Numbers Are Palindromes Using A Stack-Based Method For Testing.
- View The "Writing Algorithms Applying Analysis And Deduction" Presentation Before Attempting This Assessment Activity!
- Week 3 Victorian Mansion Activity , Go To Week 3 And The Activity Is There
- Week 7 Quiz Needs To Be Done For This Week
- Security Assessment And Testing
- Conceptual Design Report Military Tactical Air Defence System
- Conceptual Design Report On Military Tactical Air Defence System
- Week 3 Victorian Mansion Activity , Go To Week 3 And The Activity Is There
- Assignment 2 Creat Bare Bones Solar System
- Applied Algorithms And Structure
- Robotics And Translations In Space
- Python Ai Project With Code And Write Up
- Python Ai Project With Code And Write Up
- 10 Questions, Cybersecurity Homework Help. (Fill In The Blanks)
- I Need Help With Week 5 Quiz For The Week
- 15 Minute Linux Scripting W/ The Awk Command
- Vhdl, Synthesis Of Hc-Sr04 Sensor Driver/Controller (Ise Project) Based On Instruction From Teacher
- Vhdl, Synthesis Of Hc-Sr04 Sensor Driver/Controller (Ise Project) Based On Instruction From Teacher
- Infr 1421 Practical Case Study Practical Case Study: Ccna Certification Skills
- I Need Help With My Mid Term For Computer Science , For Week 4
- I Need Help With My Mid Term For Computer Science , For Week 4
- Metaheuristics / Computational Complexity / Set Theory
- I Need Help With My Mid Term For Computer Science , For Week 4
- Computer Science Homework 1 (Python In Jupyter)
- Advanced Topics Cybersecurity
- Theory Of Computation: Give Two Strings That Cannot Be Generated From The Context-Free Grammar G.
- I Need Help With My Quiz For Computer Science , For Week 3
- I Need Help With My Quiz For Computer Science , For Week 2
- Finding The Text Cases And Expectations
- Assessment: The Similitude Score Has To Be Least That 20%
- Have Certain Code Match Flyweight Design Pattern
- I Need Help With My Quiz For Computer Science , For Week 2
- Make A Shift+Enter Work With C# Selenium
- Computer Systems Practice/Study Guide
- Computer Systems Practice/Study Guide
- Library Software System For Booking Books
- Intel 32 Bit Assembly Language Assignment
- Java Programming-Using A Data Structure And A File To Maintain A User’s Data
- Assembly Language Assignment (No Coding, Just Interpreting). Please Make Sure You Are Familar With Machine Architecture
- Intel 32 Bit Assembly Language Assignment
- Help With Two Training Courses And Certification Tests That Involve Modern Telecommunications Networking
- This Quiz Is Over The Following Topics: Probability (Ch 7) Conditional Probability (Ch7) Law Of Large Numbers (Ch7)
- Python Coding And Everything Need To Be Done Correctly
- Excel Chapter 4 Please See Attached Instructions
- Excel Chapter 4 Please See Attached Instructions