Answer:
havent watched it and thanks for this
Explanation:
Answer:
Sequential Operations: Suppose we want to switch on the LED, fan and a PC. We can do it one by one and in a sequence. And it means step by step in a proper sequence, and that which is mentioned.
Conditional Operation: Suppose we are given a condition that if LED is switched on then you cannot switch on the PC. Such type is known as the conditional operation.
Iterative Operations: If you the number of times a given code is to be looped, or iterative, then we are dealing with the iterative operations.
In pseudo-code we represent them as:
Start
PC_State= Open
LED_State =Open
fan_State =Open
Stop
Condition Statement
If LED= Open
PC=Blocked
Iterative Statement:
For i =1 to 3
Open Device No <i>
And this way the three are different in everyday life, and hence in pseudocode.
Explanation:
Please check the answer section.
Answer:
DNA obj =new DNA;//obj object created dynamically.
DNA *dnaPtr=&obj.//dnaPtr to store the address of the object.
Explanation:
The above written statements are in C++.The DNA object is created dynamically and it is done in C++ by using new keyword which allocates the heap memory for the object.
Then a dnaPtr is created of type DNA so that it can store the address of the DNA objects.
Answer:
int1=int(input("Enter integer :\n"))#taking input of first number.
int2=float(input("Enter the power :\n"))#taking input of the power.
if int2 == 0.5 and int1<0:#condition for negative square root.
print("Cannot calculate the square root of negative numbers")#printing the message.
else:#else calculating the result.
res=int1**int2
print(res)
output:-
Enter integer :
-5
Enter the power :
0.5
Cannot calculate the square root of negative numbers
Explanation:
In the above program I have taken input of the number and the power.Since power can be decimal number taking it as float.If the number is negative and the power is 0.5 then printing the message for not calculating the value else calculating the value and storing it in the res printing the res.