Code:
#include <iostream>
using namespace std;
int main()
{
int Car_Year;
cout<<"Please Enter the Car Model."<<endl;
cin>>Car_Year;
if (Car_Year<1967)
{
cout<<"Few safety features."<<endl;
}
else if (Car_Year>1971 && Car_Year<=1991)
{
cout<<"Probably has head rests."<<endl;
}
else if (Car_Year>1991 && Car_Year<=2000)
{
cout<<"Probably has antilock brakes."<<endl;
}
else if (Car_Year>2000)
{
cout<<"Probably has airbags."<<endl;
}
else
{
cout<<"Invalid Selection."<<endl;
}
return 0;
}
Output:
Please Enter the Car Model.
1975
Probably has head rests.
Please Enter the Car Model.
1999
Probably has antilock brakes.
Please Enter the Car Model.
2005
Probably has airbags.
Please Enter the Car Model.
1955
Few safety features.
Explanation:
We were required to implement multiple If else conditions to assign car model year with the corresponding features of the car.
The code is tested with a wide range of inputs and it returned the same results as it was asked in the question.
"Test Phase " is the correct choice.
Explanation:
DevSecOps seems to be a community as well as experience of corporate data science which encompasses software design, regulation, including operational activities. This same main feature of DevSecOps has always been to strengthen customer achievement as well as expedition importance by computerizing, supervising as well as implementing data protection at all stages of the development including its development tools.The testing method throughout the test phase would then help make sure that the controller is designed mostly under the responsibilities forecasted. The test focuses on either the reaction times, dependability, use of resources but instead interoperability of applications.NTQ
Explanation:
The given sequence is
BHE : FLI : JPM
If is clear that, alphabets on first places are B, F, J. Difference between their place vales is 4.
B+4=F,F+4=J ; so alphabet on first place of next term of sequence is J+4=N.
Similarly, alphabets on second places are H, L, P. Difference between their place vales is 4.
H+4=L,L+4=P ; so alphabet on second place of next term of sequence is P+4=T.
Alphabets on third places are E, I, M. Difference between their place vales is 4.
E+4=I,I+4=M ; so alphabet on third place of next term of sequence is M+4=Q.
Therefore, the next term is NTQ.
The following code or the program will be used
Explanation:
def readFile(filename):
dict = {}
with open(filename, 'r') as infile:
lines = infile.readlines()
for index in range(0, len(lines) - 1, 2):
if lines[index].strip()=='':continue
count = int(lines[index].strip())
name = lines[index + 1].strip()
if count in dict.keys():
name_list = dict.get(count)
name_list.append(name)
name_list.sort()
else:
dict[count] = [name]
print(count,name)
return dict
def output_keys(dict, filename):
with open(filename,'w+') as outfile:
for key in sorted(dict.keys()):
outfile.write('{}: {}\n'.format(key,';'.join(dict.get(key
print('{}: {}\n'.format(key,';'.join(dict.get(key
def output_titles(dict, filename):
titles = []
for title in dict.values():
titles.extend(title)
with open(filename,'w+') as outfile:
for title in sorted(titles):
outfile.write('{}\n'.format(title))
print(title)
def main():
filename = input('Enter input file name: ')
dict = readFile(filename)
if dict is None:
print('Error: Invalid file name provided: {}'.format(filename))
return
print(dict)
output_filename_1 ='output_keys.txt'
output_filename_2 ='output_titles.txt'
output_keys(dict,output_filename_1)
output_titles(dict,output_filename_2)
main()
Energy equation from this week’s notes, your answer from #5, and Plank’s constant (6.63E-34) to find the approximate energy of this photon
Explanation:
1.The amount of energy in those photons is calculated by this equation, E = hf, where E is the energy of the photon in Joules; h is Planck's constant, which is always 6.63 * 10^-34 Joule seconds; and f is the frequency of the light in hertz
2.The first is Planck's equation, which was proposed by Max Planck to describe how energy is transferred in quanta or packets. Planck's equation makes it possible to understand blackbody radiation and the photoelectric effect. The equation is:
E = hν
where
E = energy
h = Planck's constant = 6.626 x 10-34 J·s
ν = frequency
x=float(input("Enter a number: "))
sub=(x-int(x))
print(sub)
Explanation:
Got it Right
understanding others first before starting to explain your own point
Explanation:
Stephen covey believes the key to effective communication is understanding others first before starting to explain your own point. Communication is an important skill in life, in which one must have a good character in order to communicate effectively.
len(word2) >= len(word1) and len(word2) >= len(word3):
Question with blank is below
def longest_word(word1,word2,word3):
if len(word1) >= len(word2) and len(word1) >= len(word3):
word = word1
elif _________________________________________
word = word2
else:
word = word3
return word
print(longest_word("chair","couch","table"))
print(longest_word("bed","bath","beyond"))
print(longest_word("laptop","notebook","desktop"))
print(longest_word("hi","cat","Cow"))
Explanation
In line 1 of the code word1, word2, and word3 are the parameters used to for the defining the longest_word function. They will be replaced by 3 words to be compared. The code that is filled in the blank is len(word2) >= len(word1) and len(word2) >= len(word3): It is a conditional statement that is true only if the number of characters in the string of word2 is greater than or equal to word1 and word2 is greater than that of word3 .
It will provide an instant answer!