1 / 18

All 300/400 Level CS Major Courses

All 300/400 Level CS Major Courses. Tutoring http://cs.ua.edu/undergraduate/tutoring/ Location : SEC 3433 Sign up or walk-in. Language and IDE. C++/CLI language and .NET framework Examples in Microsoft Visual Studio 2012. Compiled Languages. Compiler (Including Linker). hello.cpp

koko
Download Presentation

All 300/400 Level CS Major Courses

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. All 300/400 Level CS Major Courses • Tutoring http://cs.ua.edu/undergraduate/tutoring/ • Location: SEC 3433 • Sign up or walk-in Introduction

  2. Language and IDE • C++/CLI language and .NET framework • Examples in Microsoft Visual Studio 2012

  3. Compiled Languages Compiler (Including Linker) hello.cpp (high level) hello.exe (machine) Executor Result hello.exe

  4. Interpreted Languages Interpreter hello.bas Result

  5. Hybrid Compiler-Interpreter Compiler Source code Intermediate language code Interpreter Result

  6. C++/CLI C++/CLI compiler C++/CLI Source Code CIL Bytecode CIL = C++ Intermediate Language CLR Result CLR = Common Language Runtime This applies to C# and VB .NET too.

  7. About C++\CLI • C++ (.h, .cpp, complied) • C++/CLI (compiled to MSIL (Microsoft Intermediate Language), not machine code)(not interpreted at runtime) • C++ vs. C++/CLI • Unmanaged code vs. managed code • Managed code: memory management, code access security, multi-language integration • Garbage collection

  8. .NET • Application development technologies • .NET base class library • Common Language Runtime (above OS)

  9. .NET Advantages • Language natural … MSIL • Many non-MS languages can use base class library • Common Type System (CTS) • Common Language Specification (CLS) • Minimum subset of CTS for all the .NET compatible languages • Platform independent … CLR • Port .NET Framework to non-Windows platform w/o recompiling • JIT: Just-In-Time Compilation • A JIT compiler translates bytecode into the native machine language.

  10. IDE (Integrated development environment) • Microsoft Visual Studio for C++

  11. Obtain Microsoft Visual Studio 2012(either Professional, or Ultimate) Visual Studio 2012 only: • any student at UA at no cost. • http://oit.ua.edu/oit/services/software-licensing/dreamspark-standard/ and scroll to the very end (click on the “WebStore” link in “Obtaining Software”

  12. Obtain Windows, Microsoft Visual Studio 2012(either Professional, or Ultimate) OIT resources for licensed copies • access software through DreamSpark • STEM departments: DreamSpark Premium • http://oit.ua.edu/oit/services/software-licensing/dreamspark-standard/ • https://www.dreamspark.com/Institution/Subscription.aspx • No cost to eligible students • Get help: • OIT service desk • CS : Jeremy LaGrone, jlagrone at cs ua edu

  13. Examples • How to use Microsoft Visual Studio 2012 • Assignment: within next two weeks • Download and install Microsoft Visual Studio 2012. • If needed, Windows as well. • Use Visual Studio to create a project of CLR Console Application after this class • Can use your current or later assignments

  14. Create a CLR Console Application • Start Microsoft Visual Studio 2012 • Create a new project by selecting from the menu bar "FILE"-> "New"->"Project". In the "New Project" dialog box, select "Visual C++" under "Installed Templates" and select "CLR Console Application" as the project template. Enter C:\CS351\Projects (or any directory designated for keeping your CS351 projects) in the "Location" field, and First (or any project name) in the "Name" filed. It is better to uncheck "Create directory for solution". • Add code to the project. • Build. • Execute.

  15. backups

  16. Examples • Quadratic Equation: ax2+bx+c=0 • Discriminant: ∆=b2-4ac • Two roots: x1= x2=

  17. // Quadratic.cpp : main project file.  • #include "stdafx.h" • using namespace System; • int main(array<System::String ^> ^args) • { • double a, b, c; • Console::Write(L"Enter the quadratic coefficiet(a): "); • a = Double::Parse(Console::ReadLine()); • Console::Write(L"Enter the linear coefficnet(b): "); • b = Double::Parse(Console::ReadLine()); • Console::Write(L"Enter the constant term(c): "); • c = Double::Parse(Console::ReadLine()); • double discriminant; • discriminant = b*b-4*a*c; • double x1 = (-b+Math::Sqrt(discriminant))/(2*a); • double x2 = (-b-Math::Sqrt(discriminant))/(2*a); • Console::WriteLine(L"Two roots are " + x1 + " and " + x2); • return 0; • }

  18. Play with code • 1. Console application • Output more • Read so to pause • Console::Write(L"Enter the constant term(terminate): "); • Int c = Double::Parse(Console::ReadLine()); • Console::Write(L"Verify"); • Boolean y = Double::Parse(Console::ReadLine()); • 2. Windows Form Application • Use different form name

More Related