Engineering : asked on zazy15
 21.06.2021

Say the types of operaters

:(

. 0

Faq

Engineering
Step-by-step answer
P Answered by Specialist

\: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \:\red{ \rule{9pt}{99999pt}} \orange{ \rule{9pt}{99999pt}} \color{yellow}{ \rule{9pt}{99999pt}} \green{ \rule{9pt}{99999pt}} \blue{ \rule{9pt}{99999pt}} \purple{ \rule{9pt}{99999pt}}

Engineering
Step-by-step answer
P Answered by PhD

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.

Engineering
Step-by-step answer
P Answered by Master

"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.
Engineering
Step-by-step answer
P Answered by PhD

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()

Engineering
Step-by-step answer
P Answered by PhD

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

Engineering
Step-by-step answer
P Answered by PhD

x=float(input("Enter a number: "))

sub=(x-int(x))

print(sub)

Explanation:

Got it Right

Engineering
Step-by-step answer
P Answered by PhD
There’s 5 different types of fire extinguishers that you can differentiate by their color codes.
Red - Water based
Creme - Foam based
Blue - Powder based
Black - CO2 or carbon dioxide based
Yellow - Wet chemical based

What would determine the type of fire extinguisher used would be the class of fire it is.

Class A - Combustible materials ( i.e. paper, wood) Extinguishers to use - Red, Creme, Blue, and Yellow. (Do not use Black)

Class B - Flammable liquids ( i.e. paint, petrol, alcohol) Extinguishers to use - Creme, Blue, and Black. (Do not use Red or Yellow)

Class C - Flammable gases ( i.e. butane, methane) Extinguishers to use - Blue (Do not use Red, Creme, Black or Yellow)

Class D - Flammable metals ( i.e. lithium, potassium) Extinguishers to use - Blue (Do not use Red, Creme, Black or Yellow)

Class F - Deep fat fryers ( i.e. chip pans) Extinguishers to use - Yellow (Do not use Red, Creme, Blue or Black)

Electrical - any sort of electrical equipment
( i.e. computers, generators) Extinguishers to use - Blue and Black (Do not use Red, Creme or Yellow)
Engineering
Step-by-step answer
P Answered by Master

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 .


The longest_word function is used to compare 3 words. It should return the word with the most number
Engineering
Step-by-step answer
P Answered by Specialist

Here is the fractional_part() function:

def fractional_part(numerator, denominator):

   if denominator != 0:

       return (numerator % denominator)/denominator

   else:

       return 0

Explanation:

I will explain the code line by line.

The first statement it the definition of function fractional_part() which takes two parameters i.e. numerator and denominator to return the fractional part of the division.

Next is an if statement which checks if the value of denominator is 0. If this is true then the function returns 0. If this condition evaluates to false which means that the value of denominator is not 0 then return (numerator % denominator)/denominator  is executed. Now lets see how this statement works with the help of an example.

Lets say the value of numerator is 5 and denominator is 4. (numerator % denominator)/denominator will first compute the modulus of these two values. 5 % 4 is 1 because when 5 is divided by 4 , then the remainder is 1. Now this result is divided by denominator to get the fractional part. When 1 is divided by 4 the answer is 0.25. So this is how we get the fractional part which is 0.25.  

The program with output is attached.


The fractional_part function divides the numerator by the denominator, and returns just the fraction

Try asking the Studen AI a question.

It will provide an instant answer!

FREE