100 likes | 290 Views
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)
E N D
VG101RECITATION 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) • Important folders: Announcements, Resources, Assignments • Check SAKAI at least once a day
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);
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.
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
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
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 }
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
Thanks! Q&A