Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What to Hand In Usually this appears last, but in this question, it s first so that you know what you have to hand in

What to Hand In
Usually this appears last, but in this question, its first so that you know what you have to hand in. As you
can see, the code you develop is a small part of this work.
Your plan to complete this question: a2q2_plan.txt
Your design document: a2q2_design.txt
Your answers to the reflection questions: a2q2_reflections.txt
Your Python program a2q2.py
You must use TXT file type for this question. Be sure to include your name, NSID, student number, course
number and lecture section at the top of all documents.
IMPORTANT: All of your Question 2 files should be committed to Git, see Question 1 for details!
Problem Specification
After numerous Godzilla attacks, the city of Tokyo, Japan is testing their new invention, Mechagodzilla. You
are tasked with implementing a program to help retrieve Mechagodzilla after successful deployments.
Mechagodzillas movements are controlled by sending a series of inputs, N for north, E for east, S
for south, or W for west. If something goes wrong and Mechagodzilla is destroyed, we need to be able
to find it for retrieval.
The question we want to answer: Using a standard Cartesian grid, what are the (x,y) coordinates of
Mechagodzilla after it finishes a series of movement inputs? Assume Mechagodzilla always starts at the
base coordinates of (0,0).
Here are some examples to help clarify:
NNE: coordinate (1,2)
NNEEENNW: coordinate (2,4)
WNENWNSNN: coordinate (-1,4)
EESSENNESE: coordinate (5,-1)
WEENEWE: coordinate (2,1)
NWEWWNSWW: coordinate (-4,1)
Page 3
Department of Computer Science
176 Thorvaldson Building
110 Science Place, Saskatoon, SK, S7N 5C9, Canada
Telephone: (306)966-4886, Facsimile: (306)966-4884
CMPT 145
Winter 2024
Principles of Computer Science
You will be given a number of datafiles containing inputs of different lengths. Each file will contain a number
of lines. Each line will represent inputs from a deployment. The program you must write will open the file,
read each line, and then print the final (x,y) coordinates for that deployment to the console.
For example, if a datafile contained the examples above, your program would display
(1,2)
(2,4)
(-1,4)
(5,-1)
(2,1)
(-4,1)
Detailed Example
Example File (with only one deployment):
NNEEENNW
Program Output:
(2,4)
Illustration to help visualize path taken:
Page 4
Department of Computer Science
176 Thorvaldson Building
110 Science Place, Saskatoon, SK, S7N 5C9, Canada
Telephone: (306)966-4886, Facsimile: (306)966-4884
CMPT 145
Winter 2024
Principles of Computer Science
Task
For this question you will do the following:
You will start by creating a plan for your work. Your plan will schedule time for the following develop-
ment phases:
Requirements. The specification is given above, so this part of the plan includes reading the Spec-
ification section carefully. You do not need to hand in anything for this part.
Design. Your plan will indicate when you will do the design phase (day, time, location), and how
long you think it will take (duration).
Implementation. Indicate when you will work on the implementation phase (day, time, location),
using your design, and how long you think it will take (duration).
Testing and debugging. Indicate when you will work on testing and debugging (day, time, loca-
tion), and how long you think it will take (duration).
Final clean up for submission. Indicate when you will work on clean-up (day, time, location), and
how long you think it will take (duration).
You must submit this plan for grading.
You will design your program, producing a design document outlining your implementation. You will
submit this design for grading.
You will record the amount of time you actually spent on each phase of the plan. You will submit this
information for grading.
Details
Details about the Plan: On page 7 is an example table that you could use to outline your plan. It has
columns for the information required above. You are not required to follow your plan exactly, to the last
detail. Its a plan, not a commitment. Its helpful for monitoring your progress. You might find your plan
didnt account for issues and problems that came up. Thats okay. Make note of those in your reflections.
Details About the Design: Your design document should describe your implementation in terms of the
functions youll need to complete the program. For each function, you must specify:
Pseudo-code or informal algorithm descriptions. The form of the description is up to you.
An informal description of the inputs and outputs for each function.
An informal description of any test cases you will need to check your functions.
Its important for you to keep in mind that the purpose of the design is to help you, and you should not be
overly worried about the format of your design.
Details About the Implementation, Testing, and Debugging: Try to apply an incremental approach. For
each function in your design:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions

Question

Explain the importance of community and user dialogue exchange.

Answered: 1 week ago

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago