1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Serggg [28]
3 years ago
12

Part of the following pseudocode is incompatible with the Java, Python, C, and C++ language Identify the problem. How would you

fix the problem if you were to translate theis pseudocode into one of the aforementioned languages?. Module checkEquality(Integer num1, Integer num2)
If num1 = num2 Then

Display *The values are equal.*

Else

Display *The values are Not equal.*

End if

End Module
Engineering
1 answer:
hammer [34]3 years ago
4 0

Answer:

The main problem is the incorrect use of assignment operator, the correct way to check if two number are equal is

num1==num2

Explanation:

Here we have a created a simple function which takes two input arguments num1 and num2. In the body of the function we have used if condition to find out whether the two number are equal or not. If condition is true then print that values are equal. If condition is false then print that values are not equal. In the driver code, we have called the function two times with different values of num1 and num2 to check if it is working correctly.

The implementation logic is same in all these programming languages, the only difference the syntax.

Python Code:

def checkEquality(num1, num2):

   if num1 == num2:

       print("The values are equal.")

   else:

       print("The values are not equal.")

Driver Code:

checkEquality(2,5)

checkEquality(3,3)

Output:

The values are not equal.

The values are equal.

C++ Code:

void checkEquality(int num1, int num2) {

   if (num1 == num2)

       cout<<"The values are equal."<<endl;

   else

       cout<<"The values are not equal."<<endl;

}

Driver Code:

#include <iostream>

using namespace std;

void checkEquality(int num1, int num2);

int main()

{

checkEquality(2,5);

checkEquality(3,3);

return 0;

}

Output:

The values are not equal.

The values are equal.

You might be interested in
Find the remaining trigonometric functions of 0 if
garik1379 [7]

Answer:

cosΘ=−√558

tanΘ=−3√5555

cscΘ=83

secΘ=−8√5555

cotΘ=−√553

8 0
3 years ago
2. When performing an alignment, what action should be taken immediately after putting a vehicle on the rack?
mash [69]
D...................
3 0
3 years ago
Concerned with the number of maintenance visits the rocket can undergo before being out of service, you have been informed that
Ainat [17]

Answer:

(a) Mn = M₁ + (n-1) (M₂ -M₁) = 1 + (n- 1) 1 = n (b) n > 10 (exceed 10) or n =11 (c) n >50 or n= 51

After making a journey of 51 times, the rocket will be discarded

Explanation:

Solution

(a) Let Mn denotes the number of  maintenance visits after the nth journey

Then M₁ = 1 , M₂ = 1 +M₁ = 2, M₃ = 1 +M₂ = 3

We therefore, notice that M follows an arithmetic sequence

So,

Mn = M₁ + (n-1) (M₂ -M₁)

= 1 + (n- 1) 1 = n

or Mn =n

(b)  For what value of n we will get  fro Mn > 10

Thus,

n > 10 (exceed 10) or n =11

(c)Similarly of Mn is greater than 50 or Mn>50, the rocket will not be used or reused

So,

n >50 or n= 51

After making a journey of 51 times, the rocket will be discarded

7 0
3 years ago
A heat recovery system​ (HRS) is used to conserve heat from the surroundings and supply it to the Mars Rover. The HRS fluid loop
blagie [28]

Answer:

0.304 L of Freon is needed

Explanation:

Q = mCT

Q is quantity of energy that must be removed = 47 BTU = 47×1055.06 = 49587.82 J

C is specific heat of Freon = 74 J/mol.K = 74 J/mol.K × 1 mol/120 g = 0.617 J/g.K

T is temperature in the area of Mars = 189 K

m = Q/CT = 49587.82/(0.617×189) = 452.23 g = 452.24/1000 = 0.45223 kg

Density of Freon = specific gravity of Freon × density of water = 1.49 × 1000 kg/m^3 = 1490 kg/m^3

Volume of Freon = mass/density = 0.45223/1490 = 0.000304 m^3 = 0.000304×1000 = 0.304 L

7 0
3 years ago
What is differences Between hard shoulder &amp; soft shoulder in civil Engineerin?
r-ruslan [8.4K]

Answer:

<em><u>The 'shoulder' of a road is the land to the edge of the road. On most roads without pavements, the shoulder is a strip of grass or a hedgerow. This is known as a 'soft shoulder'. On a motorway, this strip of land is hardstanding, hence the name 'hard shoulder.'</u></em>

<em><u>Mark</u></em><em><u> </u></em><em><u>as</u></em><em><u> brilliant</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u> </u></em>

5 0
4 years ago
Other questions:
  • A capillary tube is immersed vertically in a water container. Knowing that water starts to evaporate when the pressure drops bel
    11·1 answer
  • Name the important trees of tropical monsoon forest​
    11·1 answer
  • Determine the average and rms values for the function, y(t)=25+10sino it over the time periods (a) 0 to 0.1 sec and (b) 0 to 1/3
    9·1 answer
  • Air in a rigid tank is initially at 320 K and 130 kPa. Heat is added until the final pressure is 438 kPa. What is the change in
    9·1 answer
  • What is the major drawback to use whiskers as a dispersed agents in composites? a)- High price b)- Large length to diameter rati
    7·1 answer
  • Help pls I don’t understand the question.
    9·1 answer
  • A small distiller evaporates 10 L of water per half hour. Alloy tubing exposed to the air serves a condenser to recover steam. T
    14·1 answer
  • Marie and James are bubbling dry pure nitrogen (N2) through a tank of liquid water (H2O) containing ethane (C2H6). The vapor str
    5·1 answer
  • Who was the American founder and leader of the Shakers in the 1770’s who advocated equality, individual responsibility, and peac
    11·2 answers
  • Analyze the example of this band saw wheel and axle. The diameter of the wheel is 14 inches. The diameter of the axle that drive
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!