Question

This is a praxctice assignment I have to do in Scratch but I don't know where...

This is a praxctice assignment I have to do in Scratch but I don't know where to start.

Timer 1. Create a variable called timer. 2. When the green flag is clicked, initialize the timer to 10. 3. Continually, wait 1 second and check if the timer=0 a. Output the current time b. If the timer=0 make either the background or a huge sprite say “time’s up!” 4. When the flag is clicked, everything should start over. 5. Be as creative as you would like with how your program looks. 6. Make sure your timer stops at 0 and does not continue into the negative numbers.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I AM DOING IT IN JAVA IT IS VERY SIMILAR TO SCRATCH :-(WITH LINE BY LINE EXPLANATION)

void timers( String flag) #this is the function

{

int timer; #this is the timer variable

timer=Integer.parseInt(in.nextLine()); #taking the input from the user

if(flag=="green") #if flag is green we go to the loop

{

for(int time=10;time>0;time--); #here the time is intiliazed to 10 and it is gradually decresing. time will always     n# it will always be more than zero

}

if(time==0)

{

System.out.println("Timesup!"); #if the time is zero we will print timesup!

}

}

static void main() #this is the driver function

{

String flag;

for(int i=0;i<5;i++) #we ask the user to enter the value in flag

{

Scanner in=new Scanner(System.in);

flag=in.nextLine();

if(flag=="green") # if flag is clicked we again call the timer function

timer(flag);

}

}

Add a comment
Know the answer?
Add Answer to:
This is a praxctice assignment I have to do in Scratch but I don't know where...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help doing this practice exercise in Scratch. I am not sure where to start...

    I need help doing this practice exercise in Scratch. I am not sure where to start Your task is to make a Scratch program that will tell you the letter grade based on the percentage. 1. Create a variable grade (have grade display as a scroll bar). 2. When the green flag is clicked, the program should look at the value of the grade and the Sprite should respond with a letter as follows: A: greater than 89 B: greater...

  • This is a c# assignment Please do not post just the code, I don't even know...

    This is a c# assignment Please do not post just the code, I don't even know how to start the project. Please explain step by step how I could complete this assignment. Thank you for your time! Create a database that stores baseball player information. You will have the following columns. You will need to have the ability to add rows and display the records. You may use LINQ or Given example using an access accdb file... Name string Batting...

  • Hi, sir. I am doing an assignment, but I don't know the meaning of this graph....

    Hi, sir. I am doing an assignment, but I don't know the meaning of this graph. Could you explain : (1) the process of forming Higg Boson (2) What is the meaning of x,y axes (3)What is the meaning of background Thanks a lot. One of the predictions of the Standard Model is the Higgs boson' - a new short-lived particle. It is common in particle physics to search for particles by looking at the products of particle collisions. In...

  • I want to know how to do this assignment!!! Help me please~ The first part of...

    I want to know how to do this assignment!!! Help me please~ The first part of your program should do the following: • Ask the user type of test they took. o (ACT or SAT) • If they said ACT then ask them their score o If their ACT score was between 0 and 7 say "Needs Work" o If their ACT score was between 10 and 20 say "Acceptable" o If they ACT score was above 20 say "Above...

  • I need help understanding this programming assignment. I do not understand it at all. Someone provided...

    I need help understanding this programming assignment. I do not understand it at all. Someone provided me with the code but when I run the code on eclipse it gives an error. Please explain this assignment to me please. Here is the code: import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class TextEditor { public static List<String> lines = new ArrayList<String>(); public static void main(String[] args) throws IOException { Scanner s = new...

  • please solve 1-5 i do not understand where to start Chemistry Stoichiometry-Assignment SHOW ALL OF YOUR...

    please solve 1-5 i do not understand where to start Chemistry Stoichiometry-Assignment SHOW ALL OF YOUR WORK Circle your final answer, with correct units and significant digits. Use the equation below to complete the following. 2NH4NO3 → 2N2 + 4H20 + 0 1. If you have 5.22 moles of NH4NO3 how many moles of water can you make? 2. If 2.0 moles of nitrogen are made, how many moles of oxygen are also produced? 3. How many grams of NH4NO3...

  • This assignment is for my management information systems class and I don't know which category I...

    This assignment is for my management information systems class and I don't know which category I should post it to. I will appreciate if anyone can help me with this assignment, all the information required for this assignment to be completed I am sharing it in this post. Thank you in advance! Also, I have posted it in computer science and I did not get any help from them too... Automated Call-Analyzers at Northeast Utilities Objectives: Northeast Utilities (NEU) is...

  • How do I do this C++ in a Unix Environment assignment Given dot1m.c 1. The program (dot1m.c) uses...

    How do I do this C++ in a Unix Environment assignment Given dot1m.c 1. The program (dot1m.c) uses mutex to lock and unlock the shared resource (dotstr.sum) for access control as shown below. pthread_mutex_lock (&mutexsum); dotstr.sum += mysum; printf("Thread %ld did %d to %d: mysum=%f global sum=%f\n", offset,start,end,mysum,dotstr.sum); pthread_mutex_unlock (&mutexsum); 2. Modify dot1m.c program to use reader-writer lock (instead of mutex).      Replace the codes (for mutex) by the codes (for reader-writer lock).            To initialize reader-writer lock, pthread_rwlock_initializer.            At the end,...

  • I know I'm on the right path, but don't know where to continue from here. This is a C++ assignmen...

    I know I'm on the right path, but don't know where to continue from here. This is a C++ assignment Your job is to write that will display a calendar for any given month of a given year. The user will need to type the number of the month as an integer from 1 to 12 (1 is for January, etc.), and the year as a 4-digit integer. This assignment simply requires that your program make use of more than...

  • Please help with my car traffic simulator! Code that I already have below, I do not know how to...

    Please help with my car traffic simulator! Code that I already have below, I do not know how to start it off! public class IntersectionSimulation { private final static int EAST_WEST_GREEN_TIME = 30 ; private final static int[] NORTH_SOUTH_GREEN_TIMES = { 20, 24, 30, 42 } ; private final static int[] CAR_INTERSECTION_RATES = { 3, 5, 10 } ; private final static int[] CAR_QUEUEING_RATES = { 5, 10, 30 } ; private final static int[] EXPERIMENT_DURATIONS = { 3*60, 5*60,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT