Answer:
Algorithms is formula for solving a problem. It is helpful because it specifically give instructions detail to computer to what a computer should perform a specific task.
For e.g. calculating report cards.
Answer and Explanation:
Using JavaScript:
/* program should take N input which represents the dollar amount and output how many chocolate bars and how many coupons we have*/
function chocolatebar(dollars){
var dollaramt= dollars;
var i;
for(i=0; i <= dollaramt; i++){
i=i+6
?
Alert ("you have 1 extra chocolate bar");
:
Alert ("keep buying chocolate bars to get more coupons for a bonus chocolate bar")
}
}
*
StrawberryTeaa (could be any fruit: blueberry, peach, etc)
potatoxchip
pastelsquid
SquishyPeach
GummiBear
ElegantFlaws (could add an e and remove the s: EleganteFlaw)
hunnie_b (or honee, honnie, hunni, etc)
agonyisheree
It's cool if you don't like these. I had trouble when I changed my user too. But you'll find your perfect username eventually. :)
Answer:
// here is code in C.
// headers
#include <stdio.h>
// main function
int main(void) {
// variable declaration
int favorite_number;
// ask user to enter favorite number
printf("enter your favorite number : ");
// read the number
scanf("%d",&favorite_number);
// print the message
printf("your favorite number is: %d",favorite_number);
return 0;
}
Explanation:
Declare a variable "favorite_number" of integer type.Ask user to enter favorite number and assign it to favorite_number.Then print the message which include the favorite number.
Output:
enter your favorite number : 77
your favorite number is: 77