Answer:
while(is_sunny=="n")
Explanation:
The loop keeps repeating itself until a certain condition is met.
Here while loop keeps executing until value of is_sunny is not equal to 'n'
When the value of is_sunny is not equal to n then the loop stops.
So lets explain this logic with a chunk of code:
#include <iostream> //to use input output functions
using namespace std; //to identify objects like cin cout
int main() { //start of main function
string is_sunny = "n"; //value of is_sunny is set to n
cout<<"Enter value of is_sunny: "; // prompts user to enter value of is_sunny
cin>>is_sunny; // reads value of is_sunny from user
while(is_sunny=="n") // keeps iterating until value of is_sunny is not equal to n
{ cout<<"keep executing until is_sunny is not equal to n"<<endl;//display this message with each iteration
cout<<"Enter value of is_sunny: "; //keeps prompting to enter is_sunny
cin>>is_sunny; } } //keeps reading value of is_sunny from user
Now if the user keeps entering "n" as value of is_sunny then the loop keeps repeating. When the user enters any string other than n then the loop breaks. The output of the program is attached.
Answer:
yield is good and Jerry brown is a letter from the meaning of his life
Answer:
See explaination
Explanation:
import re
def isValidTrain(train):
pattern = r'^E+(((P|PP|PPP|PPPP)D)*(BB)*)*C$'
if re.match(pattern, train):
return True
return False
def checkAndPrintTrain(train):
print("Train", train, "is valid:", isValidTrain(train))
checkAndPrintTrain("EC")
checkAndPrintTrain("EEEPPDBBPDBBBBC")
checkAndPrintTrain("EEBB")
checkAndPrintTrain("EBBBC")
checkAndPrintTrain("EEPPPPPPDBBC")
checkAndPrintTrain("EEPPBBC")
checkAndPrintTrain("EEBBDC")
Sample output
Train EC is valid: True
Train EEEPPDBBPDBBBBC is valid: True
Train EEBB is valid: False
Train EBBBC is valid: False
Train EEPPPPPPDBBC is valid: False
Train EEPPBBC is valid: False
Train EEBBDC is valid: False
Answer:
The length of the ladder should be 277.85 meters long
Explanation:
Great question, it is always good to ask away and get rid of any doubts that you may be having.
I have created an illustration and attached it as a photo below to better help you understand the situation. As seen on the illustration the difference in height of Building B from Building A is,
Now that we have the difference we need to find the length of the ladder which is the hypotenuse between the two buildings. We can calculate this by using the Pythagorean theorem which is the following
Now we can plug in the values and solve for the hypotenuse (h)
... square root of 77,200
.... rounded up
Therefore, the length of the ladder should be 277.85 meters long
I hope this answered your question. If you have any more questions feel free to ask away at Brainly.