Advertisement
Alekscho85

ProgrammingLanguages

Sep 25th, 2014
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.16 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. class ProgrammingLanguages
  5. {
  6.     static void Main()
  7.     {
  8.         string topicCSharp = "C# it is a Microsoft programming language developed to compete with Sun's Java language. C# is an object-oriented programming language used with XML-based Web services on the .NET platform and designed for improving productivity in the development of Web applications. C# boasts type-safety, garbage collection, simplified type declarations, versioning and scalability support, and other features that make developing solutions faster and easier, especially for COM+ and Web services. Microsoft critics have pointed to the similarities between C# and Java. ";
  9.         string topicVisualBasic = "A programming language and environment developed by Microsoft. Based on the BASIC language, Visual Basic was one of the first products to provide a graphical programming environment and a paint metaphor for developing user interfaces. Instead of worrying about syntax details, the Visual Basic programmer can add a substantial amount of code simply by dragging and dropping controls, such as buttons and dialog boxes, and then defining their appearance and behavior.";
  10.         string topicJava = "Developed by Sun Microsystems.Java is an object-oriented language similar to C++, but simplified to eliminate language features that cause common programming errors. Java source code files (files with a .java extension) are compiled into a format called bytecode (files with a .class extension), which can then be executed by a Java interpreter. Compiled Java code can run on most computers because Java interpreters and runtime environments, known as Java Virtual Machines (VMs), exist for most operating systems, including UNIX, the Macintosh OS, and Windows.";
  11.         string topicCPP = "A high-level programming language developed by Bjarne Stroustrup at Bell Labs. C++ adds object-oriented features to its predecessor, C. C++ is one of the most popular programming language for graphical applications, such as those that run in Windows and Macintosh environments.";
  12.         string topicPHP = "Self-referentially short for PHP: Hypertext Preprocessor, an open source, server-side, HTML embedded scripting language used to create dynamic Web pages.In an HTML document, PHP script (similar syntax to that of Perl or C ) is enclosed within special PHP tags. Because PHP is embedded within tags, the author can jump between HTML and PHP (similar to ASP and Cold Fusion) instead of having to rely on heavy amounts of code to output HTML. And, because PHP is executed on the server, the clientcannot view the PHP code";
  13.         string topicRuby = "Ruby is a dynamic, open-source, object-oriented programming language developed by computer scientist Yukihiro Matsumoto back in the 90s, which makes it one of the youngest languages in broad use.";
  14.         Console.SetWindowSize(100, 55);
  15.         Console.ForegroundColor = ConsoleColor.Red;
  16.         Console.WriteLine("Programing Languages");
  17.         Console.WriteLine("---------------------");
  18.         Console.ForegroundColor = ConsoleColor.Blue;
  19.         Console.WriteLine("C# (C Sharp): ");
  20.         PrintLines(topicCSharp);
  21.         Console.WriteLine();
  22.         Console.WriteLine("Visual Basic (.NET): ");
  23.         PrintLines(topicVisualBasic);
  24.         Console.WriteLine("Java: ");
  25.         PrintLines(topicJava);
  26.         Console.WriteLine("C++: ");
  27.         PrintLines(topicCPP);
  28.         Console.WriteLine("PHP: ");
  29.         PrintLines(topicPHP);
  30.         Console.WriteLine("Ruby");
  31.         PrintLines(topicRuby);
  32.     }
  33.  
  34.     static void PrintLines(string content)
  35.     {
  36.         Console.ForegroundColor = ConsoleColor.Green;
  37.         int lineLimit = 60;
  38.         StringBuilder wordLine = new StringBuilder("");
  39.         string[] topic = content.Split(' ');
  40.         for (int index = 0; index < topic.Length; index++)
  41.         {
  42.             wordLine.Append(topic[index]);
  43.             wordLine.Append(" ");
  44.             if ((wordLine.Length > lineLimit) || (index == topic.Length - 1))
  45.             {
  46.                 Console.WriteLine(wordLine);
  47.                 wordLine.Clear();
  48.             }
  49.         }
  50.         Console.ForegroundColor = ConsoleColor.Blue;
  51.     }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement