上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_Recitation 1

VG101 RECITATION 1 By TAs
VG101 RECITATION 1 By TAs

CONTENTS o Intro to SAKAI o Intro to APG o Intro to Online Quiz System o Installation of VS2005 and possible resources o Some common mistakes oQ&A
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 SAKAL o http:l/202.120.46.185:8080 portal user name (EID)and password (by default,it is your student ID) o Important folders:Announcements,Resources, Assignments o Check SAKAI at least once a day
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 o http:/202.120.46.189:8080/apgl user name (EID)and password (by default,it is 1234567,so change you password ASAP) o Using Tags write console.printLine(",answer,""); instead of console.printLine(answer);
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(“” , answer, “”); instead of console.printLine(answer);

INTRO TO APG 1.Use EID and password to Username:xiaobo Passw0rd:e00●e● login Do not have an account? Login Copyright (c)2008 APG Development Team.All rights reserved. Problems Status Account Logout Help 2.Select an assignment. Course No Title Start End Score 3.Click its title to go to Test 1 Hello World 2028-08-142008-09-14 22:37:41.022:37:41.0 100.0/100PA85 assignment description. Test 2 A+B Problem 2008-08-142008-09-14 2240:12.02240:12.0 100.0/100Pa83 Test 3 Sorting Numbers 2008-08-142008-09-14 23:47:47.02347:47.0 100.0/100PA85 4.Paste code there and submit
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 New Project Project types: Templates: 曰-Visual C# Yisual Studio installed templates Windows Smart Device CS106B/X C++Assignment Wizard Custom Wizard Database Windows Ferms Applicatien CLR Console App Starter Kits Win32 Console Application ATL Project 白-Other Languages MFC Application Makefile Project 中-Visual Basic ASP.NET Web Service ATL Server Projec ⊕isual1求 ATL Server Web Service ▣ATL Smart Device 中-Visual C++ 的Class Library CLR Empty Projec 中-Other Project Types Empty Project MFC ActiveX Cont 2005 Microsoft Corporation. 2005 Microsoft Corporation All rights reserved. All rights reserved
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 How many bugs can you find? 1~10 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));
SOME COMMON MISTAKES include Vg101class.h include 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

Missing Missing # 699 MISTAKES #include "Vg101class.h" #include 9bugs1! Missing vo] declaration Missing; /n should be\n ouble x,y,Z; eT console; =should be + sole.readDouble("Plase enter a number:") dsole.readDouble("\nPlease enter a second number: Z=x*x; x^2 should be xx z+=y *y; console.printLine("\nThe answer is "sqrt(z)); return 0; Missing should /n should return 0; be be\n
SOME COMMON MISTAKES #include "Vg101class.h" #include 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 # Missing ; Missing declaration Missing “” /n should be \n /n should be \n x^2 should be x * x =+ should be += Missing return 0; { should be } 9 bugs !!

SOME COMMON MISTAKES 05%2=?5/2=? 0-5%2=?-5/2=? 0-5%-2=?-5/-2=? int main (void) CA Press [Enter]tott ConsoleT c; -5%-2=-1 c.printLine-5%-2=",-5%-2,"n-5/-2=",-5/-2): -5/-2=2 return 0; o Write your own program to find them o Remember:(x/y)*y+(x%y)=x o The answers are:1,2,-1,-2,-1,2
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
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_vector_string.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Start with C plusplus.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Random Number_Graphics.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_programming style guide for C plusplus.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_objects and classes.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Introduction to Vg101.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Introduction to Computer and Programming.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Function.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_files_DataBase Design.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Expressions and Statements.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_examples on class design.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Array and its Applications.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_20 Looking Ahead.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_19 Recursion 1.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_16 MATLAB environment short.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_15 Introduction to matlab.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》教学资源_Chapter 1 Introduction.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》教学资源_第二章习题与答案(第三版).doc
- 上海交通大学:《数据库系统原理 The principle of Database System》教学资源_第三章习题与答案(第三版).doc
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)chapter8 Views, Indexes.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_recitation 13.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_Recitation IX.ppt
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_Recitation V.ppt
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_Recitation VII.ppt
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_Recitation VIII.ppt
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Recitation Notes_Recitation X.ppt
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第十四章 MCS-51单片机(1/2).pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第十四章 MCS-51单片机(2/2).pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第一章 微机原理与接口技术绪论(朱兰娟).pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第二章 8086系统结构.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)chapter9 SQL in a server environment.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)05年期末习题_Pointer Review Solution.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)05年期末习题_Pointer Review.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)05年期末习题_Practice Final 1.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)05年期末习题_practice Final 2.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)05年期末习题_practice Final 3.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)05年期末习题_Solution for Practice Final 1.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)05年期末习题_Solution for Practice Final 2.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)C++语言_I.运算符重载.pdf
- 上海交通大学:《程序设计基础》课程教学资源(习题集)C++语言_II.继承与派生.pdf