CS50: Introduction to Computer Science
An introduction to the intellectual enterprises of computer science and the art of programming.
Associated Schools
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
You may also like
CS50's Understanding Technology
This is CS50’s introduction to technology for students who don’t (yet!) consider themselves computer persons.
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.
CS50 for Lawyers
This course is a variant of Harvard University's introduction to computer science, CS50, designed especially for lawyers (and law students).
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.
You are leaving MIT OpenCourseWare
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
CS50: Introduction to Computer Science
This is cs50x.
An introduction to the intellectual enterprises of computer science and the art of programming in an online course from Harvard.
What You'll Learn
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.
The course will be delivered via edX and connect learners around the world. By the end of the course, participants will be able to:
- 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 in a number of languages, including C, PHP, and JavaScript plus SQL, 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
Your Instructors
David J. Malan
Gordon McKay Professor of the Practice of Computer Science, Harvard John A. Paulson School of Engineering and Applied Sciences
Senior Preceptor in Computer Science, Harvard University
CS50 Recommended
"Harvard's Free coding courses are excellent. You need to take them." by Python Programmer. https://youtu.be/WwEcPcfRlD0?feature=shared
"I tried Harvard University's FREE CS50: Introduction to Computer Science course | CS50 review 2020" by Sunny Singh. https://youtu.be/DSA34lhJvw4?feature=shared
"Learn To Code For FREE At Harvard University // CS50: Introduction To Computer Science Review" by Dorian Develops. https://youtu.be/He4jqZ2EjrE?feature=shared
Ways to take this course
When you enroll in this course, you will have the option of pursuing a Verified Certificate or Auditing the Course.
A Verified Certificate costs $219 and provides unlimited access to full course materials, activities, tests, and forums. At the end of the course, learners who earn a passing grade can receive a certificate.
Alternatively, learners can Audit the course for free and have access to select course material, activities, tests, and forums. Please note that this track does not offer a certificate for learners who earn a passing grade.
Have Questions?
Can I enroll in this course if I'm not a programmer? Are there any prerequisites? Learn the answers to these and more in our FAQs.
Course FAQs
Related Blog Posts
Top harvard online courses for recent graduates.
Courses for high school and college graduates looking for their next step.
The Benefits and Limitations of Generative AI: Harvard Experts Answer Your Questions
Harvard experts in education and technology share their thoughts and insights on the impacts of new artificial intelligence and machine learning on education, society, and industry.
Pros and Cons of Big Data
Learn how big data revolutionizes healthcare, public services, education, and social initiatives while addressing challenges like data privacy, implementation costs, and bias.
Introductory Courses for Anything You Want to Learn in 2023
Maybe you’ve wanted to learn something for years and you’ve just never found the chance? We’re here to help you begin on your learning path!
Related Courses
Cs50's introduction to programming with scratch.
A gentle introduction to programming that prepares you for subsequent courses in coding.
CS50's Introduction to Programming with Python
Join Harvard Professor David J. Malan in this online course that will introduce you to programming using Python, a popular language for data science and more.
CS50's Introduction to Cybersecurity
An introduction to cybersecurity for technical and non-technical audiences alike in an online course from Harvard.
Data Science Principles
Data Science Principles gives you an overview of data science with a code- and math-free introduction to prediction, causality, data wrangling, privacy, and ethics.
Data Privacy and Technology
Explore legal and ethical implications of one’s personal data, the risks and rewards of data collection and surveillance, and the needs for policy, advocacy, and privacy monitoring.
If you're seeing this message, it means we're having trouble loading external resources on our website.
If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.
To log in and use all the features of Khan Academy, please enable JavaScript in your browser.
Hour of Code
Computer programming - javascript and the web, computers and the internet, ap®︎/college computer science principles, computer science theory, pixar in a box, intro to computer science - python.
Programming in Java · Computer Science · An Interdisciplinary Approach
Online content. , introduction to programming in java., computer science., for teachers:, for students:.
An operator is symbol that takes one or more values (or expressions, in programming jargon) and yields another value (so that the construction itself becomes an expression) [2] .
There are many different types of operators, but the ones we primarily concern ourselves with are boldfaced below. If you'd like to learn more about different types of operators in PHP, please click here .
- Operator Precedence
- Arithmetic Operators
- Assignment Operators
- Bitwise Operators
- Comparison Operators
- Error Control Operators
- Execution Operators
- Incrementing/Decrementing Operators
- Logical Operators
- String Operators
- Array Operators
- Type Operators
- 1 Assignment operators
- 2 Arithmetic operators
- 3 Comparison operators
- 5 The way the IB wants you to use operators
- 6 Python operators cheatsheet
- 7 Standards
- 8 References
Assignment operators [ edit ]
An assignment operator assigns a value to its left operand based on the value of its right operand. [3]
Arithmetic operators [ edit ]
Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value. The standard arithmetic operators are addition (+), subtraction (-), multiplication (*), and division (/). [4]
An example of some arithmetic operators in PHP can be found below [5] .
An example of some arithmetic operators in Python can be found below [6] .
Comparison operators [ edit ]
Comparison operators, as their name implies, allow you to compare two values. [7]
An example of some conditional operators in PHP can be found below [8] .
An example of some conditional operators in Python can be found below [9] .
A video [ edit ]
This video references the C programming language and scratch, but the ideas about operators are excellent. In the case of conditionals, PHP and C share similar syntax (but not exact).
The way the IB wants you to use operators [ edit ]
Please know all code submitted to the IB (with the exception of object oriented programming option) is in pseudocode . The way we write operators in pseudocode is different than the way we might write them in the real world.
Click here to view a file describing approved notation, including pseudocode This is the approved notation sheet from the IB.
Below is a graphic that is taken from the above PDF file to help you understand how the IB wants operators to look.
Python operators cheatsheet [ edit ]
Click here for an excellent python cheatsheet
Standards [ edit ]
- Define the terms: variable, constant, operator, object.
- Define common operators.
- Analyse the use of variables, constants and operators in algorithms.
References [ edit ]
- ↑ http://www.flaticon.com/
- ↑ http://php.net/manual/en/language.operators.php
- ↑ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators
- ↑ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
- ↑ http://php.net/manual/en/language.operators.arithmetic.php
- ↑ https://www.geeksforgeeks.org/basic-operators-python/
- ↑ https://www.php.net/manual/en/language.operators.comparison.php
- ↑ http://php.net/manual/en/language.operators.comparison.php
A natural number, a negative of a natural number, or zero.
anomalous or exceptional conditions requiring special processing – often changing the normal flow of program execution
Give the precise meaning of a word, phrase, concept or physical quantity.
Break down in order to bring out the essential elements or structure. To identify parts and relationships, and to interpret information to reach conclusions.
- Computational thinking
- Programming
- Overview of Eckerd
- Directions & Map
- Diversity & Inclusion
- Sustainability
- COMMUNITY ENGAGEMENT
- Civic Engagement & Social Impact
- For the Public
- HISTORY & LEADERSHIP
- Mission & History
- FACTS & FIGURES
- A “College That Changes Lives”
- Common Data Set/Fact Sheet
- Economic Impact
- Organizational Chart
- Student Achievement
- Student Consumer Data
- Value of Liberal Arts
- Academics Overview
- LIBERAL ARTS EDUCATION
- Autumn Term
- Faculty Mentors
- Human Experience and First-Year Experience Seminar
- Reflective Service Learning
- Senior Capstone
- Speaker Series
- Writing Excellence
- MAJORS & MINORS
- WAYS TO REALLY EXCEL
- Ford Apprentice Scholar Program
- First-Year Research Associateships
- Honors Program
- Honor Societies
- Peace Corps Prep
- Tutors, Academic Coaches & Centers
- GLOBAL EDUCATION
- Admissions Overview
- Financial Aid and Scholarships
- Meet Your Counselor
- Request More Info
- Plan a Visit
- Virtual Tour
- International
- Explore Eckerd Days
- New Student Guide
- Campus Life Overview
- Health & Wellness
- Housing & Pet Life
- Inclusive Student Engagement
- International Life
- Religious Life
- Student Orgs
- Club Sports & Intramurals
- Recreation Facilities
- South Beach
- VOLUNTEER & WORK
- Career Center
- Emergency Response Team
- Search-and-Rescue
- Service Learning
- Give & Engage
- CAMPUS – Directions & Map
- About – Diversity & Inclusion
- CAMPUS – Sustainability
- COMMUNITY – For the Public
- FACTS – A “College That Changes Lives”
- FACTS – Common Data/Fact Sheet
- FACTS – Economic Impact
- FACTS – Org Chart
- FACTS – Student Achievement
- FACTS – Student Consumer Information
- HISTORY & LEADERSHIP – Mission & History
- HISTORY & LEADERSHIP – President
- HISTORY & LEADERSHIP – Traditions
- Value of the Liberal Arts
- Global Education
- Majors & Minors
- Apply – First-Year Applicants
- Apply – International Applicants
- Apply – Transfer Applicants
- Apply – FAQ
- Enroll – Deposit
- Enroll – Explore Eckerd Days
- Enroll – New Student Guide
- Financial Aid & Scholarships
- Visit – Plan a Visit
- Visit – Virtual Tour
- Live – Dining
- Live – Health & Wellness
- Live – Housing & Pet Life
- Live – Inclusive Student Engagement
- Live – International Life
- Live – Religious Life
- Live – Student Orgs
- Live – Sustainability
- Play – Club Sports & Intramurals
- Play – Recreational Facilities
- Play – South Beach
- Play – Waterfront
- Volunteer & Work – Career Center
- Volunteer & Work – Emergency Response Team
- Volunteer & Work – Search & Rescue
- Volunteer & Work – Service-Learning
Computer Science
- Sample Assignments
In addition to the flexibility which comes from the breadth of the computer science discipline, the computer scientist has a wide range of career options. Generally, careers that focus on the development of applications and specialized software for business and scientific areas require the Bachelor of Science or Bachelor of Arts degree. With either degree, students are prepared for employment immediately after graduation. Students with an interest in the development of computer systems, including hardware and major software, will find that the Bachelor of Science degree provides a firm foundation for a career that may require a Master of Science degree and result in employment by a major computer manufacturer. A student hoping to perform advanced computing research or to be a university professor will find that the Ph.D. degree is essential.
The depth, breadth and flexibility of the computer science program includes the ability to apply classroom knowledge to real world projects as part of independent study, directed projects and regular classroom requirements. The following are a sampling of the recent projects students have been involved with
Video Game Creation
Students worked in groups for their final project to create a video game using Java Swing libraries. The project allowed them to apply their knowledge of data storage and organization to a real world software project, and produce readable documentation for a developer. Below are a couple of the projects: Snake, BlackJack and Pong:
Interactive Graphical User Interface
In a recent independent study, a senior computer science major developed an interactive graphical user interface (GUI) for molecular dynamics simulations. His GUI could visualize a molecule using three views while stepping through a simulation and checking results. The GUI was built with the TKInter libraries for Python, while the simulation was executed by the open source MDLab (mdlab.sourceforge.net) software.
Biology and the Game of Life
This course offered students a hands-on atmosphere for applied computing in the biological sciences and mathematics. By running simulations of biological cells using Conway’s Game of Life and the Cellular Potts Model (CPM), students study how the application of simple mathematical rules to behavioral entities result in patterns similar to those observed in nature. In the screenshots below, student projects captured foam bubble dispersion, cell sorting analogous to those in the eye, and the slime mould Dictyostelium Discoideum using CompuCell3D which runs the CPM:
Computer Architecture
Students explored the internal hardware of a computer and for their final project create a machine which can add two numbers using (shown below) breadboards, logic gates and LEDs. The LEDs illuminate to show the result of the addition.
Graphical User Interface Design
Students explored the various design issues which affect the appearance of a graphical user interface and provide the means by which a user may communicate with the underlying applications software, realizing that good design facilitates effective communication. Graphical user interface features such as mouse interaction, menus, dialog boxes, tool bars, error messaging and direct manipulation are evaluated and implemented.
In this particular assignment, students were asked to create simple word processing application in Java, using traditional GUI components, such as menus, dialog boxes, sliders, etc., from the Java Swing GUI widget toolkit.
Computer Graphics
Students were introduced to the theory and programming issues involved in rendering graphic images. Theory includes the physics of light and surfaces, surface illumination equations, and algorithms for rendering scenes using ray tracing. Visual surface algorithms, 3D viewing transformations and projections, anti-aliasing, 3D model transformation, illumination models, texture mapping, animation, and interactive graphic techniques are also presented.
In this assignment, students were asked to create an animation using a number of graphic objects, with one object demonstrating an attempt to model a real world object as accurately as possible. Object shape and surface properties, such as reflectance and texture, were chosen to realistically model the object. Another object had its surface appearance based at least partially upon the use of a two dimensional “texture” map. The project also demonstrates an object based animation as well as a camera based animation.
Evolutionary Computation
Students were encouraged to envision and implement projects in evolutionary computation that are of research level quality. Here is a sample student project, which after additional research and review led to a peer-reviewed publication at a major conference.
Project Title: Communication as a Model for Crossover in Genetic Algorithms
Abstract: We have created an evolutionary model of multiple ant colonies searching for a resource using swarm intelligence and a modified genetic algorithm. In place of the standard crossover we have employed a modified crossover which models communication; we call this a communicative GA (CGA). The communicative crossover operation sums up the moves of the most fit and least fit chromosome. The most frequent high move and low move are selected for altering. For each chromosome, the lowest move is changed into the highest fit chromosome’s most frequent allele. Statistics were recorded in each generation, including; max fitness, min fitness, the average fitness, the average number of generations it took to reach the resource, and the percent of variation of fitness. The statistics were compared to the same model implemented using a standard GA with a crossover.
Our model simulates N different ant colonies competing for one resource. We used N=4 colonies for our experiment. For illustrative purposes we have created a square shaped habitat. The ants’ path towards the resource originates from the colony and the ants may not go off the edge as seen in Figure 1. Six circular tiers were placed radiating outward from the resource representing some indicating factor from the resource. These tiers are used to calculate the fitness of each individual.
Creation of an Expert System
Students use an expert system shell to create expert systems in an area of their choice. Some of the most remarkable Expert Systems created include:
- Advising system for purchasing a boat
- What to do when a hurricane approaches
- Restaurant recommendation system
- Recommendation system for computer games
- Football head coach
- Academic Adviser
- Automobile troubleshooting system
- Recommendation system for music studio equipment
- Surf adviser
- Recommendation system where to spend your vacation
- Kelly R. Debure
- Michael L. Hilton
- Holger Mauch
- Why Computer Science at Eckerd College
Quick Contact
Dr. Kelly Debure Professor of Computer Science MPC 208 [email protected] 727-864-7749
St. Petersburg, Florida 33711 800.456.9009 or 727.867.1166
Accessibility | Directory | Campus Map | MyEckerd Portal | Nondiscrimination | Privacy | Reporting Mechanisms
IMAGES
VIDEO
COMMENTS
Assignment (computer science) For assignment of letters to disk file systems, see Drive letter assignment. 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 ...
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 ...
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.
Assignments. pdf. 98 kB Getting Started: Python and IDLE. file. 193 B shapes. file. 3 kB subjects. file. 634 kB words. pdf. 52 kB ... Computer Science. Programming Languages; Download Course. Over 2,500 courses & materials Freely sharing knowledge with learners and educators around the world.
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. Today, the most commonly used notation ...
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.
Computer science is an interdisciplinary field focused on studying computers and their uses in the real world. As a result, the field of computer science focuses as much on the theoretical underpinnings of computers as it does their actual uses and creation. Some common areas of study within the field include designing and applying computer ...
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.
Community questions. Learn AP Computer Science Principles using videos, articles, and AP-aligned multiple choice question practice. Review the fundamentals of digital data representation, computer components, internet protocols, programming skills, algorithms, and data analysis.
Assignment (computer science) In the context of programming and computer science, an assignment operator is a symbol or operator used to assign a value to a variable. It is a fundamental concept in most programming languages. It is used to store a value in a variable so that it can be manipulated and used in computations later in the code.
Computer science is the study of computers and how they work, including software, hardware, and algorithms. An algorithm is a list of instructions for completing a task. In computer science, an algorithm tells the computer what to do and how to do it. Computer science is an umbrella term that covers everything from artificial intelligence and ...
Intro to computer science - Python. Computational thinking with variables. Designing algorithms with conditionals. Simulating phenomena with loops. Playing games with functions. Learn how to code computer programs, how to design algorithms that make computers more efficient, and discover what a career in computing could look like.
computer science, the study of computers and computing, including their theoretical and algorithmic foundations, hardware and software, and their uses for processing information. The discipline of computer science includes the study of algorithms and data structures, computer and network design, modeling data and information processes, and ...
Programming assignments. Creative programming assignments that we have used at Princeton. You can explore these resources via the sidebar at left. Introduction to Programming in Java. Our textbook Introduction to Programming in Java [ Amazon · Pearson · InformIT] is an interdisciplinary approach to the traditional CS1 curriculum with Java. We ...
Computer science is the study of computation, information, and automation. Computer science spans theoretical disciplines (such as algorithms, theory of computation, and information theory) to applied disciplines (including the design and implementation of hardware and software).. Algorithms and data structures are central to computer science. The theory of computation concerns abstract models ...
Welcome to Introduction to Computer Science, CS111. In this course you will be introduced to fundamental concepts in programming. After completing the course the student will be able to: Design algorithmic solutions to problems. Develop, implement, test, and document program code. Analyze program code for correctness, efficiency, equivalency ...
Assignment 1. Pseudocode (40 points) Write and evaluate algorithms, and count the number of operations executed. January 26. February 2 at 11PM. Canvas → Gradescope. Assignment 2. Hello, World (30 points) Install VScode, write a few short Java programs and submit through our automated grader called Autolab.
Version 3.0 Exploring Computer Science Page 5 Course Overview Goals Exploring Computer Science is designed to introduce students to the breadth of the field of computer science. The goal of Exploring Computer Science is to develop in students the computational thinking practices of algorithm development, problem solving and programming within the context of problems that are relevant to
Version: 2018-05-31. An assignment report for a course in the Queen's University School of Computing should be written in the general format and tone of an article in a peer-reviewed journal. There are at least hundreds of style guides that provide extensive and detailed information; a useful technical guide is published by the Institute of ...
Programming basics [1] An operator is symbol that takes one or more values (or expressions, in programming jargon) and yields another value (so that the construction itself becomes an expression) [2]. There are many different types of operators, but the ones we primarily concern ourselves with are boldfaced below.
Variables. is a named piece of memory that holds a value. The value held in a variable can - and usually does - change as the program is running. A variable's name is known as an identifier. The ...
An assignment report has the structure of a typical scientific article: a preamble, an introduction, a description of the methods, the main results, a discussion of the results, and references. The preamble material is the title, author, and an abstract of the report. The introduction, for an assignment report, is usually short and factual.
Here is a sample student project, which after additional research and review led to a peer-reviewed publication at a major conference. Project Title: Communication as a Model for Crossover in Genetic Algorithms. Abstract: We have created an evolutionary model of multiple ant colonies searching for a resource using swarm intelligence and a ...