answer.
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]
2 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]2 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
air at 600 kPa, 330 K enters a well-insulated, horizontal pipe having a diameter of 1.2 cm and exits at 120 kPa, 300 K. Applying
notsponge [240]

Answer:

a) 251.31 m/s and 55.29 m/s

b) The mass flow rate is 0.0396 kg/s

c) The rate of entropy production is 0.0144 kW/K

Explanation:

a) The steady state is:

mi = mo

\frac{A_{i}V_{i}  }{v_{i} } =\frac{A_{o}V_{o}  }{v_{o} } \\V_{i} =V_{o}(\frac{v_{i}}{v_{o}} )=V_{o}(\frac{T_{i}P_{o} }{T_{o}P_{i} } )=V_{o}(\frac{330*120}{300*600}) =0.22V_{o}

The energy balance is:

h_{i}+\frac{V_{i}^{2} }{2} =h_{2}+\frac{V_{o}^{2} }{2} \\h_{i}-h_{o}+(\frac{V_{i}^{2}-V_{o}^{2}  }{2} )=0\\V_{o}=\sqrt{\frac{2(h_{i}-h_{o})}{0.9516} } =\sqrt{\frac{2*(330.24-300.19)x10^{3} }{0.9516} } =251.31m/s

Vi = 0.22 * 251.31 = 55.29 m/s

b) The mass flow rate is:

m=\frac{A_{o}V_{o}}{v_{o}} =\frac{\pi d^{2}V_{o}P_{o} }{4RT_{o}} =\frac{\pi *(0.012^{2})*251.31*120x10^{3}  }{4*287*300} =0.0396kg/s

c) The entropy produced is equal to:

\frac{Q}{T} +S_{gen} =m(s_{2} -s_{1} )\\0+S_{gen} =m(s_{2} -s_{1} )\\S_{gen} =m(s_{2} -s_{1} )\\S_{gen}=0.0396*(c_{p} ln\frac{T_{o}}{T_{i}} -Rln\frac{P_{o}}{P_{i}} )=0.0396*(1.004ln\frac{300}{330} -0.287ln\frac{120}{600} )=0.0144kW/K

3 0
2 years ago
A heat recovery device involves transferring energy from the hot flue gases passing through an annular region to pressurized wat
Elina [12.6K]

Answer:

See explaination

Explanation:

Please kindly check attachment for the step by step solution of the given problem.

4 0
2 years ago
Consider insulation on a circular pipe For the same thickness and type of insulation, the thermal resistance of the insulation i
leonid [27]

Answer:

b). The same for all pipes independent of the diameter

Explanation:

We know,

R_{conduction}=\frac{ln(\frac{r_{2}}{r_{1}})}{2\pi LK}

R_{convection}=\frac{1}{h(2\pi r_{2}L)}

From the above formulas we can conclude that the thermal resistance of a substance mainly depends upon heat transfer coefficient,whereas radius has negligible effects on heat transfer coefficient.

We also know,

Factors on which thermal resistance of insulation depends are :

1. Thickness of the insulation

2. Thermal conductivity of the insulating material.

Therefore from above observation we can conclude that the thermal resistance of the insulation is same for all pipes independent of diameter.

5 0
2 years ago
A 60-kg woman holds a 9-kg package as she stands within an elevator which briefly accelerates upward at a rate of g/4. Determine
Anuta_ua [19.1K]

Answer:

force R = 846.11 N

lifting force L = 110.36 N

if cable fail complete both R and L will be zero

Explanation:

given data

mass woman mw = 60 kg

mass package mp = 9 kg

accelerates rate a = g/4

to find out

force R and lifting force L and if cable fail than what values would R and L acquire

solution

we calculate here first reaction R force

we know elevator which accelerates upward

so now by direction of motion , balance the force that is express as

R - ( mw + mp ) × g = ( mw + mp ) × a

here put all these value and a = g/4 and use g = 9.81 m/s²

R - ( 60 + 9 ) × 9.81 = ( 60 + 9  ) × g/4

R = ( 69  ) × 9.81/4  + ( 69 ) 9.81

R = 69  ( 9.81 + 2.4525 )

force R = 846.11 N

and

lifting force is express as here

lifting force = mp ( g + a)

put here value

lifting force = 9 ( 9.81 + 9.81/4)

lifting force L = 110.36 N

and

we know if cable completely fail than body move free fall and experience no force

so both R and L will be zero

5 0
2 years ago
A three-point bending test was performed on an aluminum oxide specimen having a circular cross section of radius 3.5 mm (0.14 in
RideAnS [48]

To resolve this problem we have,

R=3.5mm\\F_f1=950N\\L_1=50mm\\b=12mm\\L_2=40mm

F_{f2} is unknown.

With these dates we can calculate the Flexural strenght of the specimen,

\sigma{fs}=\frac{F_{f1}L}{\pi R^3}\\\sigma{fs}=\frac{(950)(50*10^{-3})}{\pi 3.5*10^{-3}}\\\sigma{fs}=352.65Mpa

After that, we can calculate the flexural strenght for the square cross section using the previously value.

\sigma{fs}=\frac{F_{f2}L}{\pi R^3}\\(352.65*10^6)=\frac{3Ff(40*10^{-3})}{2(12*10^{-10})}\\F_{f2}=\frac{352.65*10^6}{34722.22}\\F_{f2}=10156.32N\\F_{f2}=10.2kN

6 0
2 years ago
Other questions:
  • Determine the amount of gamma and alpha phases in a 10-kg, 1060 steel casting as it is being cooled to the following temperature
    6·1 answer
  • Steam flows at steady state through a converging, insulated nozzle, 25 cm long and with an inlet diameter of 5 cm. At the nozzle
    11·1 answer
  • Given a 5x5 matrix for Playfair cipher a. How many possible keys does the Playfair cipher have? Ignore the fact that some keys m
    6·1 answer
  • An art collector is bidding on a statue that would complete a collection he is trying to assemble. The statue is being sold in a
    9·1 answer
  • The velocity of a particle which moves along the s-axis is given by v = 2-4t+5t^(3/2), where t is in seconds and v is in meters
    11·2 answers
  • Two resistors of values 7.0 and 15.0 Ω are connected in parallel. This combination in turn is hooked in series with a 3.8- Ω res
    7·1 answer
  • Sal has many options for how to spend her afternoon. She placed them in the order in which she values them: 1) go to a movie, 2)
    14·1 answer
  • Steam at 40 bar and 500o C enters the first-stage turbine with a volumetric flow rate of 90 m3 /min. Steam exits the turbine at
    9·1 answer
  • Two airstreams are mixed steadily and adiabatically. The first stream enters at 35°C and 30 percent relative humidity at a rate
    6·1 answer
  • While at a concert you notice five people in the crowd headed in the same direction. Your tendency to group them is due to? *
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!