Answer:
phrase[2:5]
Explanation:
Given:
The above code segment
Required
Which instruction returns 'u a'
First, we need to get the index of u in the phrase:
u is at the third position but in programming, index starts at 0.
So, u is at index 2
Next, we need to get the index of a in the phrase:
a is at index 4
One of the ways to return a sub string from a string in python is ![string[start:stop+1]](https://tex.z-dn.net/?f=string%5Bstart%3Astop%2B1%5D)
Where:
----- index of u
----- index of a
phrase ---- The string variable
So, the instruction that returns 'u a' is: ![phrase[2:5]](https://tex.z-dn.net/?f=phrase%5B2%3A5%5D)
<em>Where 5 = 4 + 1</em>
import java.util.*; //This is used to import the Scanner
class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
Scanner ValCents = new Scanner (System.in);
System.out.println("Enter Number:");
int user_input = ValCents.nextInt();
int result = user_input/100; // This one will solve for the one dollar bills.
int remain = user_input % 100; // This one will get the remainder of cents.
System.out.println(result + " One Dollar Bills");
System.out.println(remain + " Cents");
}
}
Remember that you need to get the amount of dollar bills separately from the number of cents. This is because the int variable will always return the whole value of the number. The modulo is used to get the variable of the cents as the whole number is already taken by the "result".
Answer:
This is related to the curiosity gap. What we know, we are never interested in, and what we don't know always attract us. Here, the first headline is Go Ahead and Play that, is not creating any curiosity as there is no indication what is there inside the video, apart from the message that it is a video game. Hence, curiosity is not induced. There should be a hint to create curiosity, and take advantage of the curiosity gap. However, in the second headline, it does hint that there can be something good for us, And hence, the advantage of the curiosity gap is being used. And we will click because of the curiosity. Hence, the second headline is a more appropriate one.
Explanation:
Please check the answer section.
Taxation without representation was a major issue for the colonists, because they were being unfairly taxed by the British without having a representative in the British Parliament to represent them ans state that they were against this. It was also one of the driving forces of the American Revolution, as it was just one of the grievances the colonists were experiencing from the British.