Answer:
def compute_pay(number_of_hours, rate_of_pay):
if number_of_hours > 40:
pay_for_week = (40*rate_of_pay)+((number_of_hours-40)*\
(rate_of_pay+rate_of_pay*0.5))
else:
pay_for_week = number_of_hours*rate_of_pay
if pay_for_week >= 375:
print("Paying %d by direct deposit" % pay_for_week)
else:
print("Paying %d by mailed check" % pay_for_week)
Explanation:
- We define the computer pay function that receives the number of hours worked in a week and the rate of pay
- From the test cases we deduce that if a worker works more than 40 hours a week an extra payment is given, you can calculated it as follow: (40 * rate_of_pay) + ((number_of_hours - 40) * (rate_of_pay + rate_of_pay * 0.5))
- If a worker works less than 40 hours the payment is calculated as follow: pay_for_week = number_of_hours * rate_of_pay
- If the pay for week is equal or greater than 375 we print a payment by direct deposit otherwise we print payment by mailed check
There are many different ways you can learn how to code, You can use free and paid online courses, Youtube Videos, and Trial and Error. Programming does not come easy and you have to be patient with yourself. Its like learning to drive for the first time, its a little rough but you eventually will catch on and be able to understand what you are doing!
1.) There are many websites that will help teach you different languages like Java, JS, C#, Python, Ruby, Html5, etc.
Here are a few of my favorite websites that helped me.
Code Academy: https://www.codecademy.com/
Khan Academy: <span>https://www.khanacademy.org/
</span>W3Schools (Html Only, Not a Course just useful) http://www.w3schools.com/
I suggest going through those websites, or finding some other websites out there that will help you!
2.) Youtube Videos are perfect for learning specific things in programming! You can learn how to make a calculator, or a website, or anything you'd like! Just simply search for a how-to tutorial and watch the helpful videos! Remember, don't just copy the code.. try and understand it
3.) Trial and Error is one of the best ways you can teach yourself code. It was the best way for me to learn. Everyone learns from their mistakes and you should always try and come up with new things.
Be patient, and enjoy what you are doing! I also suggest working on one language at a time, don't try and learn two or more languages at the same time! Good luck :) Email me at any time if you need any help!
Answer:
First shift - 1101
Second shift - 0110
Third shift - 1011
Fourth shift - 1101
Fifth shift - 0110
Sixth shift - 1011
Explanation:
Each time you shift a register to the right, you do 3 things:
- The rightmost digit drops off
- You move the next three digits over one position to the right
- You fill in the leftmost position with one of the numbers from your serial input.
Contents are initially 1011. The 1 on the right disappears. The leftmost 3 digits (101) end up in the last 3 positions of the register. The first position of the register takes a number from the serial input, which is 1 in this case. So you end up with 1101.
Do this a second time. The rightmost 1 is gone, the 110 end up as the last 3 positions of the register, and you end up with 0 in the leftmost position. This one is 0110.
The remaining 4 follow the same pattern.
(CSE) style is used in scientific research papers. In this style there are three systems of documentation, but all of them are appropriate styles to write a scientific paper and make proper references to them. Although all could in some context be taken as scientific, only one really pops out and that's biology.