Answer:
The solution code is written in Python 3
- firstStr = input("Enter first string: ")
- secondStr = input("Enter second string: ")
-
- if(firstStr < secondStr):
- print("The first string comes first alphabetically.")
- elif(firstStr > secondStr):
- print("The second string comes first alphabetically.")
- else:
- print("The first and second string are same")
Explanation:
Firstly, prompt the user to input two strings (Line 1 - 2).
Next create if else if statement to check if the firstStr is less than, greater than or equal to the secondStr and then print the appropriate message accordingly (Line 4- 9). For example, the program display message "The first string comes first alphabetically." if it find the firstStr is less than secondStr.
Answer:
C. The energy used to create and maintain technology
#Carry on learning po
Answer:
the output of that code would be invalid syntax since the line,
>>> numA = numA * 5
is not indented.
The output of
>>> numA = 2
>>> while numA < 30:
>>> numA = numA * 5
>>> print(numA)
would be 50.
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".
Answer:
First and foremost, what is network architecture? It's basically the physical and logical design which refers to the software, hardware, protocols and the media of transmission of data. Simply put, it refers to how computers are organized and how tasks are allocated among these computers. The two types of widely used network architectures are peer-to-peer aka P2P and client/server aka tiered.
Peer-to-Peer Architecture
In a peer-to-peer network, tasks are allocated to every device on the network. Furthermore, there is no real hierarchy in this network, all computers are considered equal and all have the same abilities to use the resources available on this network. Instead of having a central server which would act as the shared drive, each computer thats connected to this network would act as the server for the files stored on it.