CSE100 Principles of Programming with C++
Disclaimer: this web page is the official syllabus for the course; paper copies will not be distributed. During the semester, changes may be made to the syllabus. If the change is significant, notification will be given in class, and an announcement will be made in Blackboard. Minor editing changes will not be announced. The student is responsible for reading this syllabus at the beginning of the semester to acquaint himself or herself with the course policies, and for checking the syllabus periodically throughout the semester for relevant information.
Spring 2017 — Course Information
|Date & Time||MWF 10:45–11:35|
|TA's||Mohommad Farhadi, Xu Liu, Wen Zhang|
|UGTA's||Amberly Ricks, Devon Bautista, David Lattimer, Devin Walz|
|Geoffrey Wong, Jennifer Le, Nico Soto, Sebastian Fonseca|
|Sean McGinn, Sam Robison, Trevor Bautista|
|26499||Mon||12:55||COOR L1-54||Xu, Wen||Amberly, Devin, Sebastian|
|19391||Mon||3:05||COOR L1-34||Xu, Wen||Geoffrey, Sebastian, Sean, Trevor|
|19389||Tue||12:00||COOR L1-14||Xu||Devin, Geoffrey, Jennifer, Nico|
|19392||Wed||3:05||COOR L1-34||Mohammad, Wen||David, Sean, Samuel, Trevor|
|17872||Wed||4:10||COOR L1-14||Mohammad, Wen||Devon, Nico, Sean, Trevor|
|19390||Thu||12:00||COOR L1-14||Xu||Amberly, David, Geoffrey, Jennifer|
|21779||Fri||12:55||COOR L1-14||Mohammad, Wen||Devon, Jennifer, Nico, Samuel|
|19393||Fri||3:05||COOR L1-34||Mohammad||Amberly, David, Devin, Samuel|
Catalog Course Description
Lecture: Principles of problem solving using C++, algorithm design, structured programming, fundamental algorithms and techniques, and computer systems concepts. Social and ethical responsibility. Three (3) credit hours. Lecture, with required lab. Prerequisite: None.
Lab: This is a required fifty minute lab for students enrolled in the CSE100 Principles of Programming with C++ lecture. The purpose of the lab is for the student to practice writing computer programs using C++ with the TA present and available for help. It is taught in a computer lab, so each student will be able to work on his/her programs during the lab session.
Expanded Course Description
This class used to be the first required Computer Science & Engineering course for students pursuing the B.S. degree in Computer Systems Engineering (CSE). However, the School of CIDSE now recommends that both CS and CSE majors complete CSE110 Principles of Programming with Java. The primary population in CSE100 is now drawn from mathematics, physics, and various engineering disciplines, primarily EE and BME. I understand that most of you are taking this course to fulfill a major requirement, and I teach it at a level that is appropriate for non-CS majors. You should understand that even though you may never become a programmer, or may never write another program again in your life, the experts in your field believe it is important for a student in that field to know something about computer programming. For many of you, you may very well end up writing quite a bit of software during your career, and this course will be immensely important to your education.
This is not necessarily a course on the C++ language, but rather, it is a course on computer programming principles and concepts. In particular, we focus on imperative/procedural and object-oriented programming principles. There are many programming languages which could be used to teach these concepts, including Java, Python, C#, and Visual Basic. Any one of these languages would suffice, but C++ has been selected because of its popularity and widespread use in both academia and industry—especially in engineering and the sciences.
At all times in this course, you are encouraged to focus more on the programming concepts being taught, and less on the specific C++ syntax. For example, we will learn about selection statements (also called decision statements or if statements). In C++, selection statements are implemented using a statement which begins with the specific word "if" and so they are commonly called "if statements". However, every programming language has some form of a selection statement. It may not be written in the same way as it is in C++, but trust me, it's there. So when we learn about selection statements, do not get so caught up in the details of the C++ "if" statement that you forget to learn the more general concept of what a selection statement is, how it works, and when and where you would use one.
- Develop programs that use fundamental data types, strings, arrays, and objects.
- Use predefined library functions in programs.
- Write programs with multiple user-defined functions.
- Use flow of control structures.
- Use the pass-by-value and pass-by-reference parameter passing techniques.
- Understand variable scope and use scope appropriately in programs.
- Understand 1-D and 2-D arrays and use them appropriately in programs.
- Develop object-oriented C++ programs using classes, information hiding, and inheritance.
- Use the Unified Modeling Language (UML) to design and document classes.
- Understand basic searching and sorting algorithms.
The material to be covered in this course will be drawn from Chapters 1-9 of the textbook, although not necessarily in the order listed here. There may be content in some chapters that is not discussed and we we will also discuss some material that is not in the text.
Chapter 1: Introduction to Computers and Programming
- Introduction to computer hardware.
- Introduction to software.
- Programming and programming languages.
- Programming tools.
Chapter 2: Introduction to C++
- Parts of a C++ program.
- #include preprocessor directive.
- Assignment operator, assignment statement.
- Input/Output using cin and cout.
- Integer, floating point, character, and Boolean data types.
- The string class.
- Variable scope.
- Arithmetic operators.
- Programming style.
Chapter 3: Expressions and Interactivity
- Input using cin.
- Mathematical expressions, math library functions.
- Implicit and explicit type conversions.
- Named constants.
- Combined assignment operators.
- Formatting output.
- Input and output with characters and strings.
Chapter 4: Making Decisions
- Relational operators.
- Logical operators.
- If statement, if-else statement.
- Nested if statements, if-elseif-... statement.
- Testing and debugging.
Chapter 5: Looping
- While loop.
- Increment and decrement operators.
- Counter variables, counting loops.
- For loop.
- Vary loops.
- Sentinels and sentinel loops.
- Nested loops.
- Text file I/O, end-of-file loops.
Chapter 6: Functions
- Modular programming.
- Defining and calling functions.
- Function prototypes.
- Pass by-value parameters.
- Returning values from a function.
- References and pass by-reference parameter passing.
- Overloading functions.
- The exit() function.
- Stub functions.
Chapter 7: Introduction to Classes and Objects
- Object oriented programming.
- Data members and member functions.
- Passing objects as parameters by-value and by-reference.
- Returning objects from functions.
- Object composition.
Chapter 8: Arrays
- Array basics.
- Accessing array elements.
- Input and output with arrays.
- Array initializers.
- Processing arrays.
- Passing arrays as function parameters.
- Two dimensional arrays.
- Arrays of objects.
Chapter 9: Searching, Sorting, and Algorithm Analysis
- Linear search.
- Binary search.
- Selection sort.
- Bubble sort.
- Time complexity of searching and sorting algorithms.
- Searching and sorting arrays of objects.
Office Hours & Support
The instructor will be available during his office hours to answer any questions you may have about the course, the material, or the projects. I'm a friendly guy (except when I'm not), and willing to talk with you and help you as much as I can, so stop by if you want, but please be aware that I also teach other courses and have other duties as well, so I am quite busy. When you come in for help, please be prepared to ask pointed and specific questions about what you do not understand or are having difficulty with. It is next to impossible for me to help you if you come in and say, "I don't understand anything." Also, a final word of advice. I may not be available as much as you would like the day before or the day an assignment is due. I will give you plenty of time to complete the assignments as long as you start working on them well before the deadline. This will give you ample time to meet with me, a graduate TA, a UGTA, or a grader to discuss your questions as you are working on the assignment. Start early!
The labs are taught by graduate TA's who will also grade some of the lab projects and exams (the other labs and exams will be graded by our graders, discussed below). The graduate TA's are,
|TA's Name||Office Hours|
|Mohammad Farhadifirstname.lastname@example.org||Tu 4:00-6:00 , F 1:50-3:00 , F 5:10-6:00 |
|Xu Liuemail@example.com||MTh 9:00-11:00 |
|Wen Zhangfirstname.lastname@example.org||M 2:00-3:00 , WF 1:00-3:00 |
 CIDSE Tutoring Center CTRPT 114
 COOR Computing Lab (ground-level)
 COOR L1-54
We have several Fulton UGTA's assigned to assist the graduate TA's in teaching the labs. The UGTA's are: Amberly Ricks, Devon Bautista, David Lattimer, Devon Walz, Geoffrey Wong, Jennifer Le, Nico Soto, Sebastian Fonseca, Sean McGinn, Sam Robison, and Trevor Bautista. The UGTA's will be available to help you in your lab section. They do not hold office hours.
The School of Computing, Informatics, and Decision Systems Engineering (CIDSE) provides free tutoring in the CIDSE Tutoring Center, which is located in CTRPT 114, Mon through Fri 9:00am to 6:00pm.
The University Academic Success Programs offers small-group online tutoring.
There will be four graders for the course, who will grade the lab projects and exams. Each grader will hold one office hour per week so you may meet with him or her to ask questions about the grading of a lab project or exam.
|Grader's Name||Office Location||Office Hours|
|Trevor Bautistaemail@example.com||CTRPT 114||Th 12:00-1:00|
|Bineeta Guptafirstname.lastname@example.org||CTRPT 114||Tu 3:00-4:00|
|Shivani Ozaemail@example.com||CTRPT 114||W 2:30-3:30|
|Ayush Ruchandanifirstname.lastname@example.org||CTRPT 114||W 3:00-4:00|
Course Materials & Resources
The website you are currently viewing is the main website for this course (I will refer to it as the course website), and most course information will be available here (e.g., lecture notes, lab project documents, exam study guides, etc). I use Blackboard for: (1) posting important announcements; (2) student submission of lab project files; (3) posting exam solution and grading rubrics; and (4) posting scores in the Blackboard Grade Center.
Various methods will be used to present the material and assess the student's understanding and comprehension.
Specific reading assignments will not be given but it is expected that the student will read the relevant sections in the textbook as we discuss the material in the lectures.
Pearson MPL Exercises
Pearson MPL exercises for each chapter of the text will be assigned with deadlines for completion. MPL exercises will be available for 48 hours after the deadline, during which time you may still submit answers for a 20% penalty. During the course there will be a maximum of m MPL exercise points to be earned. At the end of the term, an MPL percentage, denoted mpl in the course percentage formula below, will be calculated as a percentage of the exercise points that were answered correctly divided by 0.90m, not to exceed 100%, i.e., I will drop 10% of the MPL exercise points and your MPL percentage cannot exceed 100%.
Pearson MPL and Your ASURITE Username
Very Important Note: Your ASURITE ID is the username you use to login to ASU systems such as MyASU and Blackboard. It is an 8-character-maximum combination of letters and digits; note that your ASURITE ID is not the same as your 10-digit ASU ID number. When you register for your MPL account, you must configure your email address to be in the format email@example.com where asuriteid is your 8-character ASURITE ID. This is necessary so the instructor can successfully export your scores from Pearson MPL and import them into Blackboard. Failure to do so will result in no points being awarded for the MPL exercises. See the Course Materials & Resources section above for the link to the Pearson Account Configuration webpage.
Note: In cases of academic integrity violations—when a student is assigned a score of 0 on an MPL assignment—the MPL course percentage will be calculated as the sum of all earned MPL exercise scores divided by m, i.e., no exercises are dropped.
During each required lab session (13 lab projects will be assigned), you are required to complete a programming project which will be submitted to Blackboard for grading. Each project is worth five (5) points, but your lowest lab project score will be dropped, so there will be a maximum of 60 project points to be earned. Before each lab session, there may be assigned prelab exercises which you must complete before the lab session. Failure to complete the prelab exercises may make it difficult for you to fully participate in the lab and complete the in-lab programming project. In general, lab projects will be due at 4:00am on Saturday mornings, approximately one week after the Friday lab sessions. Specific dates are found in the monthly calendars in the Schedule section. Lab projects are are accepted for grading on a variable deadline (except for the final lab project which will be due the day of the final exam).
|> 48 hrs before the deadline||Bonus of 20% of earned pts.|
|> 24 hrs and ≤ 48 hrs before the deadline||Bonus of 10% of earned pts.|
|≤ 24 hrs before the deadline||Accepted for grading with no bonus/no penalty.|
|< 24 hrs after the deadline||Penalty of 10% of assignment pts.|
|≥ 24 hrs and < 48 hrs after the deadline||Penalty of 20% of assignment pts.|
|≥ 48 hrs after the deadline||Not accepted for grading. Score will be 0 pts.|
Projects that are submitted more than 24 hours early will be awarded bonus points. For example, if the project is worth 5 points and you earn 3.5 points by submitting the project 50 hours before the deadline, then you will be awarded 3.5 × 20% = 0.7 bonus points, for a total project score of 4.2 points. Projects that are submitted less than 48 hrs after the deadline will be penalized points. For example, if the project is worth 5 points, and you earn 3.5 points by submitting your project one minute after the deadline, then you will be penalized 5 × 10% = 0.5 points, for a total project score of 3 points. The penalty for 24 to 48 hours after the deadline is 20% of the project points. In no case will a project be graded when submitted 48 hours or more after the deadline. Project solutions must be uploaded to Blackboard for grading; in no case will an emailed project be accepted for grading.
At the end of the term, a lab percentage, denoted lab in the course percentage formula below, will be calculated as the sum of the points you earned on the 12 highest-scoring lab projects divided by 60. Your lab percentage, including bonus points, will be limited to a maximum of 100%.
Note: In cases of academic integrity violations—when a student is assigned a score of 0 on a lab project—no lab project scores will be dropped, and the lab project percentage will be calculated as the sum of all earned lab project scores divided by 65.
There will be two in-class midterm examinations; the exam dates are listed on the monthly calendars in the Schedule section. There will be a noncomprehensive final exam given during the final exam period, see the May calendar. Each exam is worth 100 points and your lowest exam score, including the final, will be dropped when computing your final course percentage using the first formula, CP1. If you wish to base your grade solely on the exams, when calculating CP2 no exam scores are dropped.
Only in exceptional, documented cases (exceptional is defined by the instructor and will generally involve something like a note from the neurosurgeon who performed your emergency hemispherectomy on the day of the exam) will an exam be given after the exam date. If you know you are going to be absent on the date of an exam for a good reason (generally only business travel for your job or travel for an approved ASU function, documentation required) then you may be permitted to take the exam early. If a serious-enough situation warrants a midterm makeup exam, the exam will be administered during finals week.
Note: You will be required to show proper photo identification (an ASU Suncard, driver's license, military ID card, or passport) when handing in your examination for grading. If the instructor or teaching assistant does not recognize you, and you cannot produce photo identification, your exam will not be accepted for grading.
Calculating Final Letter Grades
Your final letter grade will be based on your final course percentage FCP which is calculated as a weighted sum of your scores on the MPL exercises, lab projects, and examinations. Two course percentages will be be calculated using these formulas:
CP1 = (mpl × 5%) + (lab × 40%) + (e1 × 27.5%) + (e2 × 27.5%)
CP2 = (mid1 × 33.33%) + (mid2 × 33.33%) + (final × 33.33%)
Where mpl is your Pearson MPL percentage as described in the Pearson MPL Exercises section above and lab is your lab project percentage calculated as described in the Lab Projects section above. In CP1e1 is your highest exam score (midterm or final) and e2 is your second highest exam score (midterm or final). In CP2 both midterm exam scores and your final exam score are used. The final course percentage will be calculated as:
FCP = ceiling(max(CP1, CP2))
Note that the ceiling of x is the smallest integer that is greater than or equal to x. For example, the ceiling of 79.2 is 80, the ceiling of 80 is 80, and the ceiling of 79.99999 is 80; essentially, the ceiling function always rounds up when the number is not a whole number. Letter grades are assigned per this table:
|FCP ∈ [98, 100]||A+|
|FCP ∈ [85, 98)||A|
|FCP ∈ [70, 85)||B|
|FCP ∈ [55, 70)||C|
|FCP ∈ [40, 55)||D|
|FCP < 40||E|
If you believe a graded assessment (MPL chapter exercises, lab project, or exam) was incorrectly graded, the first step is to meet with the TA or grader who graded the assessment in question and discuss your concerns with him or her. Exams and the bulk of the lab projects are graded by the graders, but the TA's will also grade a few of the lab projects. See the list of lab sections at the top of the syllabus for the table which lists the grader for each lab section. For the exams, the grader will write his/her initials on the answer sheet. If the TA or grader made an honest mistake, then he/she will correct it and enter the updated score in Blackboard. On the other hand, if the TA or grader correctly marked, or believe they correctly marked, the assessment using the instructor-provided grading rubric, and after conferring with the grader you disagree, then you may file a grade appeal with the instructor using this form. Please read the form instructions carefully. Basically, you have one week from the date the MPL chapter exercises, lab project, or exam was graded to file your grade appeal. No appeals will be accepted after the one week period for any reason. The grade appeal form must be submitted in print; emailed forms will be ignored. Note that grade appeals are considered by the instructor at the end of the semester before calculating your final course percentage and letter grade. The reason is that in most cases, whether the appeal is successful or not, it will not affect a student's course percentage enough to change the student's letter grade. At that time, I will regrade your assessment only if giving you the points in question would change your final course percentage enough to increase your final letter grade. If your score was changed, the new score will be entered in the Blackboard Grade Center.
In general, the instructor believes learning is a collaborative activity, that students learn best when they work together, and that students should be encouraged to learn from and teach each other. These activities would include discussing solutions to MPL exercises, working together on lab projects, and jointly studying for exams. In completing the lab projects, student-pair collaboration is encouraged and will be permitted as long as each member of the pair contributes equally to the work. Collaboration is only acceptable between members of the same pair-team; inter-team collaboration is forbidden and violators may be sanctioned. Collaboration on examinations is not permitted; each exam must be completed by the individual student. Failure to abide by these rules will result in a score of zero being assigned to one or both members of the team (i.e., if I have a reasonable hunch that one student did all of the work on an assignment and the other student simply put his/her name on it, then the student who did all of the work will receive the assignment score and the other student will be given a score of zero).
Note: See the Assessment section concerning how academic integrity violations are handled for MPL exercises, lab projects, and exams.
You are strongly encouraged to acquaint yourself with the ASU Academic Integrity Policy
The ASU Student Services Manual (SSM 201-10) permits the instructor to withdraw a student from a course for disruptive behavior with a mark of W (withdrawal) or E (failure). Note that "disruptive behavior" is defined by the instructor, not by the University or the student. Violation of conventional and acceptable classroom behavior will result in the offender being asked to exit the classroom and notification of the offense to the Fulton Schools of Engineering's Dean's Office. A warning may or may not be provided.
Note that in general, you may sit where you wish. However, the instructor has the right to ask you to sit in a specific seat or move to a different seat at any time during the semester. In the past, I have moved students whom I suspected were cheating during an exam, and I will do so in this course if I believe you are looking at another student's paper or sharing answers during an exam.
There is a strong and well-established correlation between class attendance, learning, and performance; therefore, regular class/lab attendance and participation is expected. I (or in the labs, the TA) intend to begin class each day on time, and we expect you to be present and ready at that time. However, you are adults, and you (or someone who may or may not love you) are paying for your education, and ultimately, it is your education. If you want to squander this opportunity, then no gimmick we devise to try to get you to come to class and participate will be successful, so lecture attendance will not count toward your final course grade.
Requirements for Success in this Course
The instructor assumes that you are mature and responsible adults, that you are enrolled in this course because you wish to learn the material, that you will read any assigned readings before class begins, that you will come to class prepared to discuss the reading and ask questions, that you will complete the assignments to the best of your ability on time, that you will actively participate in class discussions, and that you will ask questions about material you find confusing. The instructor believes that college students must be actively involved in their own learning process, that they cannot just sit and listen to lectures and expect to learn the material, that one of the purposes of college education and the Arizona State University mission is for the student to self-develop skills such as problem solving, independent learning, critical thinking, and effective written and spoken communication. To succeed in this course you must:
- Be prepared for every class, attend every class, and pay attention.
- Read the textbook and any assigned readings prior to class.
- Begin and complete the MPL exercises well before the due date.
- Prepare thoroughly for and complete every exam.
- Do any additional exercises you must to understand the material.
- Work with a partner if you wish or if it helps you.
- Ask questions in class. If you do not feel comfortable asking the question in class, talk with me outside of class.
- If you do not complete an assignment by the deadline, complete it anyway later.
- If you miss points on an assignment or exam determine why your answer was graded incorrect and learn the correct answers.
- Seek help from the instructor, TA, grader, or the tutoring center before you are too far behind on your understanding of the subject.
- Read your email every day; I often send important announcements via email.
- Check the course website and Blackboard every day for new announcements, material, and updates.
The purpose of the lab is to permit you to practice writing C++ programs with a TA and UGTA's present to assist you. Learning to write computer programs is very difficult. Of course, like many endeavors, some students find it much easier than others. However, even students who find it extremely difficult and challenging can do some things to enhance their learning and perhaps earn a higher grade, including:
- Complete any assigned prelab exercises before the lab session.
- Be prepared for and attend every lab session.
- Work diligently in the lab session and do not screw around.
- Ask the TA and UGTA's for help when you are stuck or confused.
- Work with a partner if you wish or if it helps you.
- Even if you do not complete a lab project, or you earn a low score on one, complete it later.
Having said all that, I want you to know that I care about all of my students and their education. I want all of you to succeed, to feel you have gained something from the course, to have some fun in the process, and I will do all I reasonably can to assist you in your efforts!
Statement on Accommodations
The Disability Resource Center (480-965-1234; Matthews Center; email: firstname.lastname@example.org) is the central location for students requiring accommodation. Any student requiring accommodation must contact and register with the Center before any accommodation requests can be granted by the instructor. If you require accommodation, please contact the Center as soon as possible so the instructor can work with you to ensure your success.
Title IX is a federal law that provides that no person be excluded on the basis of sex from participation in, be denied benefits of, or be subjected to discrimination under any education program or activity. Both Title IX and university policy make clear that sexual violence and harassment based on sex is prohibited. An individual who believes they have been subjected to sexual violence or harassed on the basis of sex can seek support, including counseling and academic support, from the university. If you or someone you know has been harassed on the basis of sex or sexually assaulted, you can find information and resources at http://sexualviolenceprevention.asu.edu.
Links and Documents
Spring 2017 Academic Calendar
Spring 2017 Final Exam Schedule
My ASU Courses (Blackboard)
Bjarne Stroustrup's C++ Site - Stroustrup is the creator of C++.
C++ Annotations - Version 10.6.0, By Frank B. Brokken.
C++ FAQ - Very good reference on many intricate details of C++.
CodeStepByStep - Online C++ Programming Exercises
Hacker Rank - Online C++ Programming Exercises
Object-Programming Oriented in C++ Tutorial - by Peter Müller
www.cplusplus.com - Very good C++ reference site.
www.cprogramming.com - Another good C++ reference site.
COOR 170 Seating Layout
Midterm Exam 1 Study Guide :: Statistics
Midterm Exam 2 Study Guide :: Statistics
Midterm Exam 3 Study Guide :: Seating Assignments
Lab Project 1 :: Code::Blocks Tutorial
Lab Project 2
Lab Project 3
Lab Project 4 :: Lab04.cpp
Lab Project 5 :: Lab05.cpp :: stats-season.txt
Lab Project 6 :: Lab06.cpp
Lab Project 7 :: Lab07.cpp
Lab Project 8 :: Lab08.zip
Lab Project 9 :: Lab09.cpp
Lab Project 10 :: Lab10.zip
Lab Project 11 :: Lab11.zip
Lab Project 12 :: Lab12.zip
Lab Project 13 :: Lab13.cpp
Suggestions for Honor's Projects
Lecture 1 - Mon 9 Jan
Lecture 2 - Wed 11 Jan
Lecture 3 - Fri 13 Jan
Lecture 4 - Wed 18 Jan
Lecture 5 - Fri 20 Jan
Lecture 6 - Mon 23 Jan
Lecture 7 - Wed 25 Jan
Lecture 8 - Fri 27 Jan
Lecture 9 - Mon 30 Jan
Lecture 10 - Wed 1 Feb
Lecture 11 - Fri 3 Feb
Lecture 12 - Mon 6 Feb
Lecture 13 - Wed 8 Feb
Lecture 14 - Fri 10 Feb
Lecture 15 - Mon 13 Feb
Lecture 16 - Wed 15 Feb
Lecture 17 - Fri 17 Feb
Lecture 18 - Mon 20 Feb
Lecture 19 - Wed 22 Feb
Lecture 20 - Fri 24 Feb
Lecture 21 - Mon 27 Feb
Lecture 22 - Wed 1 Mar
Lecture 23 - Fri 3 Mar
Lecture 24 - Mon 13 Mar
Lecture 25 - Wed 15 Mar
Lecture 26 - Fri 17 Mar
Lecture 27 - Mon 20 Mar
Lecture 28 - Wed 22 Mar
Lecture 29 - Fri 24 Mar
Lecture 30 - Mon 27 Mar
Lecture 31 - Wed 29 Mar
Lecture 32 - Fri 31 Mar
Lecture 33 - Mon 3 Apr
Lecture 34 - Wed 5 Apr
Lecture 35 - Fri 7 Apr
Lecture 36 - Mon 10 Apr
Lecture 37 - Wed 12 Apr
Lecture 38 - Fri 14 Apr
Lecture 39 - Mon 17 Apr
Lecture 40 - Wed 19 Apr
Lecture 41 - Fri 21 Apr
Lecture 42 - Mon 24 Apr
Lecture 43 - Wed 26 Apr
Lecture 44 - Fri 28 Apr
Source Code and Design Files
BubbleSort.cpp - Illustrates the bubble sort algorithm (Ch. 9).
Copy.cpp - Illustrates EOF loops and reading whitespace from a stream (Ch. 5).
Counter.zip - Classes, objects, pass by-reference (Chs. 6, 7).
Cout.cpp - Using cout, endl, and '\n' (Ch. 2).
DayOfWeek.cpp - If, if-else, if-elseif-... statements (Ch. 4).
Distance.cpp - Variables, arithmetic operators, math library functions, stream manipulators, functions (Chs. 2, 3, 6).
Even.cpp - Relational operators, if statement (Ch. 4).
EvenOdd.cpp - Relational operators, if-else statement (Ch. 4).
ExamStats.cpp - Illustrates one-dimensional arrays and sorting. (Chs. 8, 9)
Fraction.zip - Illustrates classes, objects, if statements, loops.
FtoC.cpp - Variables, arithmetic operators, functions (Chs. 2, 3, 6).
Get.cpp - get_char(), get_double(), get_int(), get_string() functions (Chs. 2, 3, 6).
Hello.cpp - This is Hello.cpp for Lab Project 1.
Hello.hpp - This is Hello.hpp for Lab Project 1.
HelloWorld.cpp - The canonical Hello World program (Ch. 2).
Math.cpp - Math library functions, named constants, arithmetic operators, implicit and explicit conversions (Ch. 3).
Matrix.zip - Mathematical Matrix class. Illustrates 2D arrays (Ch. 8)
pc03-20.cpp - Illustrates writing and using functions (Ch. 6)
pc04-03.cpp - Arithmetic operators, relational operators, if-else statements (Ch. 4).
pc04-07.cpp - Relational operators, if-elseif-... statements (Ch. 4).
pc04-11.cpp - Relational operators, logical operators, if-elseif-... statements (Ch. 4).
Point.hpp - Point Class Declaration (Ch. 7).
Point.cpp - Point Class Implementation (Ch. 7).
Primes.cpp - Prints all prime numbers between 2 and n, inclusive, using nested loops (Ch. 5).
PrintMult.cpp - Prints a 15 x 15 multiplication table using nested loops (Ch. 5).
Reverse.cpp - Read a list of numbers from a file, write them in reverse order (Ch. 8).
Search.cpp - Illustrates the linear and binary search algorithms. (Ch. 9).
String.cpp - Defining char and string variables, char and string operations (Ch. 3).
Stars.cpp - Prints patterns of stars. Illustrates nested loops (Ch. 5).
Kevin R. Burger
School of Computing, Informatics, and Decision Systems Engineering
Ira A. Fulton Schools of Engineering
Arizona State University, Tempe, Arizona, USA, 85287-8809
Email: burgerk[@-sign]asu[.dot]edu, Phone: +1 480.965.1493, Fax: +1 480.965.2751
Last Updated: Mon 9 Jan 2017 0000
CSE100 Homework Assignment 2 (20 points) Arizona State University Important: This is an individual assignment. Please do not collaborate. Introduction: This assignment helps you to reinforce the topics discussed in the class including Selection statements and repetition statements. Task: Shipping Charges Program 1.The Fast Freight Shipping charges following rates; Weight of Packages (Pounds) Rate per 500 miles Shipped Weight <= 2 $1.10 2 < Weight <= 6 $2.20 6 < Weight <= 10 $3.70 10 < Weight <= 20 $4.80 Write a C++ program that asks for the weight of the package and the distance to be shipped. Then, compute the total charge. Charge is computed in 500 mile increments. For example, if the weight of the package is 3 pounds and distance to travel is 680 miles, then the charge will be $2.20 * 2 = $4.40. You might need to use the ceil() method defined the cmathlibrary for this computation. Definition of ceil() method can be found at http://www.cplusplus.com/reference/cmath/ceil/