So i've created the if statements that give a total to each individual month. Now how can I reach into the previous months if branch to pull out the total to sum?
int total = 0;
...
Type: Posts; User: WashingtonBrewologist
So i've created the if statements that give a total to each individual month. Now how can I reach into the previous months if branch to pull out the total to sum?
int total = 0;
...
Yes! I believe that would be ok.
do you mean something like this:
if (month == 3)
total = 90; // 31+28+31
if (month == 4)
total = 120 // 31 + 28 + 31 + 30
I'm not allowed to use arrays yet. We are only allowed to use material from the first 5 chapters of our book which limits the possible solutions for this problem. Any other Ideas?
By the way thank...
I'm having trouble trying to figure out how to properly loop through the months and while doing so, also summing their days. Do you know how I could accomplish this? I know something is off in the...
When you say "add it to Monday" do you mean: take the result of modding days of Jan by 7, and add this to 1?
If the month is 1
startday is one
if not
mod days of previous month by seven
add...
I'm not quite understanding what your asking. This calendar should only be displaying the correct days for the 2018 calendar year.
My first solution which I will post again below was not what my...
The user will enter a date with the following format (dd/mm) and it will display the calendar. Here is an example of what the console looks like when I run the program:
Please enter a command: ...
I have no idea where to begin with this algorithm. Do you have any sugestions?
I'm creating a Calendar for my CS class and need to be able to get my calendar months to start on the correct day of the week. My first go at trying to solve this problem looked something like this:...