Browse Course Material

Course info, instructors.

  • Prof. Eric Grimson
  • Prof. John Guttag

Departments

  • Electrical Engineering and Computer Science

As Taught In

  • Programming Languages

Introduction to Computer Science and Programming

Assignments.

facebook

You are leaving MIT OpenCourseWare

Course summary

CS 242 explores models of computation, both old, like functional programming with the lambda calculus (circa 1930), and new, like memory-safe systems programming with Rust (circa 2010). The study of programming languages is equal parts systems and theory, looking at how a rigorous understanding of the syntax, structure, and semantics of computation enables formal reasoning about the behavior and properties of complex real-world systems. In light of today’s Cambrian explosion of new programming languages, this course also seeks to provide a conceptual clarity on how to compare and contrast the multitude of programming languages, models, and paradigms in the modern programming landscape. See the schedule below for full topic list. Prerequisites: 103, 110.

Previous iterations of this course: Fall 2018 , Fall 2017 .

For more on this course’s design, read my SNAPL’19 paper: “From Theory to Systems: A Grounded Approach to Programming Language Education”

Course info

  • Lectures: Mon & Wed 4:30pm-5:50pm, Skilling Auditorium
  • Links: Gradescope , Campuswire , feedback

programming language assignment

Course assistants

programming language assignment

Logo for Rebus Press

Want to create or adapt books like this? Learn more about how Pressbooks supports open publishing practices.

Kenneth Leroy Busbee

An assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. [1]

The assignment operator allows us to change the value of a modifiable data object (for beginning programmers this typically means a variable). It is associated with the concept of moving a value into the storage location (again usually a variable). Within most programming languages the symbol used for assignment is the equal symbol. But bite your tongue, when you see the = symbol you need to start thinking: assignment. The assignment operator has two operands. The one to the left of the operator is usually an identifier name for a variable. The one to the right of the operator is a value.

Simple Assignment

The value 21 is moved to the memory location for the variable named: age. Another way to say it: age is assigned the value 21.

Assignment with an Expression

The item to the right of the assignment operator is an expression. The expression will be evaluated and the answer is 14. The value 14 would be assigned to the variable named: total_cousins.

Assignment with Identifier Names in the Expression

The expression to the right of the assignment operator contains some identifier names. The program would fetch the values stored in those variables; add them together and get a value of 44; then assign the 44 to the total_students variable.

  • cnx.org: Programming Fundamentals – A Modular Structured Approach using C++
  • Wikipedia: Assignment (computer science) ↵

Programming Fundamentals Copyright © 2018 by Kenneth Leroy Busbee is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License , except where otherwise noted.

Share This Book

Logo for Open Textbooks @ UQ

Learning programming languages

Strategies for programming assignments, citing code.

Coding assignments can range from simple programs to full-blown applications. It is important to know how to approach such assignments, so that you can complete them to the best of your ability. Some platforms you may be asked to develop for are:

  • Web  — websites and web apps for browsers like Chrome or Firefox
  • Mobile  — mobile apps for iOS and Android
  • Desktop  — desktop applications or programs for Windows, macOS and Linux.

If you are starting a coding assignment in a programming language that you are not familiar with, there are tutorials you can take to understand the basics in a few hours:

  • Learn a range of  programming language training and tutorials  from LinkedIn Learning (UQ login is required)
  • Codecademy  has courses on web development, data science and computer science
  • w3schools  has tutorials on web development languages — HTML, CSS, JavaScript, Python etc.

Get more information on  tools for web, software and mobile application development .

Universal strategies that can be applied to make your programming assignments easier:

  • Start early  — this gives you more time to think about the task and how you might approach it, but also more time to get help, if needed
  • Plan your program using pseudocode  —  pseudocode  is a great method for planning what you want to code in way that is easy for people to understand
  • Create the HTML, CSS and JavaScript files
  • Link the CSS and JavaScript files using the appropriate tags in your HTML file.
  • Use comments  — all programming languages allow you to write comments that are lines which are ignored by the program. A great way to use comments is to type out the steps required for coding a piece of functionality. You can then follow these steps to code it line by line
  • Take a break  — if you ever get stuck, it’s probably a good time to take a break. Breaks as short as 5 minutes can be enough to clear your mind
  • Explain your problems to a rubber duck  —  Rubber duck debugging  is actually a legitimate way of solving programming related problems. It works simply by explaining your problems aloud, which can help you find what’s causing bugs in your code.

Students should confirm what is permitted for a specific assignment prior to commencing. Some assignments do not permit the use of external support and all code must be written by the individual. However, if you are allowed to use externally sourced code it must be referenced if it is not your own original work. Failure to reference externally sourced, non-original work can result in misconduct proceedings. An external source is code, including from anywhere on the internet or from a tutorial, taken or used to write your own code.

References should provide clear and accurate information for each source and should identify where they have been used in your work. A single URL is not a complete or accurate reference. URLs should link directly to the work cited, not just to the website it is hosted on. An example format for referencing online sources:

[where used] : [title of asset], [creator of asset]; retrieved from [website title] ([URL]), Last accessed [DD/MM/YYYY}

For code references, the [where used] should map to the position in the code e.g. in the code itself, create a comment to identify where in your code you have used an external source:

For code with no changes or adaptations

(How to comment) retrieved from Unity Answers : how to comment the lines? (http://answers.unity3d.com/answers/221574/view.html target=”_blank” rel=”noopener noreferrer”) Last accessed 11/9/2017

Ensure you are using syntax specifically for the programming language being used.

For code that you have changed or adapted

You should describe how you adapted it.

(Output Loop) retrieved from Unity Answers : Writing a Loop (http://answers.unity3d.com/answers/221574/view.html target=”_blank” rel=”noopener noreferrer”) Last accessed 9/9/2017

programming language assignment

Types of Assignments Copyright © 2023 by The University of Queensland is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License , except where otherwise noted.

Share This Book

Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

Programming Languages (University of Washington)

doct0rX/ProgrammingLanguages

Folders and files, repository files navigation, programming languages.

by University of Washington

This course is an introduction to the basic concepts of programming languages, with a strong emphasis on functional programming . The course uses the languages ML, Racket, and Ruby as vehicles for teaching the concepts, but the real intent is to teach enough about how any language “fits together” to make you more effective programming in any language -- and in learning new ones.

This course is neither particularly theoretical nor just about programming specifics -- it will give you a framework for understanding how to use language constructs effectively and how to design correct and elegant programs. By using different languages, you will learn to think more deeply than in terms of the particular syntax of one language. The emphasis on functional programming is essential for learning how to write robust, reusable, composable, and elegant programs. Indeed, many of the most important ideas in modern languages have their roots in functional programming. Get ready to learn a fresh and beautiful way to look at software and how to have fun building it.

The course assumes some prior experience with programming, as described in more detail in the first module.

The course is divided into three Coursera courses: Part A , Part B , and Part C . As explained in more detail in the first module of Part A, the overall course is a substantial amount of challenging material, so the three-part format provides two intermediate milestones and opportunities for a pause before continuing. The three parts are designed to be completed in order and set up to motivate you to continue through to the end of Part C. The three parts are not quite equal in length: Part A is almost as substantial as Part B and Part C combined.

Certificates

Introduction.

This repo contains all my work for this course. All the code base, quiz questions, screenshot, and images, are taken from, unless specified, Programming Languages on Coursera . The course is also avilable on washington.edu .

What I want to say

VERBOSE CONTENT WARNING: YOU CAN JUMP TO THE NEXT SECTION IF YOU WANT

Here I released these solutions, which are only for your reference purpose . It may help you to save some time. And I hope you don't copy any part of the code (the programming assignments are fairly easy if you read the instructions carefully), see the quiz solutions before you start your own adventure.

Currently, this repo has 3 major parts you may be interested in and I will give a list here.

Homework Assignments and Exams

Part A: ML and Functional Pragramming

  • Week 2 - Homework 1 - ML Functions, Tuples, Lists, and More : 100.3/100
  • Week 3 - Homework 2 - Datatypes, Pattern Matching, Tail Recursion, and More : 99/100
  • Week 4 - Homework 3 - First-Class Functions and Closures : 100/100
  • Week 5 - Part A - Exam

Part B: Racket and Dynamically Typed Language

  • Week 1 - Homework 4 - Racket, Delaying Evaluation, Memoization, Macros : 97/100
something incorrect in (list-nth-mod) function; cute dog from the auto-grader
  • Week 2 - Homework 5 - Structs, Implementing Languages, Static vs. Dynamic Typing : 99/100
ifeq: resulting expression evaluates to e3 if e1 and e2 evaluate to equal integers ('(ifeq (int 5) (int 5) (int 0) (int 1)) should result in MUPL that evaluates to (int 0) but resulted in (mlet "_x" (int 5) (mlet "_y" (int 5) (int 1)))) [incorrect answer];
  • Week 3 - Section Quiz

Part C: Ruby and Object-Oriented Language

  • Week 1 - Homework 6 - Ruby, Object-Oriented Programming, Subclassing 100/100
  • Week 2 - Homework 7 - Program Decomposition, Mixins, Subtyping, and More 99/100 [69/70 for Ruby && 30/30 for SML]
Ruby output: *intersect_methods(Line#intersect): Line.new(5.0,0.0).intersect(LineSegment.new(1.0,5.0,2.0,2.0)) should equal Point.new(1.0,5.0) (actual: NoPoints.new) [incorrect answer]
Because the auto-grader gave a score above 60, here is the link to a message from a very cute dog: https://drive.google.com/file/d/0B5sUgbs6aDNpSXBkMVZmelJJX1U/view?pref=2&pli=1 *
  • Week 3 - Final Exam
  • Standard ML 47.8%
  • Racket 23.6%

C Data Types

C operators.

  • C Input and Output
  • C Control Flow
  • C Functions
  • C Preprocessors

C File Handling

  • C Cheatsheet

C Interview Questions

  • C Programming Language Tutorial
  • C Language Introduction
  • Features of C Programming Language
  • C Programming Language Standard
  • C Hello World Program
  • Compiling a C Program: Behind the Scenes
  • Tokens in C
  • Keywords in C

C Variables and Constants

  • C Variables
  • Constants in C
  • Const Qualifier in C
  • Different ways to declare variable as constant in C
  • Scope rules in C
  • Internal Linkage and External Linkage in C
  • Global Variables in C
  • Data Types in C
  • Literals in C
  • Escape Sequence in C
  • Integer Promotions in C
  • Character Arithmetic in C
  • Type Conversion in C

C Input/Output

  • Basic Input and Output in C
  • Format Specifiers in C
  • printf in C
  • Scansets in C
  • Formatted and Unformatted Input/Output functions in C with Examples
  • Operators in C
  • Arithmetic Operators in C
  • Unary operators in C
  • Relational Operators in C
  • Bitwise Operators in C
  • C Logical Operators

Assignment Operators in C

  • Increment and Decrement Operators in C
  • Conditional or Ternary Operator (?:) in C
  • sizeof operator in C
  • Operator Precedence and Associativity in C

C Control Statements Decision-Making

  • Decision Making in C (if , if..else, Nested if, if-else-if )
  • C - if Statement
  • C if...else Statement
  • C if else if ladder
  • Switch Statement in C
  • Using Range in switch Case in C
  • while loop in C
  • do...while Loop in C
  • For Versus While
  • Continue Statement in C
  • Break Statement in C
  • goto Statement in C
  • User-Defined Function in C
  • Parameter Passing Techniques in C
  • Function Prototype in C
  • How can I return multiple values from a function?
  • main Function in C
  • Implicit return type int in C
  • Callbacks in C
  • Nested functions in C
  • Variadic functions in C
  • _Noreturn function specifier in C
  • Predefined Identifier __func__ in C
  • C Library math.h Functions

C Arrays & Strings

  • Properties of Array in C
  • Multidimensional Arrays in C
  • Initialization of Multidimensional Array in C
  • Pass Array to Functions in C
  • How to pass a 2D array as a parameter in C?
  • What are the data types for which it is not possible to create an array?
  • How to pass an array by value in C ?
  • Strings in C
  • Array of Strings in C
  • What is the difference between single quoted and double quoted declaration of char array?
  • C String Functions
  • Pointer Arithmetics in C with Examples
  • C - Pointer to Pointer (Double Pointer)
  • Function Pointer in C
  • How to declare a pointer to a function?
  • Pointer to an Array | Array Pointer
  • Difference between constant pointer, pointers to constant, and constant pointers to constants
  • Pointer vs Array in C
  • Dangling, Void , Null and Wild Pointers in C
  • Near, Far and Huge Pointers in C
  • restrict keyword in C

C User-Defined Data Types

  • C Structures
  • dot (.) Operator in C
  • Structure Member Alignment, Padding and Data Packing
  • Flexible Array Members in a structure in C
  • Bit Fields in C
  • Difference Between Structure and Union in C
  • Anonymous Union and Structure in C
  • Enumeration (or enum) in C

C Storage Classes

  • Storage Classes in C
  • extern Keyword in C
  • Static Variables in C
  • Initialization of static variables in C
  • Static functions in C
  • Understanding "volatile" qualifier in C | Set 2 (Examples)
  • Understanding "register" keyword in C

C Memory Management

  • Memory Layout of C Programs
  • Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()
  • Difference Between malloc() and calloc() with Examples
  • What is Memory Leak? How can we avoid?
  • Dynamic Array in C
  • How to dynamically allocate a 2D array in C?
  • Dynamically Growing Array in C

C Preprocessor

  • C Preprocessor Directives
  • How a Preprocessor works in C?
  • Header Files in C
  • What’s difference between header files "stdio.h" and "stdlib.h" ?
  • How to write your own header file in C?
  • Macros and its types in C
  • Interesting Facts about Macros and Preprocessors in C
  • # and ## Operators in C
  • How to print a variable name in C?
  • Multiline macros in C
  • Variable length arguments for Macros
  • Branch prediction macros in GCC
  • typedef versus #define in C
  • Difference between #define and const in C?
  • Basics of File Handling in C
  • C fopen() function with Examples
  • EOF, getc() and feof() in C
  • fgets() and gets() in C language
  • fseek() vs rewind() in C
  • What is return type of getchar(), fgetc() and getc() ?
  • Read/Write Structure From/to a File in C
  • C Program to print contents of file
  • C program to delete a file
  • C Program to merge contents of two files into a third file
  • What is the difference between printf, sprintf and fprintf?
  • Difference between getc(), getchar(), getch() and getche()

Miscellaneous

  • time.h header file in C with Examples
  • Input-output system calls in C | Create, Open, Close, Read, Write
  • Signals in C language
  • Program error signals
  • Socket Programming in C
  • _Generics Keyword in C
  • Multithreading in C
  • C Programming Interview Questions (2024)
  • Commonly Asked C Programming Interview Questions | Set 1
  • Commonly Asked C Programming Interview Questions | Set 2
  • Commonly Asked C Programming Interview Questions | Set 3

programming language assignment

Assignment operators are used for assigning value to a variable. The left side operand of the assignment operator is a variable and right side operand of the assignment operator is a value. The value on the right side must be of the same data-type of the variable on the left side otherwise the compiler will raise an error.

Different types of assignment operators are shown below:

1. “=”: This is the simplest assignment operator. This operator is used to assign the value on the right to the variable on the left. Example:

2. “+=” : This operator is combination of ‘+’ and ‘=’ operators. This operator first adds the current value of the variable on left to the value on the right and then assigns the result to the variable on the left. Example:

If initially value stored in a is 5. Then (a += 6) = 11.

3. “-=” This operator is combination of ‘-‘ and ‘=’ operators. This operator first subtracts the value on the right from the current value of the variable on left and then assigns the result to the variable on the left. Example:

If initially value stored in a is 8. Then (a -= 6) = 2.

4. “*=” This operator is combination of ‘*’ and ‘=’ operators. This operator first multiplies the current value of the variable on left to the value on the right and then assigns the result to the variable on the left. Example:

If initially value stored in a is 5. Then (a *= 6) = 30.

5. “/=” This operator is combination of ‘/’ and ‘=’ operators. This operator first divides the current value of the variable on left by the value on the right and then assigns the result to the variable on the left. Example:

If initially value stored in a is 6. Then (a /= 2) = 3.

Below example illustrates the various Assignment Operators:

Please Login to comment...

Similar reads.

  • C-Operators
  • cpp-operator

advertisewithusBannerImg

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

IMAGES

  1. What is a programming language assignment

    programming language assignment

  2. How Do I Complete My Programming Assignment In Short Time?

    programming language assignment

  3. Programming Assignment

    programming language assignment

  4. Useful Tricks For Mastering A New Programming Assignment

    programming language assignment

  5. Programming Assignment 5

    programming language assignment

  6. Modern Programming Languages Assignment 7

    programming language assignment

VIDEO

  1. JS Coding Assignment-2

  2. Ternary Operator in C Print Absolute Numbers

  3. Python (Programming Language) Project 8: 'Assignment Operators' Created by Trishanth Kumar

  4. Sign language assignment

  5. Understanding Operators in C

  6. C++ Assignment Operators Practice coding

COMMENTS

  1. Weiting-Zhang/Programming-Languages

    This course is an introduction to the basic concepts of programming languages, with a strong emphasis on functional programming. The course uses the languages ML (in Part A ), Racket (in Part B ), and Ruby (in Part C ) as vehicles for teaching the concepts, but the real intent is to teach enough about how any language "fits together" to ...

  2. Python Exercises, Practice, Challenges

    These free exercises are nothing but Python assignments for the practice where you need to solve different programs and challenges. All exercises are tested on Python 3. Each exercise has 10-20 Questions. The solution is provided for every question. These Python programming exercises are suitable for all Python developers.

  3. Assignments

    Assignments. pdf. 98 kB Getting Started: Python and IDLE. file. 193 B shapes. file. 3 kB subjects. file. 634 kB words. pdf. 52 kB ... Programming Languages; Download Course. Over 2,500 courses & materials Freely sharing knowledge with learners and educators around the world.

  4. Programming Languages, Part A

    Module 2 • 1 hour to complete. This module contains two things: (1) The information for the [unusual] software you need to install for Programming Languages Part A. (2) An optional "fake" homework that you can turn in for auto-grading and peer assessment to get used to the mechanics of assignment turn-in that we will use throughout the course.

  5. Assignments

    Programming Languages; Software Design and Engineering; Learning Resource Types notes Lecture Notes. assignment Programming Assignments. Download Course. Over 2,500 courses & materials Freely sharing knowledge with learners and educators around the world. Learn more

  6. PDF Programming Languages Overview & Syntax

    Programming Language Design and Usage Main Themes Programming Language as a Tool for Thought Idioms ... - programs have mutable storage (state) modified by assignments - the most common and familiar paradigm • object-oriented (Simula 67, Smalltalk, Eiffel, Ada95, Java, C#)

  7. CS 242: Programming Languages, Fall 2019

    Stanford's course on programming language theory and design. CS 242: Programming Languages, ... Assignment 1 due, Assignment 2 out. TAPL Ch. 8-9. Week 3: October 7 Lecture 3.1 (Mon): Functional basics ( notes) TAPL Ch. 9; Real World OCaml - Guided Tour; Lecture 3.2 (Wed ...

  8. 5 Types of Programming Languages

    Some popular functional programming languages include: Scala. Erlang. Haskell. Elixir. F#. 3. Object-oriented programming languages (OOP) This type of language treats a program as a group of objects composed of data and program elements, known as attributes and methods.

  9. Assignment Operators in Programming

    Assignment operators are used in programming to assign values to variables. We use an assignment operator to store and update data within a program. They enable programmers to store data in variables and manipulate that data. The most common assignment operator is the equals sign (=), which assigns the value on the right side of the operator to ...

  10. Data Structures

    In this online course, we consider the common data structures that are used in various computational problems. You will learn how these data structures are implemented in different programming languages and will practice implementing them in our programming assignments.

  11. Assignment

    Discussion. The assignment operator allows us to change the value of a modifiable data object (for beginning programmers this typically means a variable). It is associated with the concept of moving a value into the storage location (again usually a variable). Within most programming languages the symbol used for assignment is the equal symbol.

  12. 10 Coding Projects for Beginners

    Here are 10 basic coding projects for beginners: 1. Build a chess game. Building a chess game is a great way to hone your ability to think like a developer. It'll also allow you to practice using algorithms, as you'll have to create not only the board and game pieces but also the specific moves that each piece can make. 2.

  13. Assignments

    Programming Languages; Software Design and Engineering; Learning Resource Types notes Lecture Notes. group_work Projects. assignment_turned_in Programming Assignments with Examples. Download Course. Over 2,500 courses & materials Freely sharing knowledge with learners and educators around the world.

  14. 8. Coding

    Coding - Types of Assignments. 8. Coding. Learning programming languages. Strategies for programming assignments. Citing code. Coding assignments can range from simple programs to full-blown applications. It is important to know how to approach such assignments, so that you can complete them to the best of your ability.

  15. Programming assignments

    To submit a programming assignment: Open the assignment page for the assignment you want to submit. Read the assignment instructions and download any starter files. Finish the coding tasks in your local coding environment. Check the starter files and instructions when you need to. If the assignment uses script submission, submit your assignment ...

  16. C programming Exercises, Practice, Solution

    C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs.

  17. Programming language

    A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their syntax (form) and semantics ... Programming languages such as Java and C# have definite assignment analysis, a form of data flow analysis, as part of their respective static semantics. Dynamic semantics

  18. GitHub

    by University of Washington. This course is an introduction to the basic concepts of programming languages, with a strong emphasis on functional programming.The course uses the languages ML, Racket, and Ruby as vehicles for teaching the concepts, but the real intent is to teach enough about how any language "fits together" to make you more effective programming in any language -- and in ...

  19. Assignment (computer science)

    Assignment (computer science) In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location (s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assignment statement (or expression) is a fundamental construct.

  20. What is an Assignment?

    Assignment: An assignment is a statement in computer programming that is used to set a value to a variable name. The operator used to do assignment is denoted with an equal sign (=). This operand works by assigning the value on the right-hand side of the operand to the operand on the left-hand side. It is possible for the same variable to hold ...

  21. Different Forms of Assignment Statements in Python

    Python creates a variable name the first time when they are assigned a value. Names must be assigned before being referenced. There are some operations that perform assignments implicitly. Assignment statement forms :-. 1. Basic form: This form is the most common form. p, *q = 'Hello'. print('p = ', p)

  22. Assignment Operators in C

    Different types of assignment operators are shown below: 1. "=": This is the simplest assignment operator. This operator is used to assign the value on the right to the variable on the left. Example: a = 10; b = 20; ch = 'y'; 2. "+=": This operator is combination of '+' and '=' operators. This operator first adds the current ...

  23. Assignment on basic programming language

    computer science aplication in textile sector. Engineering. 1 of 18. Download Now. Download to read offline. Assignment on basic programming language - Download as a PDF or view online for free.