1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elza [17]
2 years ago
14

Elena wrote the following code in Scratch to have the sprite move and then turn around. However, the code does not work as expec

ted. What should be done to fix the error?
Change "move 20 steps" to "move 10 steps"
Change "turn left 180 degrees" to "turn left 90 degrees"
Change "turn left 90 degrees" to "turn right 180 degrees"
Change "turn right 90 degrees" to "turn left 90 degrees"

Computers and Technology
1 answer:
polet [3.4K]2 years ago
4 0

Sprites are program objects used to create animations

What should be done to fix the error is to (d) Change "turn right 90 degrees" to "turn left 90 degrees"

<h3>How to fix the error</h3>

From the question, we have the following highlights

  • The sprite is to move forward
  • And then turns around

The first line of the code segment moves the sprite 20 steps forward;

This step is correct, and it does not need to be changed.

For the sprite to turn, then it must rotate 360 degrees in a direction.

From the code segment, we have the following rotations

  • 180 degrees left
  • 90 degrees left
  • 90 degrees right

When the angles of rotation are added, we have:

\theta = 180 + 90 - 90

\theta = 180

i.e. the code segment implements a 180 degrees rotation

In order to turn the sprite around, she needs to change the 90 degrees right to 90 degrees left.

So, we have:

\theta = 180 + 90 + 90

\theta = 360

Hence, the fix to the error is (d) Change "turn right 90 degrees" to "turn left 90 degrees"

Read more about sprites at:

brainly.com/question/26549550

You might be interested in
Give brainliest if you tell me the can tell me the most random thing
Scorpion4ik [409]

Mood

Explanation:

Because it gets changed by the time you are happy or sad. Same that while you are reading if you like your. mood gets good but if you dont find this ans satisfied your mood gets changed.

3 0
3 years ago
Which of the following correctly describes a work in the public domain?
Anarel [89]

Answer:

B

Explanation:

I took the test got a 100

8 0
3 years ago
Write a function named replaceSubstring. The function should accept three C-string arguments, let's call them string1, string2,
hoa [83]

Answer:

All is in explanation.

Explanation:

#include <iostream>

#include <cstring>

#include <string>

using namespace std;

//function prototype

string replaceSubstring(const char *, const char *, const char*);

string replaceSubstring(string, string, string);

int main()

{

//declare three char array to hold strings of max 100 chars

char string1[101];

char string2[101];

char string3[101];

//prompt user to enter input

//then read

cout << "Enter string to search:\n";

cin.getline(string1, 101);

cout << "Enter the string you want to replace:\n";

cin.getline(string2, 101);

cout << "What do you want to replace it with?\n";

cin.getline(string3, 101);

cout << "Your updated string is:\n";

cout << replaceSubstring(string1, string2, string3);

//return 0 to mark successful termination

return 0;

}

string replaceSubstring(const char *st1, const char *st2, const char *st3){

//declare pointers start and occurrence

//initialize start with string to search

//char *startSearch = st1;

//initialize occurrence with the first occurrence

//of st2 in st1

char *occurrence = strstr(st1, st2);

//declare empty string

string output = "";

//using occurrence as control for while loop

//means that it will iterate until no more

//occurrences are found

while(occurrence){

//append to final string the characters of st1

//up until first occurrence of st2

output.append(st1, (occurrence-st1));

//append st3 to final string

output.append(st3, strlen(st3));

//update occurrence to point to character

//of st1 just after first occurrence of st2

st1 = st1 + (occurrence-st1) + strlen(st2);

//find new occurrence

occurrence = strstr(st1, st2);

}

//st1 now points to first character after

//last occurrence of st2

output.append(st1, strlen(st1));

return output;

}

string replaceSubstring(string st1, string st2, string st3){

//convert input strings to C-strings

const char *ptr1 = st1.c_str();

const char *ptr2 = st2.c_str();

const char *ptr3 = st3.c_str();

//call function that accepts C-strings

replaceSubstring(ptr1, ptr2, ptr3);

}

6 0
2 years ago
Read 2 more answers
If an engine has four cylinders and a total of 16 valves, how many valves would each cylinder have?
wel
4 because 4 x 4=16. Easy. I like to think of it as multiplication.
4 0
3 years ago
Which is an example of the operation of a game?
SVEN [57.7K]

Answer:

D.  

The player uses a joystick to control the character.

Explanation:

The MEANING of operation is: "The fact or condition of functioning or being active."

This explains that the answer is D because you are using the joystick to control the character. Hope the helps.

6 0
2 years ago
Read 2 more answers
Other questions:
  • 25. Becca is learning how to brush her teeth independently and her therapist/RBT has created an activity schedule to help teach
    6·1 answer
  • A quick boot allows you to do what?
    7·2 answers
  • What is the single most important component of a computer? Central Processing Unit DIP Motherboard Chipset
    8·1 answer
  • Mechanisms that combine memory, processing speed, and knowledge to regulate the analysis and flow of information within the info
    5·1 answer
  • 1) Why is angle of view important? What are some of the ways that you can do this?
    6·1 answer
  • Why is data processing done in computer?​
    14·1 answer
  • write a program to update the rate by increasing 20% from sequential data file "items.dat" that store item name.rate and quantit
    15·1 answer
  • Kylee needs to ensure that if a particular client sends her an email while she is on vacation, the email is forwarded to a cowor
    7·1 answer
  • In object-oriented analysis, an object is a member of a(n) _____, which is a collection of similar objects.
    11·1 answer
  • Which of the following is an example of an incremented sequence?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!