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.:- M93116827
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Please discuss the followingas demand increased for these

Please discuss the following: As demand increased for these mortgage backed securities, lenders reacted by relaxing their approval standards to increase production. No longer were "all" borrowers required to document the ...

Requirementsdesign and implement an application with a

Requirements Design and implement an application with a graphical user interface to manage a library of songs. A song is uniquely identified by name and artist (case insensitive). Your application should have a SINGLE WI ...

1i which of the following characterizes a market ordera a

1) i. Which of the following characterizes a market order? a) A market order, which is considered a small order, is when 100 shares of a stock are ordered b) A market order is when the investor specifies the maximum pric ...

Consider two computer companies - orange and ph - that

Consider two computer companies - Orange and PH - that report current sales receipts of $323 million and $294 million, respectively. Their cur-rent operating expenses were $150 million each. Orange issued $5 million in n ...

Starting with this provided code add the following

Starting with this provided code, add the following functionality: Add the numbers 3 through 10 to the hashtable continuing in the same manner as shown. Prompt the user for a string, and display the corresponding number. ...

Question 1conduct research to determine three types of

Question: 1. Conduct research to determine three types of computer crime. Please provide a detailed description for all crimes, and share an example of where an organization was impacted by each of the types. 2. Elaborat ...

To review stacksdirections write java code that prompts the

To review stacks Directions : Write Java code that prompts the user for a string and tells them if the grouping characters in that string are balanced. Grouping characters are ( and ), [ and ], and { and }. I got the bas ...

Question suppose that in responding to interrupts from an

Question : Suppose that in responding to interrupts from an I/O device the processor consumes 1000 cycles in performing the context switch required to transfer control to the interrupt handler. Servicing the device reque ...

Software engineeringsuppose you are writing software for a

Software Engineering: Suppose you are writing software for a radio station that manages its playlists. The program will generate candidate playlists from a record library automatically and station personnel can then chec ...

Question research different information systems management

Question : Research different information systems management disaster response plans of major organizations that have had to respond to fairly recent disasters. Discuss the results of the organization's recovery efforts.

  • 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