Answer:
Algorithms are a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.
Pseudo code is an informal description of an algorithm or how a program will function.
a. An example of an algorithm using coding terminology would be a function to find the largest or smallest number in a user-defined array.
b. A function that could include an algorithm would be a function that compares input.
c. Pseudo code could be used to outline a part of a program that has to carry out a specific function.
I hope that helped! If you have any questions I am glad to help.
Answer:
Explanation:
The following code is written in Java and loops through 10 times. Each time generating 2 random dice rolls. If the sum is 10 it breaks the loop and outputs a "You Win" statement. Otherwise, it outputs "You Lose"
import java.util.Random;
class Brainly {
public static void main(String[] args) {
UseRandom useRandom = new UseRandom();
boolean youWin = false;
for (int x = 0; x<10; x++) {
int num1 = useRandom.getRandom(6);
int num2 = useRandom.getRandom(6);
if ((num1 + num2) == 10) {
System.out.println("Number 1: " + num1);
System.out.println("Number 2: " + num2);
System.out.println("You Win");
youWin = true;
break;
}
}
if (youWin == false) {
System.out.println("You Lose");
}
}
}
class UseRandom{
public int getRandom(int n)
{
Random r=new Random();
int rand=r.nextInt(n);
return rand;
}}
Explanation:
In this example, the scenario will be the fact that I have started high school. I believe that because of this, my curfew should be different. This is an example of a dialogue that would discuss this
Me: I need a later curfew I have so much things to do and don't have time to do what I want , i am 16 now.
Mom: no you need to go to bed early so you can do what you need not what you want.
Me:ok , make you happy for now but if you don't let me now I'm going to later this will cause experiences that I have never encountered later in life that I could know about sooner but couldn't because i was restricted and when I have less common sense then everyone when I'm older it's your fault