ENEE 140 Lecture Notes - Lecture 1: Leap Year

69 views5 pages

Document Summary

Example from class- say you want to program to print out a calendar for a given month/year (say november 2018) First thing you will print: days of the week. Print su mo tu . (so on) . Find the day the month starts and fill in the date from there. Take a variable start and figure out on which weekday the month starts. Think of these as functions with an input and output value. Figure out how many days are in each month. Start--where the week starts and how many days you keep going. Lets say i wanted to do september. Next step is to divide by 7 and take the remainder. Think of the total number of days, divide by 7, you will get weeks. So for september, today is 2, there are 4 days until the start of september, so: 2+4=6. Then we are going to return our remainder.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents