

General computing tip: if that happens you can press ctrl and c and it will stop the current program(assuming windows). Useful when making console apps especially when you are learning and are likely to make mistakes and infinite loops.


General computing tip: if that happens you can press ctrl and c and it will stop the current program(assuming windows). Useful when making console apps especially when you are learning and are likely to make mistakes and infinite loops.


Also look up the modulo operator. It’s similar to integer division but ONLY returns the remainder. It’s useful if you want to have something with multiple division steps for example.
38 hours is how many days? 38 / 24 = 1 with your current setup
38 / 24 = 1.583333333 if you use floats
38 % 24 = 14… % is the modulo operator
Combine your setup and the modulo you could output something like “there is 1 day and 14 hours over course of 38 hours” which is much more human usable since most people don’t know how long 0.583333333 is but know 14 hours.
Or doing money… I’ll leave this up to you as a mental exercise for you but say you want to give someone $46.28 in cash. How many and what type of bills and coins would you give? Hint while 4628 pennies would be true it’s not the answer you want.


Just warning you, the rpn suggestion is pretty complex and would be a complete rewrite. You are on chapter 2, rpn would probably be covered in the second book.


All the other tips are great. I would also recommend checking out a switch statement, for example https://www.geeksforgeeks.org/c/c-switch-statement/
This will clean up alot of the else if statements. Also I would work on code to organization. For example you test if the choice is greater than or equal to 6 or less than 1, then if it is equal to 5 then check again if it’s less than 5 and greater than 0. You already did that third check.
If you want to go slightly more advanced I would put the steps to ask for and save the input numbers into a function then just call that function on each of the following choices. Would add a functional call but would remove another if statement. If you name it well it would also help on code readability.
Also if you want to take this farther like taking more than 2 numbers or more than 1 operation (for example 2 + 3 * 4) look into reverse polish notation. Basically it’s how to store the equation to make executing them correctly easier. That might be a little advanced for you at this stage though.


That may be my only choice. Was trying to avoid it as I don’t want to lose everything on my computer and dual booting would be difficult as I don’t have a huge hard drive.


I “tried” Linux but never got it usable. I initially decided to run a vm on virtualbox to experiment. I tried Debian, arch, kali, Ubuntu and all ended up having an input lag of 1-2 seconds. Windows the system was fine. But I found my self unable to do basic tasks it was no bad. I don’t mean I didn’t know a command or unwilling to find a foss software equivalent, I mean it took several tries to get the mouse over the X to close a program due to input lag.
OK I then decided to try a docker container with Linux. It got so messed up if I open docker desktop it displays an error that the container was unable to start, if you close the error to edit settings or create a new container it closes docker desktop, no way to fix it.
I was able to get a wsl command line working but all I found it able to do is add 5 steps to everything due to having to start the command, start wsl, log on, elevate permissions etc.


Eve was great as a community… Sucked as a game. That’s coming from someone with over a thousand hours.
No, misfortune for the people who depend on their products
That’s not the scary part, it’s a fortune 500 international company whose customers could die if the product didn’t work…
That’s not even code grief…
Two examples that were far worse:
My last company wanted software developers. They offered to send me to code boot camp and give me a promotion. The boot camp was primarily python. I complete and get the promotion. New manager tells me the code base I’ll work on is actually c… Umm ok. New manager retires a week later. I spend a few weeks basically teaching myself c. New manager is assigned. He tells me I should basically assist the senior Dev, ok no problem. Find out the code base is actually c#… Should be doable it’s c based atleast. It’s c# framework 4.8 based on winforns… No one in the building had heard of a unit test…the code was released to production on December of '23. Oh and yeah the senior Dev then announced he was retiring. There are no other c# programmers on the team.
I told this story before recently. On a separate c# code base the “login” function had hard coded credentials in the source, which checked if they existed in a local sql database table with one entry(the hard coded values) and then verified the returned value for “password” was >= than 5. It then logged you in. Didn’t check if the password was correct or even the correct length just that the return of the select statement was greater than or equal to 5 characters… Just for fun remember that false is 5 characters 😂


Honestly it works. The act of vocalizing your thoughts sometimes gives you answers. Doesn’t need to be a toddler, the classic is a rubber duck I knew someone who had an action figure of iron man. He would tell people he struggled with a problem he would just ask Tony stark.


I don’t know, the number of problems I figured out quickly by describing the logic to a toddler…


To me the best use of cli is troubleshooting remotely. I don’t mean like ssh I mean like talking over the phone. It’s easier to say “type in this command” then say "at the top of the window there should be a menu bar, near the right, no not all the way to right, no don’t click the red x, it should say tools, move your mouse over tools, God damn it I said DON’T click the red x, now we have to start over, click the icon on the desktop, no I don’t know why it’s called icon, it doesn’t mean anything religious, please just open the application… I don’t care if you are Christian and find the term icon offesive… Hurry up I am late for the AA meeting I need after dealing with people like you. " wait the problem may just be coworkers…


Why are all the th letters in your message replaced with another character?


I hope not. I hope it’s just for pure chaos.
Like imagine going to the store, everything is normal and you pay like normal. Then you leave and stop to get gas and grab your wallet and somehow there is a blueberry in your pocket. I’d start questioning reality…


Look up Jimmy Carr’s laugh it’s Umm… Unique.


Since the op is talking about python, I recommend pythontutor.com it is a visual debugger and not only shows the values of variables but shows the scope which each variable exists in.
Funny story of the at one about 10 years ago I rented a room in a house with these two old(60+) alcoholics. We split the cable/internet bill, normally it was $270 a month ($90 per person). At the time I was about to move across the country and was doing business trips back and and forth. This month I was there for about 1 week. The cable bill came in and it was close to a grand.
They wanted me to pay $350 and I said no! I called the cable company and asked why it was so high. They said it was from like 14 porn movies being purchased all from one cable box(I never even unboxed mine) over a week end. They gave me the serial of the box and I checked all the boxes. I found out who it was, I payed my $90 dollars and told them to figure out the rest. I moved out the end of the next month, never did learn what happened to the bill(wasn’t in my name thankfully).


Yes but for example for seizures I want a simple form, not having to type in entries. Especially for siezures, it’s normally a busy event of caring for him, having to add a seizure taking more than a minute means it probably won’t be used.
For a small amount of time in a lot of cases. It would likely run out of memory and crash the system.