Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

(Turtle graphics) The Logo language, which is particularly popular among personal computer users, made the concept of turtle
graphics famous. Imagine a mechanical turtle that walks around the room under the control of a C program. The turtle holds a
pen in one of the two positions, up or down. While the pen is down, the turtle traces out shapes as it moves; while the pen is up,
the turtle moves about freely without writing anything. In this problem you will simulate the operation of the turtle and create a
computerized sketchpad as well.
Use a 50-by-50 array floor which is initialized to zeros. Read commands from an array that contains them. Keep track of the
current position of the turtle at all times and whether the pen is currently up or down. Assume that the turtle always starts at
position 0,0 of the floor with its pen up. The set of turtle commands your program must process are as follows:
Command Meaning
1234
5,10
69
Pen up
Pen down
Turn right
Turn left
Move forward 10 spaces (or a number other than 10)
Print the 20-by-20 array
End of data (sentinel)
Suppose that the turtle is somewhere near the center of the floor. The following "program" would draw and print a 12-by-12 square:
2
5,12
3
5,12
3
5,12
3
5,12
169
As the turtle moves with the pen down, set the appropriate elements of array floor to 1s. When the 6 command (print) is given, where're
there is a 1 in the array, display an asterisk, or some other character you choose. Wherever there is a zero, display a blank. prepare a
program to implement the turtle graphics capabilities discussed here. prepare several turtle graphics programs to draw interesting shapes.
Add other commands to increase the power of your turtle graphics language. 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9109968

Have any Question?


Related Questions in Computer Engineering

Software engineeringeach of the following heuristics helps

Software Engineering: Each of the following heuristics helps make a good module according to some modularity principle. Identify the principle for each letter. Modularity principles: Principle of Small Modules Principle ...

During a year of operation a firm collects 650000 in

During a year of operation, a firm collects $650000 in revenue and spends $250000 on labor expense, raw materials, rent, and utilities. The firm's owner has provided $350000 of her own money instead of investing the mone ...

Decision support systems vary greatly in application and

Decision support systems vary greatly in application and complexity, but they all share specific features. A typical Decision support systems has four components: data management, model management, knowledge management a ...

Question suppose 4 packets of a message each of l bits

Question : Suppose 4 packets of a message, each of L bits arrive at a switch (router) and traverse a link with rate R bps to the destination. Further, suppose that the link is free when the first packet arrives, and the ...

Question a file is to be shared among different processes

Question : A file is to be shared among different processes, each of which has a unique id number and a priority level number. The file can be accessed simultaneously by several processes, subject to the following constr ...

Question why are the error terms in cross-sectional data

Question: Why are the error terms in cross-sectional data unlikely to be serially correlated? Can you give an example in which serial correlation could be present in a cross-sectional dataset? The response must be typed, ...

Suppose there are n people in a team the coach wants to

Suppose there are n people in a team. The coach wants to know how many different pairs of people he can choose in a team. Write a program in C that shows the coach, the total number of different pairs he can choose in th ...

If you want to answer a research question regarding whether

If you want to answer a research question regarding whether a particular group of subjects experiences any significant changes in behavior as they age but you do not have the time or money for a traditional longitudinal ...

Shellys preferences for consumption and leisure can be

Shelly's preferences for consumption and leisure can be expressed as U(C, L) = (C - 100) (L - 40). This utility function implies that Shelly's marginal utility of leisure is C - 100 and her marginal utility of consumptio ...

Part 1whats the importance of a documentation plan please

Part 1: What's the importance of a Documentation Plan? Please provide an example of a Documentation Plan that you would use. Part 2: How do you calculate how long a project will take? These questions are for my Introduct ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As