So since 256 color mode is depreciated and no longer supported under Direct3D mode, I got the idea to use a pixel shader instead to simulate the NES palette of all possible colors so that fading objects and whatnot don't have smooth fade outs with alpha channels.  (I know objects couldn't really fade out on the NES, but I have all objects that do fade in and out on a solid black background, which would be possible with palette swapping.  Also, the screen fades in and out when you pause which I know also was possible with palette swapping as it was done in a few Mega Man games.)  Problem is, I know next to nothing about HLSL shaders.

How do I do it?


Question: Why do I get the wrong result from this program to compute gross pay?
Answer: There are a few problems with the way you've approached this.


The question specifies that the rate of pay only increases after 40 hours are worked, and so if 45 hours are worked, only 5 of those hours earn the overtime rate.

Look at the way you have written your if statement, and you should be able to see an incongruence between your code and the question. In particular, you'll need to look at the else: section.
When calculating pay using the standard or overtime rate, remember that the new rate will be a function of the old one. You should be able to see in your code that setting r = 1 or r = 1.5 will cause a problem. Assuming 10 hours have been worked, your code will produce 10 * 1 instead of 10 * rate_hour


To help you:


To modify a variable number such that it is doubled, variable = variable * 2
Calculating pay when more than 40 hours are worked will require 2 separate calculations, so you may want to create a variable pay under if: and else:, and then print that.