Programming Languages — Set 3
Computers · प्रोग्रामिंग भाषाएं · Questions 21–30 of 60
Which concept in programming refers to the ability of a language to hide internal details and show only functionality?
Correct Answer: D. Abstraction
• **Abstraction** = Abstraction in programming means hiding the complex internal implementation details of a system and exposing only the relevant interface to the user — for example, a programmer calling a 'sort()' function does not need to know which sorting algorithm runs underneath; they only need to know what the function does. • **Manages complexity at scale** — As software systems grow to millions of lines of code, abstraction is what keeps them manageable: each component presents a clean interface while hiding its internal complexity, allowing teams to work independently on different parts. • Abstraction exists at multiple levels: abstract data types, abstract classes, APIs, and even the concept of an operating system are all forms of abstraction that hide hardware complexity from higher-level software. • 💡 Option A (Polymorphism) is wrong because polymorphism allows objects of different types to be treated as the same type, which is about flexible behavior, not hiding implementation details; Option B (Encapsulation) is wrong because encapsulation bundles data and methods together and restricts direct access, but its purpose is data protection rather than complexity hiding; Option C (Inheritance) is wrong because inheritance allows a class to acquire properties and methods from a parent class, which is about code reuse, not concealing internal details.
Which language is known for its 'Write Once, Run Anywhere' capability through the use of a Virtual Machine?
Correct Answer: C. Java
• **Java** = Java achieves platform independence by compiling source code not into native machine instructions but into a platform-neutral intermediate format called bytecode, which is then executed by the Java Virtual Machine (JVM) installed on the target computer. • **JVM as the universal translator** — Because JVMs are available for Windows, Linux, macOS, Android, and dozens of other platforms, the same .class bytecode file runs everywhere without recompilation — exactly fulfilling the 'Write Once, Run Anywhere' promise. • The JVM also provides automatic memory management through garbage collection, eliminating the manual memory errors that make C++ programs crash unpredictably. • 💡 Option A (Python) is wrong because Python is an interpreted language that runs via an interpreter, not through a virtual machine designed for cross-platform bytecode portability; Option B (C++) is wrong because C++ compiles to platform-specific native machine code that must be recompiled separately for each operating system; Option D (Fortran) is wrong because Fortran compiles to native code and has no virtual machine or cross-platform portability mechanism.
Which functional programming language is a dialect of LISP and is used in the AutoCAD software?
Correct Answer: D. AutoLISP
• **AutoLISP** = AutoLISP is a dialect of the LISP language embedded directly inside AutoCAD, the industry-standard computer-aided design (CAD) software; it allows engineers and designers to write scripts that automate repetitive drawing tasks, create custom commands, and manipulate drawing objects programmatically. • **Integral to the CAD workflow for decades** — Since AutoCAD 2.1 in 1986, AutoLISP has been the primary customization tool for the software; entire libraries of AutoLISP routines exist for mechanical engineering, architecture, and civil design. • AutoLISP uses the same parenthesized prefix notation as standard LISP (e.g., (command 'LINE' '0,0' '10,10' '') to draw a line) but extends it with functions specific to AutoCAD's drawing environment. • 💡 Option A (Scheme) is wrong because Scheme is a clean academic dialect of LISP used in computer science education, not in CAD software; Option B (Haskell) is wrong because Haskell is a purely functional language used in academia and financial systems, with no connection to AutoCAD; Option C (Clojure) is wrong because Clojure is a modern LISP dialect running on the JVM, designed for concurrent programming, not CAD automation.
Which language, primarily used for data analysis, uses the 'dplyr' and 'ggplot2' libraries?
Correct Answer: D. R
• **R** = R is a programming language and environment created specifically for statistical computing and data visualization; dplyr is its most popular library for data manipulation (filtering, grouping, summarizing tables), while ggplot2 is its library for creating publication-quality charts and graphs. • **The statistician's language** — R was designed in the early 1990s by Ross Ihaka and Robert Gentleman to give statisticians a free, powerful alternative to expensive tools like SAS and SPSS; it has since become the standard tool in academic research across biology, economics, and social science. • R has over 18,000 packages on CRAN (its official package repository), covering everything from Bayesian statistics and genomics to geospatial mapping and machine learning. • 💡 Option A (Python) is wrong because while Python is also used for data analysis, it does not use dplyr or ggplot2 — those are R-specific libraries; Option B (Julia) is wrong because Julia is a high-performance language for numerical computing with its own distinct library ecosystem; Option C (SQL) is wrong because SQL retrieves data from databases but has no built-in charting or statistical modeling capabilities.
Which of these is a 'Compiled' language rather than an 'Interpreted' one?
Correct Answer: C. C
• **C is a compiled language** = C requires a compiler (such as GCC or Clang) to read the entire source code, analyze it, and produce a standalone executable binary file before the program can run — the CPU then executes this binary directly without any further translation. • **Translation happens once, execution is fast** — Because the compilation step converts human-readable code into optimized machine instructions ahead of time, compiled C programs run at nearly the maximum speed the hardware allows, which is why C is used for operating systems, embedded firmware, and performance-critical software. • The compiler also performs type-checking and optimization passes during compilation, catching many errors before the program ever runs and generating tighter code than an interpreter can produce on the fly. • 💡 Option A (Python) is wrong because Python is interpreted — its interpreter reads and executes the source code line by line at runtime; Option B (JavaScript) is wrong because JavaScript was originally fully interpreted in browsers, though modern engines use JIT compilation; Option D (PHP) is wrong because PHP is primarily interpreted on the server, executing script code directly without a prior compilation step.
What is the term for a programming language that is designed to be used by non-programmers to interact with software?
Correct Answer: A. 4GL
• **4GL (Fourth-Generation Language)** = 4GLs are programming languages one level above procedural third-generation languages like C; they are designed to be so close to natural language or specific domain notation that non-programmers can use them to query databases, generate reports, or build forms without learning traditional coding. • **Natural language commands** — A 4GL statement like 'REPORT ALL EMPLOYEES WHERE SALARY > 50000 SORTED BY NAME' achieves in one line what would take dozens of lines in a 3GL; this makes 4GLs ideal for business analysts who need data without programming expertise. • SQL is the most widely deployed 4GL, and other examples include FOCUS, RPG, and the query languages built into tools like Microsoft Access and Oracle Forms. • 💡 Option B (Assembly) is wrong because assembly is a low-level language closer to machine code, requiring deep technical knowledge — the exact opposite of 4GL's user-friendly design; Option C (Low-level) is wrong because low-level languages are hardware-dependent and inaccessible to non-programmers; Option D (Binary) is wrong because binary (machine language) is the lowest-level representation, consisting of pure 0s and 1s with no human-friendly syntax.
Which language was developed by Microsoft as a component of the .NET framework to rival Java?
Correct Answer: D. C#
• **C# (C-Sharp)** = Developed by Microsoft under Anders Hejlsberg and released in 2000 as part of the .NET framework, C# is a fully object-oriented, strongly typed language designed to combine the raw power of C++ with the ease and safety of Java — and to give Windows developers a first-class modern language. • **The .NET ecosystem language** — C# code compiles to Microsoft Intermediate Language (MSIL) and runs on the Common Language Runtime (CLR), giving it platform portability within .NET environments and tight integration with Windows APIs, Azure cloud services, and the Unity game engine. • Unity, the world's most widely used game development engine for mobile and indie games, uses C# as its primary scripting language, making C# skills extremely valuable for game developers. • 💡 Option A (VB.NET) is wrong because VB.NET (Visual Basic .NET) is a different .NET language with more verbose, BASIC-like syntax — it was not designed to rival Java; Option B (ASP.NET) is wrong because ASP.NET is a web development framework, not a programming language; Option C (F#) is wrong because F# is a functional-first .NET language used primarily in data science and finance, not as Microsoft's primary answer to Java.
What name is given to the error-finding process in a computer program?
Correct Answer: C. Debugging
• **Debugging** = Debugging is the systematic process of locating, analyzing, and removing errors (called bugs) in a computer program — it involves reproducing the problem, identifying which line of code causes it, understanding why the logic fails, and applying a fix. • **Origin of the word 'bug'** — In 1947, Grace Hopper's team at Harvard found a literal moth trapped inside the Mark II computer's relay, causing a malfunction; they taped it into the logbook with the note 'first actual case of bug being found,' giving the modern term its name. • Modern debugging tools (debuggers) allow programmers to set breakpoints that pause execution, inspect variable values at any point, and step through code one instruction at a time to trace exactly where logic goes wrong. • 💡 Option A (Compiling) is wrong because compiling translates source code to machine code — it may report syntax errors, but the process of hunting down logic errors is debugging, not compiling; Option B (Decoding) is wrong because decoding refers to converting encoded data back to its original form, not fixing program errors; Option D (Assembling) is wrong because assembling converts assembly language mnemonics to machine code — a translation step, not error investigation.
Which language is famously known as the primary tool for Unix system development?
Correct Answer: C. C
• **C language = primary tool for Unix development** = In 1973, Dennis Ritchie and Ken Thompson rewrote the Unix operating system in C, making it the first major OS written in a high-level language — before that, operating systems were coded in machine-specific assembly, meaning each new computer required a complete OS rewrite. • **Portability as the key breakthrough** — Writing Unix in C meant that moving Unix to a new type of hardware required only recompiling the C source code with a new compiler, rather than rewriting thousands of lines of assembly; this is why Unix (and later Linux) spread to dozens of hardware platforms. • The entire Linux kernel today is still written primarily in C, as are the core components of macOS and Windows, continuing C's dominance in operating system development more than 50 years after Unix. • 💡 Option A (Pascal) is wrong because Pascal was a teaching language with no role in Unix's development; Option B (Fortran) is wrong because Fortran was designed for scientific computation and was never used to build operating systems; Option D (COBOL) is wrong because COBOL is a business data processing language with no memory management or hardware control capabilities needed for OS development.
Which language is the standard for creating and modifying the style of a web page?
Correct Answer: D. CSS
• **CSS (Cascading Style Sheets)** = CSS is the language that controls the visual presentation of web pages — it specifies colors, fonts, spacing, layout, animations, and responsive behavior, completely separating the look of a page from its content structure (defined by HTML). • **The 'Cascading' mechanism** — CSS rules cascade and inherit: a style applied to a parent element flows down to its children, and more specific rules override more general ones; this allows designers to set site-wide defaults and override them for specific elements efficiently. • CSS3, the current version, introduced powerful features like Flexbox and Grid layout, CSS animations, custom properties (variables), and media queries that let websites adapt their design to different screen sizes. • 💡 Option A (PHP) is wrong because PHP is a server-side scripting language used for dynamic content generation and database interaction, not visual styling; Option B (Ruby) is wrong because Ruby is a general-purpose programming language used for web backend development (via Rails), not for applying styles to pages; Option C (HTML) is wrong because HTML defines the content and structure of a page (headings, paragraphs, images) but has no ability to control colors, fonts, or layouts.