Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Python programming

Please I would like some help in checking if my source code for is susceptible to short-circuit evaluation.I don't need answers, I just need corrections. The source code is to check the integer parts of the both numbers to see if they are even or odd, and prints exactly one of the following messages on the screen:

The decimal part of the both numbers is odd. or

The decimal part of the both numbers is even. or

The decimal part of the number a is even, but the decimal part of the number b is odd. or

The decimal part of the number a is odd, but the decimal part of the number b is even.

Source code:

#Part2 - odd & even number

enter3 = print("Please enter two numbers: ")

enter4 = int(float(input("Enter number 1: ")))

enter5 = int(float(input("Enter number 2: ")))

if (enter4%2 == 0) and (enter5%2 == 0):

  print("The decimal part of both numbers is even.")

elif (enter4%2 != 0) and (enter5%2 != 0):

  print("The decimal part of both numbers is odd.")

elif (enter4%2 == 0) and (enter5%2 != 0):

  print("The decimal part of the number a is even, but the decimal part of the number b is odd.")

else:

  print("The decimal part of the number a is odd, but the decimal part of the number b is even.")

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93118089
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question? 


Related Questions in Computer Engineering

Select two application areas for data mining not discussed

Select two application areas for data mining NOT discussed in the text book and briefly discuss how data mining is being used to solve a problem (or to explore an opportunity)?

Identify at least two 2 factors that have led to the

Identify at least two (2) factors that have led to the explosive growth of digital crime over the past a few decades. Next, describe the most common forms of digital crime, and give your opinion as to why those forms you ...

Restaurant management database project the restaurant

Restaurant Management Database Project : The restaurant maintains the catalog for the list of food and beverage items that it provides. Apart from providing food facility at their own premises, the restaurant takes order ...

What is the supply curve how do you apply the law of supply

What is the supply curve, how do you apply the law of supply in economics?

Give an example of a binary relation which is not

Give an example of a binary relation which is not transitive, and then give an example of a binary relation which is reflexive and transitive but not connected.

What are some skills individuals who work in the field of

What are some skills individuals who work in the field of cyber security need to prevent hacks in to a company's computers?

Question suppose that we want to create a divide and

Question : Suppose that we want to create a divide and conquer matrix multiplication algorithm for square matrices. Assuming that n is a power of three, the algorithm divides each matrix of A, D, and C into nine equi-siz ...

A software engineering question regarding black-box testing

A Software Engineering question, regarding Black-Box Testing Techniques: Q:- A program computes its output variable T according to the following formula: [ x as in multiply] 1)T = X x 0.2 + Y x 0.4 + Z x 0.4 where X>= 50 ...

You have 2 tasks to createer-modeling in ms visio simple

You have 2 tasks to createER-Modeling in MS visio. Simple jab for the database expert that would take him 30 min to finish. My requirement not only for the expert to get the task done. I need to do it myself. Then he cor ...

Please help with anbspfunctionnbspcodesymbol to convert

Please help with a function  codeSymbol , to convert each mark to a symbol (A, B, C, D, E, F) and a code (7,6,5,4,3,2,1) according to the table below. And call it in the main function. Use the table below to determine th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As