Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, you will program Karel to run a steeplechase. In this race the hurdles are arbitrarily high and arbitrarily wide, and the course

image text in transcribed
In this assignment, you will program Karel to run a steeplechase. In this race the hurdles are arbitrarily high and arbitrarily wide, and the course has no fixed finish corner. In each race course the finish is marked by a beeper that Karel must pick up before turning himself off. Karel starts at the origin facing East. Only the leftmost beeper along Street 1 is considered the finish mark; ignore any other beepers that may be present. The figure below illustrates one possible course. ST. 1 2 3 4S678 9 10 11 12 13 14 15 16 17 18 AV. As usual, only one Turnoff0; may be used and that one must be located in the main routine. Model your program after the hurdles race example from lecture. Use only the C++ statements that correspond to items #1 through # 18 of the "KreltheRobotProgrammingSummary" handout. Do all your work in the OLA directory. Use as your source file name "chase.ee". The following command can be used to compile your program: S kCC chase.cc Your program must complete the task under ALL legal initial situations to be considered correct. The specific situations (worlds) you will use in testing your program are "chasel.wor", "chase2.wor", and "chase3.wor", which can be copied from SPUB. Copy these 3 files into your OLA directory. To test your program, you should run your program three times, each time using a different one of these worlds: S a.out chase1.wor S a.out chase2.wor S a.out chase3.wor You are to electronically submit the using MTSU D2L Dropbox. Submit these files: chase.cc chasel.wor.rpt chase2.wor.rpt Additional Notes: (1) There is no program skeleton for you to copy. You may start with the program developed for ola2 (2) You are required to use function prototypes for all the functions defined in the program. In this assignment, you will program Karel to run a steeplechase. In this race the hurdles are arbitrarily high and arbitrarily wide, and the course has no fixed finish corner. In each race course the finish is marked by a beeper that Karel must pick up before turning himself off. Karel starts at the origin facing East. Only the leftmost beeper along Street 1 is considered the finish mark; ignore any other beepers that may be present. The figure below illustrates one possible course. ST. 1 2 3 4S678 9 10 11 12 13 14 15 16 17 18 AV. As usual, only one Turnoff0; may be used and that one must be located in the main routine. Model your program after the hurdles race example from lecture. Use only the C++ statements that correspond to items #1 through # 18 of the "KreltheRobotProgrammingSummary" handout. Do all your work in the OLA directory. Use as your source file name "chase.ee". The following command can be used to compile your program: S kCC chase.cc Your program must complete the task under ALL legal initial situations to be considered correct. The specific situations (worlds) you will use in testing your program are "chasel.wor", "chase2.wor", and "chase3.wor", which can be copied from SPUB. Copy these 3 files into your OLA directory. To test your program, you should run your program three times, each time using a different one of these worlds: S a.out chase1.wor S a.out chase2.wor S a.out chase3.wor You are to electronically submit the using MTSU D2L Dropbox. Submit these files: chase.cc chasel.wor.rpt chase2.wor.rpt Additional Notes: (1) There is no program skeleton for you to copy. You may start with the program developed for ola2 (2) You are required to use function prototypes for all the functions defined in the program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions