1 / 13

CSE 1020 - Lab 4

CSE 1020 - Lab 4. TA: Song Huang. Download Microsoft Visual Studio 2010. Create an account on the UNT Microsoft Software download website: https://e5.onthehub.com/WebStore/Security/Signin.aspx?ws=adbe7b34-809b-e011-969d-0030487d8897&vsro=8&action=signout&JSEnabled=1.

shiela
Download Presentation

CSE 1020 - Lab 4

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. CSE 1020 - Lab 4 TA: Song Huang

  2. Download Microsoft Visual Studio 2010 • Create an account on the UNT Microsoft Software download website: • https://e5.onthehub.com/WebStore/Security/Signin.aspx?ws=adbe7b34-809b-e011-969d-0030487d8897&vsro=8&action=signout&JSEnabled=1

  3. Create a Project With Visual Studio 2010 • Start Menu -> All Program -> Microsoft Visual Studio 2010 • Select “Microsoft Visual Studio 2010” (-> Visual C++ in the dialog if this is your first time) • File -> New -> Projects • Select “Visual C++” on the left area of the dialog, Select “Empty Project” in the middle, and give the name of the project at the bottom.

  4. Create a Source File for that Project • Find out the “Solution Explorer”: top menu “View” -> “Solution Explorer” • Right Click the folder “Source File”, “Add” -> “New Item”, select “C++ File (.cpp)” , give it a name at the bottom of the dialog, and then click add.

  5. When is the Source File that you create • C:\Users\YourAccount\Documents\Visual Studio 2010\Projects

  6. When You are using Visual Studio • using namespace std; (after #include <iostream>) • system(“pause”); (delete this statement when you copy your program into your web compiler) • use “#include <string>” when you have string type variable in your program.

  7. Important Components in the Programs • Programs are consisted of: • Selection Branches (select the procedures) • Loops (repeat operations)

  8. Selection Branches • if(conditions) { operation 1; operation 2; ……… }

  9. Selection Branches Importance: • There is no “;”, after the conditions, usually, we use “;” to close a statement if you finish the operation. • Use logical operator to connect multiple conditions, for example: “&&”, “||”… • Use bracket { } to include the operations

  10. Selection Branches • if(conditions){ operations; } else if(conditions){ operations; } else{ }

  11. Selection Branches • if(conditions){ operations; } if(conditions){ operations; } if(conditions){ operations; }

  12. Selection Branches - Example • int a = 9; • if(a > 7){ cout << a << endl; } else if(a > 6){ cout << a << endl; } else if(a > 5){ cout << a << endl; }

  13. Selection Branches - Example • int a = 9; • if(a > 7){ cout << a << endl; } if(a > 6){ cout << a << endl; } if(a > 5){ cout << a << endl; }

More Related