Very new to programming. I would want the user to receive a 10% discount if he/she is over 60 (age>60) and 5% discount if he/she is between over 55 and equal to 60. (60<=age>55). I know that my code is completely wrong, but I would like to fix this step...
I'd like to make StructOpt work with enums such that every time a user passes -d sunday it'd parsed as a Day::Sunday:
I ran the following Java code on a Linux server:It caused one CPU core to reach 100% usage. I'm confused about this, because I learnt that CPUs deal with tasks by time splitting, meaning that the CPU will do one task in one time slot (CPU time range scheduler). If...
I have a list of currency pairs, let's say for example it looks like this:What I'm looking to do is iterate through this list, changing the USD to GBP to result in a new list that would display:
I recently had a technical interview and got small coding task on Stream API. Let's consider next input:
I need a piece of code that is capable of taking an array of strings of length l, extracting all of the elements that are present after i, where i is a particular index less than l and then placing the extracted elements into a new array.
Would a large amount of stack space required by a function prevent it from being inlined? Such as if I had a 10k automatic buffer on the stack, would that make the function less likely to be inlined?
I'd like to choose the best algorithm for future. I found some solutions, but I didn't understand which R-Squared value is correct.
I have a C++ macro-based DSL that defines a macro like this:This is for use like:Which expands to:(When C++20 concepts are enabled, this expands to a real requires clause.)