Answer:
The program in Python is as follows:
sentence = input("Sentence: ")
words = len(sentence.split())
print("Words:", words)
Explanation:
This reads the sentence for the user
sentence = input("Sentence: ")
This counts the number of words
words = len(sentence.split())
This prints the number of words
print("Words:", words)
Answer:
This program is executed in Dev C++ using C++ as a programming language.
Explanation:
#include<iostream>
using namespace std;
int main()
{
int carModelNo;
cout<<"Enter Car Model Number ";
cin>>carModelNo;
EnterAgain:
if(carModelNo==1969)
{
cout<<"Few safety features.";
}
else if(carModelNo==1979)
{
cout<<"Probably has seat belts.";
}
else if(carModelNo==1999)
{
cout<<"Probably has antilock brakes.";
}
else if(carModelNo==2000)
{
cout<<"Probably has airbags.";
}
else
{
"Car Model Information Currently not Available";
cout<<"Please enter the car model such as 1969, 1979, 1999, or 2000 ";
cin>>carModelNo;
goto EnterAgain;
}
return 0;
}
Answer:
The answer is "Always true
"
Explanation:
Following are the program to this question:
#include <iostream>//header file
using namespace std;
int main()//main method
{
bool x=true;//defining bool variable x and assign value
bool y=false;//defining bool variable y and assign value
if(!(x || y) || (x || y))//use given condition with if block
{
cout<<"True";//print true message
}
else//defining else block
{
cout<<"false";//print false message
}
return 0;
}
In the above code two bool variable is declared, that hold ture and false, and used in the given expression with the condition statement, that checks the given value. In the code the logical gate OR gate that always print the true value.
Answer:
b. 1/8"
Explanation:
In This scenario this installation does not require any penetration protection as long as the space between the electrical box and the wall membrane does not exceed 1/8 of an inch. This is mainly a safety precaution to prevent accident's such as an electrical fire or electrocution as well as meeting the specs for the rest of the house to be built perfectly without modifications.
Any of these can cause a disorder of this degree