220 likes | 345 Views
INF160 IS Development Environments AUBG, COS dept. Lecture xx Title: Training session before Midtest on DevEnv (Extract from Syllabus). Lecture Contents:. IDE - Components, Structure, Functionality MS Visual Studio BloodShed Dev C++ (obsolete IDE) Code::Blocks Sharp Develop (n/a)
E N D
INF160 IS Development Environments AUBG, COS dept Lecture xx Title: Training session before Midtest on DevEnv (Extract from Syllabus)
Lecture Contents: • IDE - Components, Structure, Functionality • MS Visual Studio • BloodShed Dev C++ (obsolete IDE) • Code::Blocks • Sharp Develop (n/a) • NetBeans • Eclipse • jGRASP • BlueJ
MS Visual Studio • How to create, compile and run programs • Intellisense • Code Snippets • Refactoring
MS Visual Studio Intellisense IntelliSense is Microsoft's implementation of autocompletion. Autocomplete involves the program predicting a word or phrase that the user wants to type in without the user actually typing it in completely 4
MS Visual Studio Code Snippets Code snippets are templates that you can use to insert code. Code Snippets are ACTIVATED: By Typing snippet alias and pressing TAB key Or By Pressing CTRL+K+X to activate the code snippet list and selecting the desired snippet alias Or By Pressing CTRL+’SpaceBar’ to display more exhaustive list of snippets for, forr, class, ctor 5
MS Visual Studio Refactoring: "disciplined technique for restructuring an existing body of source code, altering its internal structure without changing its external behaviour”. Edit > Refactor > Extract Method… Edit > Refactor > Rename… 6
BloodShed Dev C++ • BloodShed Dev C++ - obsolete IDE • Substitute Code::Blocks for BloodShed Dev C++ • How to create, compile and run programs • Command Line arguments • Static libraries - .a files
Code::Blocks • How to create, compile and run programs • Advantages of Code::Blocks relative to Visual Studio • Static libraries - .a files
Sharp Develop • N/A in Spring 2014 • How to create, compile and run programs • Internationalization – UI language • Convert Code C# - to other PL
NetBeans • How to create, compile and run programs • Compile on Save feature
Eclipse • How to create, compile and run programs • The Perspective concept
jGRASP • How to create, compile and run programs • Console applications
BLUEj • How to create, compile and run programs • Classes • Objects/instances of classes/ • Relations and Dependencies among classes
Components of a SW program • Classes • Composition of: • Data items/fields • Routines - methods
Components of a SW program • Programs • Structured programming • Composition of global data and routines (C, C++, VB) • OOP • Composition of one or more classes (C#, Java, C++)
Components of a SW program • Programs • Physically organized as • Single file source text • Multiple files source text • Logically organized as • Module – VB • Namespace - C# • Package - Java
Training task • Define a routine (procedure mode with no return value and no parameters) named myData() that displays its name. • Define a routine (function mode with a return value and parameters) named addTwoValues(..) that returns the sum of its two arguments/parameters • Write a driver main() program/function/method to test the functionality of the myData() procedure type routine and the addTwoValues(..) function type routine formulated above
Thank You For Your Attention!
VB solution: Imports System Module Module1 Sub Main() myDATA() Console.WriteLine(addTwoValues(10, 20)) End Sub Sub myData() Console.WriteLine("myData") End Sub Function addTwoValues(ByVal p1 As Integer, ByVal p2 As Integer) As Integer Return p1 + p2 End Function End Module
C++ solution: #include <iostream> using namespace std; void myDATA(); int addTwoValues(int p1, int p2); void main() { myDATA(); cout << endl << addTwoValues(10, 20); } void myDATA() { cout << "myDATA"; } int addTwoValues(int p1, int p2) { return p1 + p2; }
C# solution: using System; namespace ProobaCsharp { class Program { static void Main(string[] args) { myData(); Console.WriteLine(addTwoValues(10, 20)); } static void myData() { Console.WriteLine("myData"); } static int addTwoValues(int p1, int p2) { return p1 + p2; } } }
Java solution: package trainingTask; public class TrainingTask { public static void main(String[] args) { myData(); System.out.println(addTwoValues(10, 20)); } static void myData() { System.out.println("myData"); } static int addTwoValues(int p1, int p2){ return p1 + p2; } }