Algorithm
STEP 1: START.
STEP 2: DEFINE n, i, j.
STEP 3: SET sum =0.
STEP 4: SET n =100.
STEP 5: REPEAT STEP 6 to STEP 10 UNTIL i<=n.
STEP 6: REPEAT STEP 7 and STEP 8 UNTIL j<=i/2.
STEP 7: if i%j ==0.
STEP 8: sum =sum + j.Algorithm
STEP 1: START.
STEP 2: DEFINE n, i, j.
STEP 3: SET sum =0.
STEP 4: SET n =100.
STEP 5: REPEAT STEP 6 to STEP 10 UNTIL i<=n.
STEP 6: REPEAT STEP 7 and STEP 8 UNTIL j<=i/2.
STEP 7: if i%j ==0.
STEP 8: sum =sum + j.
Answer:
<em>B. Pirated software
</em>
Explanation:
Software piracy is used <em>to define the act of using, duplicating or transferring software unlawfully without property or legal rights. </em>
Today, most software is bought as a single-user permit, <em><u>which means that at one moment only one PC could have that software running on it.
</u></em>
Trying to copy the software to various devices or distributing it without multiple licenses is regarded to be illegal software piracy.
Answer:
The solution code is as below:
- Scanner input = new Scanner(System.in);
- System.out.print("Input a string: ");
- String inStr = input.nextLine();
- int strLen = inStr.length();
-
- while(inStr.equals("Quit") != true && inStr.equals("quit") !=true && inStr.equals("q") != true){
-
- for(int i= 0; i < strLen; i++){
- System.out.print(inStr.charAt(strLen - 1 - i));
- }
-
- System.out.println();
- System.out.print("Input a string: ");
- inStr = input.nextLine();
- strLen = inStr.length();
Explanation:
Firstly, we create a Scanner object,<em> input</em> (Line 1).
Next, we use the Scanner object nextLine() method to get a text input from user (Line 3).
We create a while loop and set the condition so long as the input text is not equal to "Quit", "quit" or "q" (Line 6), the program should proceed to print the input text in reverse (Line 8-10). To print the text in reverse, we can apply the expression<em> length of string - 1 - current index</em>. This will ensure the individual letter is read from the last and print the text in reverse.
Next, prompt the user to input a new text (Line 13-14) and repeat the same process of printing text in reverse so long as the current input text is not "Quit", "quit" or "q".
You can't sorry... Very fun game :-)