answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Timer in Flash - How to stop it?

Hello,
I am learning how to make a timer to my game. It is something like "Who wants to be a millionaire?" I have 15 questions. There is timer for each question:60 seconds.... When I click on an answer I go on next frame, but my timer does not stop. What should I add ( and where ) to stop my timer when I clik an answer? My code for the timer is:

timer = 60;
countdown = function(){
_root.timer--;
if(_root.timer<=0){
gotoAndPlay(20); stop();
}
}
countdownInterval = setInterval(countdown,1000);

How many strings of three decimal digits begin with an odd digit?

There are 500 of 3-digit numbers begin with an odd one (100-199, 300-301, 500-599,700-799, and 900-999).

In terms of "how many strings of", may filter or expand the above answer.

How do you write a c program to find prime numbers between 1 to 10000 using functions?

You need two utility functions. The first determines if a given number is prime or not. The second finds the next prime after a given number.

The following function can be used to determine if a given integer is prime:

bool is_prime (const unsigned num) {

if (num<2) return false;

if (0==(num%2)) return num==2;

unsigned max_factor = (unsigned) sqrt ((double) num) + 1;

unsigned factor;

for (factor=3; factor<max_factor; ++factor)

if (0==(num%factor)) return false;

return true;

}

The following function can be used to determine the next prime after the given integer:

unsigned next_prime (unsigned num) {

while (!is_prime (++num));

return num;

}

Now you can print a series of primes using the following:

int main (void) {

unsigned num=1;

while (num<10000) {

num = next_prime (num);

printf ("%d is prime\n", num);

}

return 0;

}

The decryption code is?

the decryprtion code function is

void decrypt_mono(char word[],char cypher[])

How does scripting change a program?

Scripting does not ever really change the program. Although it is much like programming, the method of how the code is used is different. In Programming you write your desired code and then compile it into an excutable which is directly associated with machine code. While scripting allows the coder to write the desired information or code which is compiled every time it is requested. How ever scripting allows you to achieve your desired result by making your code. Then when you request it the preproccessor applications will take the code and read it much like you would a set of cooking instructions or map directions. You all ready know what one cup is, same as water and a pan. So the instructions tell you to add One cup of Water into the Pan, thus you do many small steps such as grab the cup, turn on the facet, but all those are all ready known and not needed in the instructions.

Disadvantages of machine language?

Machine language is the commands the processor directly knows how to carry out. They go straight to the processor without modification. This is faster than high level programming languages, like Java, Visual Basic, or Python, because the commands in those languages need to be interpreted for the processor.

Therefore, machine language has access to everything the processor has to offer, instead of some predefined commands the programming language gives you.

However, since machine language coding isn't changed a bit or even checked for errors before execution, it can cause the device to crash in the event of an error.

What are the types of circuits?

The types of circuits are series and parallel!

You have downloaded open office but you cannot find it?

Click Start, and type openoffice (all one word) into the search box. Windows should show you a list of possible matches. Place your cursor over each one in turn - Windows will provide a small information box on each entry. You're looking for the one that says "windows installer package" - click it and it'll install itself.

What is containership in oops concept?

In container class we can only access the public part of base class. For accessing of private and protected part of base class we use friend functions.

How is Boolean used in python?

Python has two constant objects, True and False and a bool() function. The bool() function simply casts its argument to one of the two Boolean objects.

All integral types (integers) will implicitly cast to True or False, such that the value zero is always False and non-zero is always True. Floating point types can also be implicitly cast (such that 0.0 is always False) however floating point values are approximations and should never be used implicitly. Instead, use comparison operators to perform an explicit cast:

if x == 0.0:

# do something

All the comparison operators return True or False, as do all the logic operators (and, or and not). However, it is never necessary to compare an expression with the True object:

if x == True:

The above can be reduced to the more efficient:

if x:

Where x cannot be implicitly cast to a Boolean constant, use the bool() function to perform an explicit cast:

if bool(x):

If you need to reverse the logic, you might use the following:

if bool (x) == False:

However, it is arguably more readable to use the not logic operator instead:

if not (bool (x)):

You can experiment with Boolean types through the bool function:

bool ('') # False

bool ('a string') # True

bool ([]) # False

bool ([1,2,3]) # True

bool (0) # False

bool (1) # True

bool (0.0) # False bool (42.0) # True

bool (False) # False

bool (True) # True

Note that the last two are redundant casts.

If String str US then what is the value of str.substring(2 4)?

In C++, the return value will be an empty string because 2 is equal to the string length (the second parameter, 4, is simply ignored). If the first parameter were greater than the string length, an out_of_range exception will be thrown instead.

What is the difference between backtracking and dynamic programming?

The only difference between dynamic programming and back tracking is DP allows overlapping of sub problems. (fib(n) = fib(n-1)+ fib (n-2)).

What is the meaning of foclip?

Foclip :

foclip is the acronym for :-

1- free online computer literacy program.

2- free of cost literacy programming .

Suppose list is linked list in memory consisting of numerical values write the procedure for finding the mean of the values in the linked list?

int n;

float sum;

typedef struct _node { float value; struct node *next;} node;

struct node *head;

struct node *ptr;

build_list(&head);

for (n=0, sum=0., ptr=head; ptr!=null; sum+=ptr->value, ptr=ptr->next, n++);

if (n>0) printf("n: %d mean: %f\n", n, sum/n); else printf("no elements\n");

Write c program that converts Full name into initial?

main()

{

char firstname[10], middlename[10],lastname[20];

clrscr();

printf("\nEnter First Name :");

scanf("%s", firstname);

printf("\nEnter Middle Name :");

scanf("%s", middlename);

printf("\nEnter Last Name :");

scanf("%s", lastname);

printf("\n%c. %c. %s",firstname[0],middlename[0],lastname);

getch();

}

I did it just for sake of time pass.............