Presentation is loading. Please wait.

Presentation is loading. Please wait.

All 300/400 Level CS Major Courses Tutoring Location: SEC 3433 Sign up or walk-in Introduction2-1.

Similar presentations


Presentation on theme: "All 300/400 Level CS Major Courses Tutoring Location: SEC 3433 Sign up or walk-in Introduction2-1."— 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 Introduction2-1

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) Result Executor hello.exe

4 Interpreted Languages Interpreter hello.bas Result

5 Compiled vs. Interpreted Advantages Disadvantages

6 Hybrid Compiler-Interpreter Interpreter Source code Result Compiler Intermediate language code

7 Java JRE/JVM Java Source Code Result Javac Java Bytecode

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

9 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

10 .NET –Application development technologies –.NET base class library –Common Language Runtime (above OS)

11 .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.

12 IDE (Integrated development environment) Microsoft Visual Studio for C++

13 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”http://oit.ua.edu/oit/services/software- licensing/dreamspark-standard/

14 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

15 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

16 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.

17 backups

18 Examples Quadratic Equation: ax 2 +bx+c=0 Discriminant: ∆=b 2 -4ac Two roots: x 1 = x 2 =

19 // Quadratic.cpp : main project file. #include "stdafx.h" using namespace System; int main(array ^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; }

20 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


Download ppt "All 300/400 Level CS Major Courses Tutoring Location: SEC 3433 Sign up or walk-in Introduction2-1."

Similar presentations


Ads by Google