C ONLY NO C include etc 3 Turtle Graphics Write an interacti
********C ONLY NO C++*******
#include <stdio.h> etc..
3) Turtle Graphics Write an interactive drawing program that will accept characters from the keyboard until ESC is pressed Redraw the board after every keypress. Use the numpad keys, and switch on the characters 8, 6, 2, and 4 to update x and y variables, then write an asterisk to the global board data. Start at location 15, 15. So, if the user press the 8 key (up), increment y, update board ly][x] then redraw the screen using a nested loop. Use the following code: char board [30][30]; Prints the global board using a nested loop void printboard() int row, col; for (row 0; row 30; row++) for (col 0; col 30; col++) printf (\"%c\", board[row][col printf(\"In\"); main will have something like this inside OO get a character switch on character case \'8\' break; etc update the board array print the board array endloopSolution
program
float a,b,c;
float multiply_it(float x,float y);
float divide_it(float x,float y);
float add_it(float x,float y);
float subtract_it(float x,float y);
char s [12];
main(void)
{
printf(\" %c CALCULATOR %c\",4,4);
printf(\" By Jason\");
printf(\" %c\",5);
location1: ;
printf(\"Enter (*,/,+,-) or (end) to exit: \");
scanf(\"%s\",s);
{
if(strcmp(s,\"*\")==0)
{
printf(\"Enter a number: \");
scanf(\"%f\",&a);
printf(\"Enter another number: \");
scanf(\"%f\",&b);
c=multiply_it(a,b);
printf(\"The answer is %f\",c);
goto location1;
}
if(strcmp(s,\"/\")==0)
{
printf(\"Enter a number: \");
scanf(\"%f\",&a);
printf(\"Enter another number: \");
scanf(\"%f\",&b);
c=divide_it(a,b);
printf(\"The answer is %f\",c);
goto location1;
}
if(strcmp(s,\"+\")==0)
{
printf(\"Enter a number: \");
scanf(\"%f\",&a);
printf(\"Enter another number: \");
scanf(\"%f\",&b);
c=add_it(a,b);
printf(\"The answer is %f\",c);
goto location1;
}
if(strcmp(s,\"-\")==0)
{
printf(\"Enter a number: \");
scanf(\"%f\",&a);
printf(\"Enter another number: \");
scanf(\"%f\",&b);
c=subtract_it(a,b);
printf(\"The answer is %f\",c);
goto location1;
}
if(strcmp(s,\"end\")==0)
{
goto end;
}
}
end: ;
return 0;
}
float multiply_it(float x,float y)
{
return (x * y);
}
float divide_it(float x,float y)
{
return (x/y);
}
float add_it(float x,float y)
{
return (x+y);
}
float subtract_it(float x,float y)
{
return (x-y);
}
·

