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]
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
assume a five layer network model. There are 700 bytes of application data. There is a 20 bye header at the transport layer, a 2
amm1812

Answer: The overhead percentage is 7.7%.

Explanation:

We call overhead, to all those bytes that are delivered to the physical layer, that don't carry real data.

We are told that we have 700 bytes of application data, so all the other bytes are simply overhead, i.e. , 58 bytes composed by the transport layer header, the network layer header, the 14 byte header at the data link layer and the 4 byte trailer at the data link layer.

So, in order to assess the overhead percentage, we divide the overhead bytes between the total quantity of bytes sent to the physical layer, as follows:

OH % = (58 / 758) * 100 = 7.7 %

4 0
2 years ago
Compared to 15 mph on a dry road, about how much longer will it take for
Marysya12 [62]

Answer:

8 to 10 times

Explanation:

For dry road

u= 15 mph        ( 1 mph = 0.44 m/s)

u= 6.7 m/s

Let take coefficient of friction( μ) of dry road is 0.7

So the de acceleration a = μ g

a= 0.7 x 10  m/s ²                         ( g=10 m/s ²)

a= 7 m/s ²

We know that

v= u - a t

Final speed ,v=0

0 = 6.7 - 7 x t

t= 0.95 s

For snow road

μ = 0.4

de acceleration a = μ g

a = 0.4 x 10 = 4 m/s ²

u= 30 mph= 13.41 m/s

v= u - a t

Final speed ,v=0

0 = 30 - 4 x t'

t'=7.5 s

t'=7.8 t

We can say that it will take 8 to 10 times more time as compare to dry road for stopping the vehicle.

8 to 10 times

7 0
3 years ago
Read 2 more answers
A four-cylinder, four-stroke internal combustion engine has a bore of 3.7 in. and a stroke of 3.4 in. The clearance volume is 16
abruzzese [7]

Answer:

1) The three possible assumptions are

a) All processes are reversible internally

b) Air, which is the working fluid circulates continuously in a closed loop

cycle

c) The process of combustion is depicted as a heat addition process

2) The diagrams are attached

5) The net work per cycle is 845.88 kJ/kg

The power developed in horsepower ≈ 45374 hP

Explanation:

1) The three possible assumptions are

a) All processes are reversible internally

b) Air, which is the working fluid circulates continuously in a closed loop

cycle

c) The process of combustion is depicted as a heat addition process

2) The diagrams are attached

5) The dimension of the cylinder bore diameter = 3.7 in. = 0.09398 m

Stroke length = 3.4 in. = 0.08636 m.

The volume of the cylinder v₁= 0.08636 ×(0.09398²)/4 = 5.99×10⁻⁴ m³

The clearance volume = 16% of cylinder volume = 0.16×5.99×10⁻⁴ m³

The clearance volume, v₂  = 9.59 × 10⁻⁵ m³

p₁ = 14.5 lbf/in.² = 99973.981 Pa

T₁ = 60 F = 288.706 K

\dfrac{T_{2}}{T_{1}} = \left (\dfrac{v_{1}}{v_{2}}  \right )^{K-1}

Otto cycle T-S diagram

T₂ = 288.706*6.25^{0.393} = 592.984 K

The maximum temperature = T₃ = 5200 R = 2888.89 K

\dfrac{T_{3}}{T_{4}} = \left (\dfrac{v_{4}}{v_{3}}  \right )^{K-1}

T₄ = 2888.89 / 6.25^{0.393} = 1406.5 K

Work done, W = c_v×(T₃ - T₂) - c_v×(T₄ - T₁)

0.718×(2888.89  - 592.984) - 0.718×(1406.5 - 288.706) = 845.88 kJ/kg

The power developed in an Otto cycle = W×Cycle per second

= 845.88 × 2400 / 60  = 33,835.377 kW = 45373.99 ≈ 45374 hP.

8 0
3 years ago
When water precipitates from the sky, runs off downhill along the ground, or infiltrates down into the soil, its gravitational p
agasfer [191]

Answer:

Geothermal energy.

Explanation:

Geothermal energy is called a renewable energy source because the water is replenished by rainfall, and the heat is continuously produced by the earth.

8 0
3 years ago
The purpose of pasteurizing milk is to A. Kill pathogens B. Break down milk fat C. Add vitamins and minerals D. Prevent spoilage
motikmotik
Answer: A Kill pathogens
7 0
2 years ago
Other questions:
  • True or false? Don't break or crush mercury-containing lamps because mercury powder may be released.
    8·1 answer
  • I have a plot plan with an angle of 35 degrees on the main lot, how will this affect the construction of the basement
    9·1 answer
  • Oil with a density of 850 kg/m3 and kinematic viscosity of 0.00062 m2 /s is being discharged by a 8-mm-diameter, 40-m-long horiz
    5·1 answer
  • While discussing run-flat tires: Technician A says that some are self-sealing tires and are designed to quickly and permanently
    15·1 answer
  • Explain why the following acts lead to hazardous safety conditions when working with electrical equipmentA) Wearing metal ring o
    11·1 answer
  • Might give brainliest
    8·1 answer
  • An inventor claims to have developed a heat engine that produces work at 10 kW, while absorbing heat at 10 kW. Evaluate such a c
    12·1 answer
  • I really need help i will give brainly plz no funny answers
    14·1 answer
  • I will mark brainliest.
    6·2 answers
  • Whose responsibility is it to provide direction on correct ladder usage?<br> select the best option.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!