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

CS50: Introduction to Computer Science

An introduction to the intellectual enterprises of computer science and the art of programming.

CS50x

Associated Schools

Harvard School of Engineering and Applied Sciences

Harvard School of Engineering and Applied Sciences

What you'll learn.

A broad and robust understanding of computer science and programming

How to think algorithmically and solve programming problems efficiently

Concepts like abstraction, algorithms, data structures, encapsulation, resource management, security, software engineering, and web development

Familiarity with a number of languages, including C, Python, SQL, and JavaScript plus CSS and HTML

How to engage with a vibrant community of like-minded learners from all levels of experience

How to develop and present a final programming project to your peers

Course description

This is CS50x , Harvard University's introduction to the intellectual enterprises of computer science and the art of programming for majors and non-majors alike, with or without prior programming experience. An entry-level course taught by David J. Malan, CS50x teaches students how to think algorithmically and solve problems efficiently. Topics include abstraction, algorithms, data structures, encapsulation, resource management, security, software engineering, and web development. Languages include C, Python, SQL, and JavaScript plus CSS and HTML. Problem sets inspired by real-world domains of biology, cryptography, finance, forensics, and gaming. The on-campus version of CS50x , CS50, is Harvard's largest course. 

Students who earn a satisfactory score on 9 problem sets (i.e., programming assignments) and a final project are eligible for a certificate. This is a self-paced course–you may take CS50x on your own schedule.

Instructors

David J. Malan

David J. Malan

Doug Lloyd

You may also like

CS50T

CS50's Understanding Technology

This is CS50’s introduction to technology for students who don’t (yet!) consider themselves computer persons.

CS50W

CS50's Web Programming with Python and JavaScript

This course picks up where CS50 leaves off, diving more deeply into the design and implementation of web apps with Python, JavaScript, and SQL using frameworks like Django, React, and Bootstrap.

CS50L

CS50 for Lawyers

This course is a variant of Harvard University's introduction to computer science, CS50, designed especially for lawyers (and law students).

GCFGlobal Logo

  • Get started with computers
  • Learn Microsoft Office
  • Apply for a job
  • Improve my work skills
  • Design nice-looking docs
  • Getting Started
  • Smartphones & Tablets
  • Typing Tutorial
  • Online Learning
  • Basic Internet Skills
  • Online Safety
  • Social Media
  • Zoom Basics
  • Google Docs
  • Google Sheets
  • Career Planning
  • Resume Writing
  • Cover Letters
  • Job Search and Networking
  • Business Communication
  • Entrepreneurship 101
  • Careers without College
  • Job Hunt for Today
  • 3D Printing
  • Freelancing 101
  • Personal Finance
  • Sharing Economy
  • Decision-Making
  • Graphic Design
  • Photography
  • Image Editing
  • Learning WordPress
  • Language Learning
  • Critical Thinking
  • For Educators
  • Translations
  • Staff Picks
  • English expand_more expand_less

Computer Programming Basics  - Introduction to Computer Programming

Computer programming basics  -, introduction to computer programming, computer programming basics introduction to computer programming.

GCFLearnFree Logo

Computer Programming Basics: Introduction to Computer Programming

Lesson 1: introduction to computer programming, introduction to programming.

Computer programming is the process of designing and writing computer programs . As a skill set, it includes a wide variety of different tasks and techniques, but our tutorials are not intended to teach you everything. Instead, they are meant to provide  basic, practical skills  to help you understand and write computer code that reflects things you see and use in the real world. 

A computer

What you need to know

Our computer programming tutorials assume that you have no programming experience whatsoever. They do, however, require basic familiarity with the use of computers and web browsers. For example, you should be comfortable downloading and opening files, and using text editing software. If you don't feel confident in those skills, consider spending some time with these tutorials first:

  • Computer Basics
  • Internet Basics

As long as you are comfortable with those basics, you should be prepared to begin learning programming. 

What these tutorials will cover

These tutorials focus on one particular type of programming:  web development . When you visit websites , whether you use a laptop, a smartphone, or anything else, you're actually looking at computer  code , which a web developer likely wrote, and which your web browser is interpreting to show you what you see on the screen. 

These tutorials will show you how to begin writing three common types of code used in web development, which combined make up the average website that you see every day: HTML , CSS , and JavaScript .

Parts of a website

Imagine that every website you visit is a person. Every person is different in how they look, act, and speak, but they're generally made up of  the same basic pieces.

If you imagine a website as a person, you can think of HTML as being the skeleton. 

A skeleton

HTML is at the center of almost everything you see on the Internet. While it doesn't look like much on its own, it forms the building blocks on top of which all the other pieces rest. The HTML for an extremely simple website might look something like this:

And if you loaded that in your browser, you'd see this:

Screenshot of a simple website

Try it yourself!

You can test some HTML yourself. Use this as a starting example:

Try entering that HTML in the input box below, then press the "View HTML" button. Make sure to  type it in exactly  as you see it.

You should see a button with the text you entered appear in the box above. It looks fairly plain, and it doesn't do anything yet, but you will learn about that later! 

Congratulations, you just wrote HTML!

If HTML is the skeleton, you can think of CSS as making up all the muscle, skin, and so on that make a person actually look like a person. 

A person

CSS doesn't do anything on its own. Instead, it takes plain HTML and styles it to look different . It can make what you see in the browser bigger or smaller, reorganize the pieces on the page, add colors, and more. Some CSS for an extremely simple website might look something like this:

If you were to apply the above CSS to the same extremely simple website you saw before, it would look like this:

Screenshot of a simple website with styling

You can test that CSS yourself. Use this as a starting example:

Try entering that snippet of CSS in the input box below, then press the "Update CSS" button. Make sure to  type it in exactly  as you see it.

You should see words in the box to the right become italicized. If you do, then congratulations! You just wrote CSS!

If HTML and CSS have combined to make a person that looks like a person, you can think of JavaScript as being the brain. Without it, a person just sits there, but with it, they are active and alive.

A person being active

JavaScript can change the HTML and CSS of a website in real time after it has loaded. It can hide things, add new things, change what things look like, and more. Any time something on a website changes while you are looking at it, there is a good chance that JavaScript is being used to do it. 

For example, imagine that you wanted the browser to create a pop-up greeting whenever somebody loaded the extremely simple website from before. One way would be to write some code that looks like this:

And when you loaded the website, you would see something like this:

Screenshot of a pop-up greeting on a simple website

You can test that JavaScript yourself. Use this code as an example:

Try entering that snippet of code in the input box below, then press the "Run Code" button. Make sure to type it in exactly as you see it.

You should see a pop-up just like in the example above, only with a different message. Congratulations, y ou just wrote JavaScript!

previous

/en/computer-programming-basics/tools-to-start-programming/content/

assignments computer programming

Help Articles

Programming assignments, learner help center dec 5, 2022 • knowledge, article details.

Programming assignments require you to write and run a computer program to solve a problem.

Some programming assignments count toward your final course grade, while others are just for practice.

Sections of a programming assignment

Programming assignments include both assignment instructions and assignment parts.

Assignment instructions:

  • Explain the assignment.
  • May include a link to a downloadable starter package that includes starter code, detailed guidelines, and other resources.

Assignment parts:

  • Are similar to individual questions within a quiz.
  • Are each a single coding task.
  • Are each worth a certain number of points toward the overall assignment score.
  • Can be completed and submitted all at once, or one at a time.

Programming assignment grades

Programming assignments are graded automatically.

Some are graded using a built-in grading algorithm that compares your program's output to a value specified by your instructor. Others are graded using a custom grading algorithm created by your instructor.

If a programming assignment uses built-in grading:

  • Your code will run locally on your computer, and the output will be sent to Coursera's servers.
  • Your grade will be based on comparison against numeric or regular expression grading logic.
  • You'll get your grade a few seconds after submitting.

If a programming assignment uses custom grading:

  • Your code will be run on Coursera's servers.
  • Your grade will be based on custom logic provided by your instructor.
  • You'll get your grade within an hour of submitting.
  • You'll need to refresh the page to see your grade.

Submit a programming assignment

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 by running the submission script in your local coding environment and entering the submission token.
  • If the assignment uses web submission , upload your files using the instructions on your screen.

Test a programming assignment

Some programming assignments let you test them before you submit them to get feedback on whether they run. You won't get grades or feedback from the instructor until you submit the assignment.

Edit or resubmit a programming assignment

You can resubmit a programming assignment if you don't pass on the first attempt or want to improve your score. You might have to wait a certain amount of time between attempts.

To resubmit a programming assignment, follow the same steps for submitting one. If your assignment uses script submission, you'll need to select the Generate new token option on the assignment page and use the new submission token.

Related Articles

  • Number of Views 47.46K
  • Number of Views 68.19K
  • Number of Views 80.35K
  • Number of Views 34.38K
  • Number of Views 41.41K

assignments computer programming

© 2021 Coursera Inc. All rights reserved.

assignments computer programming

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

CSC 120 – Introduction to Computer Programming II

Spring 2024.

Quick Links:   Assignments   |   Style guidelines   |   Lectures   |   Syllabus Exercises -->

Teaching Assistants

Current TA Office Hours schedule: https://docs.google.com/spreadsheets/d/1-zgQS-xSkGVJYUEsVjxT7o5xjEygrqjtlx5r2BmNPlE/edit?usp=sharing

Make sure that you sign up for Discord! It is your responsibility to read postings and announcements posted in the class Discord server.

Each week, we will have one or more ICAs. Place all of your answers into a single PDF, and turn it in through GradeScope. You will be graded on effort, not correctness, so you should make a point to work on each of the Activities in each ICA - but it's OK if your answer isn't completely correct. The ICAs are just for practice! The ICA assigned in lecture is due by 11:00pm that day.

Remember to include the Word of the Day (announced in class) in each ICA document.

Week 1 - Jan 12 ICA1, Python review 1 - solutions are in the Python review slides

Week 2 - Jan 17, 19 ICA2,Python review 2 - ICA-2-solutions ICA3,Python review 3 - ICA-3-solutions

Week 3 - Jan 22, 24, 26 ICA4,Python review 4 - ICA-4-solutions ICA5,Python review 5 - ICA-5-solutions ICA6,Basics of OOP 1 - ICA-6-solutions

Week 4 - Jan 29, 31, Feb 2 ICA7,Basics of OOP 2 - counter-with-str.py - ICA-7-solutions ICA8,Basics of OOP 3 - ICA-8-solutions ICA9,References 1 - ICA-9-solutions

Week 5 - Feb 5, 7, 9 ICA10,References 2 - ICA-10-solutions ICA11,References and Linked Lists - ICA-11-solutions ICA12,Linked Lists 2 - ICA-12-solutions

Week 6 - Feb 12, 14, 16 ICA13,Linked Lists 3 - ICA-13-solutions ICA14,Linked Lists 4 - ICA-14-starter.py - ICA-14-solutions.py ICA15,Linked Lists 5 - ICA-15-solutions

Week 7 - Feb 19, 21, 23 ICA16, ADT Stacks and Queues - ICA-16-solutions ICA17, ADT Stacks and Queues 2 - ICA-17-solutions

Week 8 - Feb 26, 28, Mar 1 ICA18, Queues and Recursion - ICA-18-solutions ICA19, Recursion 2 - ICA-19-solutions ICA20, Recursion 3 - ICA-20-solutions

Week 9 - Mar 11, 13, 15 ICA21, Recursion 4 - ICA-21-solutions ICA22, Trees - ICA-22-solutions ICA23, Trees 2 - ICA-23-solutions

Week 10 - Mar 18, 20, 22 ICA24, Trees 3 - ICA-24-solutions ICA25, Trees 4 - ICA-25-solutions ICA26, Trees 5 - ICA-26-solutions

Week 11 - Mar 25, 27, 29 ICA27, Testing - ICA-27-solutions ICA28, Testing 2 - ICA-28-solutions ICA29, Complexity - ICA-29-solutions

Week 12 - Apr 1, 3, 5 ICA30, Complexity 2 - ICA-30-solutions ICA31, Complexity 3 - ICA-31-solutions

Week 13 - Apr 8, 10, 12 ICA32, Complexity and Hashing

Week 2 - Aug 28, 30, Sep 1 ICA3, Python review 3 - ICA-3-solutions ICA4, Python review 4 - ICA-4-solutions ICA5, Python review 5 - ICA-5-solutions

Week 3 - Sep 6, 8 ICA6, Python review 6 & Basics of OOP - ICA-6-solutions ICA7, Basics of OOP - counter-with-str.py - ICA-7-solutions

Week 4 - Sep 11, 13, 15 ICA8, Basics of OOP - ICA-8-solutions ICA9, References - ICA-9-solutions ICA10, References - ICA-10-solutions

Week 5 - Sep 18, 20, 22 ICA11, References and Linked Lists - ICA-11-solutions ICA12, Linked Lists - ICA-12-solutions ICA13, Linked Lists - ICA-13-solutions

Week 6 - Sep 25, 27, 29 ICA14, Linked Lists - ICA-14-starter.py - ICA-14-solutions.py ICA15, Linked Lists - ICA-15-solutions

Week 7 - Oct 2, 4, 6 ICA16, ADT Stacks and Queues - ICA-16-solutions ICA17, ADT Stacks and Queues - ICA-17-solutions

Week 9, 11, 13 - Oct ICA18, Queues (finish) and Recursion - ICA-18-solutions ICA19, Recursion - ICA-19-solutions ICA20, Recursion - ICA-20-solutions

Week 9 - Oct 16, 18, 20 ICA21, Recursion - ICA-21-solutions ICA22, Trees - ICA-22-solutions ICA23, Trees - ICA-23-solutions

Week 10 - Oct 23, 25, 27 ICA24, Trees - ICA-24-solutions ICA25, Trees - ICA-25-solutions ICA26, Trees - ICA-26-solutions

Week 11 - Oct 30, Nov 1, 3 ICA27, Testing - ICA-27-solutions ICA28, Testing and Complexity - ICA-28-solutions ICA29, Complexity - ICA-29-solutions

Week 12 - Nov 6, 8, (10 Veteran's Day - no class) ICA30, Complexity - ICA-30-solutions

Week 13 - Nov 13, 15, 17 ICA31, Complexity - ICA-31-solutions ICA32, Complexity and Hashing - ICA-32-solutions ICA33, Hashing - ICA-33-solutions

Week 14 - Nov 20, 22, (23-24 Thanksgiving Holiday - no classes) ICA34, Hashing - ICA-34-solutions ICA35, Hashing - ICA-35-solutions

Week 15 - Nov 27, 29, Dec 1 ICA36, Hashing/Debugging - ICA-36-solutions ICA37, Debugging - ICA-37-solutions CIC-Survey ICA38, Debugging and Review - ICA-38-solutions

ICA41, Final Exam Review - ICA-41-solutions ICA42, Backtracking and Review -->