1 / 10

VG101 RECITATION 1

VG101 RECITATION 1. By TAs. CONTENTS. Intro to SAKAI Intro to APG Intro to Online Quiz System Installation of VS2005 and possible resources Some common mistakes Q&A. INTRO TO SAKAI. http://202.120.46.185:8080/portal user name (EID) and password (by default, it is your student ID)

ofira
Download Presentation

VG101 RECITATION 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. VG101RECITATION 1 By TAs

  2. CONTENTS • Intro to SAKAI • Intro to APG • Intro to Online Quiz System • Installation of VS2005 and possible resources • Some common mistakes • Q&A

  3. INTRO TO SAKAI • http://202.120.46.185:8080/portal • user name (EID) and password (by default, it is your student ID) • Important folders: Announcements, Resources, Assignments • Check SAKAI at least once a day

  4. INTRO TO APG • http://202.120.46.189:8080/apg/ • user name (EID) and password (by default, it is 1234567, so change you password ASAP) • Using Tags write console.printLine(“<int>”, answer, “</int>”); instead of console.printLine(answer);

  5. INTRO TO APG 1. Use EID and password to login 2. Select an assignment. 3. Click its title to go to assignment description. 4. Paste code there and submit.

  6. INSTALLATION OF VS2005 • Make sure that you have a right version click Help -> about Microsoft Visual Studio • Use the CS106B/X template to create a new project click File -> New -> Project • For detailed steps, look up your lab meterials

  7. SOME COMMON MISTAKES include Vg101class.h include <cmath> int main (void) { double x, y, z x = console.readDouble("Please enter a number: "); y = console.readDouble(“/nPlease enter a second number: "); z = x^2; z =+ y * y; console.printLine(“/nThe answer is ", sqrt(z)); { How many bugs can you find? 1~10

  8. SOME COMMON MISTAKES Missing # Missing “” 9 bugs !! #include "Vg101class.h" #include <cmath> int main (void) { double x, y, z; ConsoleT console; x = console.readDouble("Please enter a number: "); y = console.readDouble("\nPlease enter a second number: "); z = x * x; z += y * y; console.printLine("\nThe answer is ", sqrt(z)); return 0; } Missing declaration Missing ; /n should be \n =+ should be += x^2 should be x * x Missing return 0; /n should be \n { should be }

  9. SOME COMMON MISTAKES • 5 % 2 = ? 5 / 2 = ? • -5 % 2 = ? -5 / 2 =? • -5 % -2 = ? -5 / -2 = ? • Write your own program to find them • Remember: (x/y) * y + (x%y) = x • The answers are: 1, 2, -1, -2, -1, 2

  10. Thanks! Q&A

More Related