Giter Club home page Giter Club logo

cpp4python's Introduction

C++ for Python Programmers

This short ebook is intended to make it easy for anyone with at least some background in Python to transition to programming in C++.

Portions of this book began as Java for Python Programmers by Brad Miller. These sections were translated to C++ by Jan Pearce and a team of excellent Berea College students in 2018 and early 2019. Other portions of this book began as web pages written by Jan Pearce as support for a Berea College C++ programming class. Still other sections were newly written by Jan Pearce for this ebook.

Special acknowledgement is due to Jesse Walker-Schadler who while just a student in the Berea College Data Structures course had a vision of making graphics in C++ as easy as they are in Python both in terms of both syntax and installations. Over the course of two summers, he realized this vision with the creation in the open source CTurtle library which provides all of the C++ interactive graphics in this textbook.

How to use and suggest changes to this book

Licensing

Creative Commons License
C++ for Python Programmers by Jan Pearce and Brad Miller is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

cpp4python's People

Contributors

auenc98 avatar bnmnetp avatar codywmitchell avatar commentandconquer avatar conceptanjolima avatar conzty01 avatar demekenega avatar eno93 avatar gaaaavin avatar geisler avatar giolomia avatar grrdsoto avatar hamzaktk18 avatar isaacdontjelindell avatar martinjoh1 avatar mccoyd15 avatar moisedk avatar pearcej avatar runestonetest avatar rustydotson avatar tahmidefaz avatar walkerje avatar whitfordr avatar williamjsdavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cpp4python's Issues

Ensure proper references to the Python "turtle" library.

There are multiple occasions throughout the chapter where the Python "turtle" library is referenced with a plural noun and similar issues. They need to be made uniform throughout the chapter, e.g, just "turtle", SANS QUOTES.

Checkpoints across chapter 6 (cpp4python-v2)

All parsons problems, active codes, and matching problems across Chapter 2 are in checkpoint. Instead, they should be labeled as reading questions or exercises, and the active codes should be without checkpoints.
image
image

T/F question grammar problem

In this question:
Q-4: T/F: It is necessary to have an else statement after an if statement?
It should read as the following because it is not a question:
Q-4: T/F: It is necessary to have an else statement after an if statement.

Typo in Section 2.3

After the last code activity in Section 2.3, this statement is made

The declaration int theSum = 0; creates a variable called theSum and initializes it to hold the data value of 0.

theSum is initialized to a value of 4, not 0.

Section 3.2 Q1 error

The output of the function in Q1 in section 3.2 should be "Hello, world0" infinitely many times because the instruction is:
cout << "Hello world" << counter << endl;
Therefore, NONE of the answers given is correct, so option D is correct. Either fix option C or change the correct answer.

Typo in answer for Q-13

In Section 1.6, the answer for Q-13 states

The correct statement would be "cout << x;" or "std:cout x;" but the insertion operator is certainly needed.

The << is missing from the second example. I.e., the answer should read

The correct statement would be "cout << x;" or "std:cout << x;" but the insertion operator is certainly needed.

Checkpoints across chapter 2 (cpp4python-v2)

All parsons problems, active codes, and matching problems across Chapter 2 are in checkpoint. Instead, they should be labeled as reading questions or exercises, and the active codes should be without checkpoints.
image
image

Problem with cin in section 1.4.6

The interactive part for section 1.4.6, which refers to a replit sourced iframe, (looking at the HTML source) does not work when using incognito mode. It looks like this;
image

Clarify make_neat file in 6.6. The End-Of-File (EOF)

Students find make_neat() confusing because they are not looking at the files. Before this interactive code segment, add non-interactive code blocks (using ::) into the make text of the book that better describe the goal of the code by showing how to code looks beforehand in one block and afterwards in another.

Functions/glossary

has a couple of problems:

  • used the term reference instead of pointer.
  • discussed classes which are not referenced at all in this textbook

Section 3.3 typo

After the code activity in section 3.3, the sentence "In the example above, the hello world! statement is executed 10 times." should not have an exclamation point after "world".

3.3. For Loops uses collections

Section 3.3. on For loops uses arrays and vectors before these are introduced. Do the following:

  1. Move all of the examples that use arrays and vectors to the collections chapter
  2. Create new for loop examples that do not leverage collections.

Mistake in Q-12

Here's the link: https://runestone.academy/ns/books/published/cpp4python/IntroCpp/firstcppprogram.html#summary

The question reads "Q-12: True or False: Both Python and C++ support multi-line comments. In C++, they begin with /* and end with */."

According to the programmed answer, it is False because "Sorry, both languages do support multi-line comments, but they look different.", but the question doesn't imply that multi line comments in Python start with /* and end with /, it only states that "In C++, they begin with / and end with */" which is true.

Proposed solution: Either change the wording of the question (e.g. remove "In C++,") or change the solution.

Checkpoints across chapter 4 (cpp4python-v2)

All parsons problems, active codes, and matching problems across Chapter 3 are in checkpoint. Instead, they should be labeled as reading questions or exercises, and the active codes should be without checkpoints.
image
image

2.5.1.1. Image and code not coordinated - confusing!

Figure Figure 2.3 has a 9 in varN. This is good.

However, the code snippets put a 100 into varN. This is confusing. Change the value of varN to 9 to better coordinate with image. (This needs to be changed in at least 2 places.)

ActiveCode (cturtle_practical_example_cpp) bugs

I LOVE the idea of this example!
ActiveCode (cturtle_practical_example_cpp) has a few bugs. It timed out with the loop set to 8. It also is not showing the whole graphics window. Maybe restrict the tiling to a smaller area of the graphics window?

Typo in Section 2.5.3

In Section 2.5.3 of the book, there is a typo in the first code block (line 703 in /_sources/AtomicData/AtomicData.rst):
cout << "Pointer ptrx points to " << &ptrx << endl;
This line prints the address of ptrx, instead of the address it points to.

I believe the correct version should be
cout << "Pointer ptrx points to " << ptrx << endl;
as in pull request #105.

Please let me know if I'm correct. Thanks

Remove Replit uses in Chapter 6

Refer to the Runestone Author Guide to see how you may actually allow for "dummy" files to read from using the :datafile: directive. Replace with ActiveCode examples.

Checkpoints across chapter 5 (cpp4python-v2)

All parsons problems, active codes, and matching problems across Chapter 5 are in checkpoint. Instead, they should be labeled as reading questions or exercises, and the active codes should be without checkpoints.

image
image

Checkpoints across chapter 3 (cpp4python-v2)

All parsons problems, active codes, and matching problems across Chapter 2 are in checkpoint. Instead, they should be labeled as reading questions or exercises, and the active codes should be without checkpoints.
image
image

Fix Typos on 8.4 and others throughout chapter

Following the original pull request for the chapter, I've noticed some instances of typos throughout the chapter. Specifically, on 8.4, the second sentence has a typo. I'm sure there are others.

pdf format for the book

First of all this is a great book. Thank you for this resource. Is there a way to get a pdf for this book, so that it can be printed?

Chapter 2 summary missing self-check questions (cpp4python-v2)

The summary section in Chapter 2 needs to include self-check questions; as we can see in the following pictures on the old version of the book, the summary section have some self-check questions, but on the new version of the book, that is missing.
image

Typo in text for section 2.5.2

The word "asterisk" in the sentence" WARNING: What happens if you forget the asterisk when assigning a value to a pointer and had the following instructions instead?" should be "ampersand":

 WARNING: What happens if you forget the ampersand when assigning a value to a pointer and had the following instructions instead?

Long Matching problem in 1.5 (cpp4python-v2)

In introcpp_introcpp_intro-cpp_glossary.ptx, the matching problem is very long. It is hard to do it simultaneously since the matching problems are not dynamic. As a student who uses the book, I found solving one problem at a time hard. If it is divided into three parts, it will be easy.
image

Pointer chapter activity 13 incorrect

Activity 13 in the pointer chapter is supposed to demonstrate a dangling pointer, but the pointer is not dangling. This needs to be "fixed"... i.e. it needs to be broken.

Activity 3 Drag-N-Drop issues

Activity 3 Drag-N-Drop (cturtle_dnd_1) in turtle_and_turtlescreen is too long. I recommend breaking into 2 or 3 exercises that are coherently separated. On my Berea College laptop I literally cannot get to the bottom of the huge list. Also, there are two turn to the lefts and no turn to the right...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.