Unit 2 Exercise: Logic Drill 2

 

Write out the logic to the following problems.

Example: Represent the logic of a decision whether to wear a coat if the temperature is less than 60 degrees Fahrenheit, and not to wear one if the temperature is 60 degrees or greater.

Solution:

start

Declarations

        integer temperature

output “Enter temperature: “

input temperature

if (temperature <60)

        output “Wear coat.”

else

       output “Don’t wear coat.”

end if

stop

  1. Represent the logic of a program that allows the user the decide if an employee is eligible for overtime pay.  If the employee is hourly, then output “Eligible for overtime,” and  if the employee is salaried, then output “Not eligible for overtime.”
  2. Represent the logic of a program decides which award to give an employee based on years of service.  Someone with more than 25 years of service gets a gold watch, and someone with 25 years or less of service receives a pen and pencil set.
  3. Represent the logic of a program that allows the user to enter a value between 1 and 100. The program determines if the value is even or odd, and outputs either “The number is even,” or “The number is odd.”

Put your solutions in a Word document,

The post Unit 2 Exercise: Logic Drill 2 appeared first on Essay Writers.

 

Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code “Newclient”

The post Unit 2 Exercise: Logic Drill 2 appeared first on Essay Writers.


Unit 2 Exercise: Logic Drill 2 was first posted on February 27, 2020 at 1:28 pm.
©2019 "Essay Writers". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at Essay Writers.

Source link

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply