1 of 22

Engineering Profession

2 of 22

3 of 22

What is Computer Engineering?

Designing, constructing, implementing, and maintaining software and hardware components of modern computing systems and computer-controlled equipment.

4 of 22

Salary for Computer Engineers

  • Average Entry Level Salary: $75,953

  • Average Annual Salary: $136,230

  • Top 10% Average Salary: $208,000

Source: payscale.com (May 2022), National Occupational Employment and Wage Estimate (May 2021), and United States Department of Labor (May 2021)

5 of 22

1987

System

IBM PC/AT

Apple iPhone 14

Cost

$2000

$795

Form factor

½ desktop

handheld

CPU

12 MHz 80286

2x3.23 GHz

Memory

512KB

128GB 6GB RAM

Storage

20MB hard disk, 1.2MB floppy

128 GB

Display

80x25 monochrome text

6.1 inches wide color P3

Peripherals

Keyboard

2 cameras, phone, video, wi-fi

Connectivity

1200 baud dialup modem

Cellular, wireless

2022

Computers

Then & Now

6 of 22

7 of 22

Python Programming Language

Vocabulary and set of grammatical rules

for instructing a computer

to perform tasks

(Syntax)

8 of 22

Python

  • Emphasizes code readability with the use of significant indentation.
  • Companies that use Python are Spotify, Facebook, Netflix, Quora, Dropbox, Instagram, and Reddit.

9 of 22

Python Basics

  • Can execute by writing in the command line
  • Indentation to indicate a block of code
    • use the same number of spaces in the same block of code
  • Variables created when assigned a value
    • no command for declaring a variable
  • Comments start with a #

10 of 22

Python Fundamentals

  • Variables and Functions
        • Mechanisms used to solve small problems but can be combined to solve larger problems.
  • Conditionals
        • If the answer to the question is true, one solution; If the answer to the question is false, another solution.
  • Loops
        • Perform an action again and again and again.
  • File Input/Output
        • Read and load information from files; write and save information to files.

11 of 22

Variables

    • Storage containers for data values.
    • No need to declare with any type and can change type.
    • Declare string variables by using single or double quotes.

Naming Rules

    • Must start with a letter or the underscore character
    • Cannot start with a number
    • Can only contain alpha-numeric (A-z, 0-9 ) characters and underscores (_)
    • Case-sensitive (age, Age and AGE are three different variables)

12 of 22

File Input/Output

  • Open() function opens files for reading, appending, writing, and creating.
    • Two parameters needed: filename and mode.
        • Four different methods (modes) for opening a file
          1. "r" - Read - Default value. Opens a file for reading, error if the file does not exist
          2. "a" - Append - Opens a file for appending, creates the file if it does not exist
          3. "w" - Write - Opens a file for writing, creates the file if it does not exist
          4. "x" - Create - Creates the specified file, returns an error if the file exists

13 of 22

Python First Program

  • Create Python folder in Documents folder.
  • Download python executable: python-3.11.0_amd64.exe (https://www.python.org/downloads/); release date – Oct. 24, 2022; select Recommended file.
  • Open .exe file and select Customize Installation
  • Click Next. Click Browse. Select Documents\Python. Click OK. Click Install. Click Close.
  • Download code text editor, Notepad++ (https://notepad-plus-plus.org/downloads/v8.4.7/); Download 64-bit x64. Double-click to open. Follow prompts.
  • Use windows search bar to find “Manage app execution aliases”
  • Turn App Installer for python.exe off
  • Use windows search bar to find “Control Panel”
  • Navigate to System and Security>System>Advanced system settings>Environmental Variables>Path>Edit>New>your python.exe path(C:\Documents\Python\)>OK>OK>OK
  • Use windows search bar to open “CMD”
  • Type path
  • Type cd Documents\Python\
  • Open Notepad++
  • Create hello.py code – See separate document (hellocode.txt) make edits and save in Documents\Python directory
  • In CMD window type python hello.py.
  • Send me your output file in Blackboard or email.

14 of 22

Functions

  • Block of code which only runs when called.
  • Can pass data (arguments) into a function.
  • Can return data as a result.

Usage Rules

  1. Define with the keyword – def.
  2. Call by using the function name followed by parenthesis.
  3. Place arguments after the function name, inside the parentheses.
  4. Add unlimited number of arguments (separate with a comma).

15 of 22

Python Second Program

  • Open Notepad++
  • Create favoritefood.py code – See separate document (favoritefoodcode.txt), make edits and save in Documents\Python directory
  • In CMD window, navigate to Python directory
  • Type python favoritefood.py.
  • Send me your output file in Blackboard or email.

16 of 22

Conditionals

  • If statement written by using the if keyword.
  • elif keyword used to say "if the previous conditions were not true, then try this condition".
  • else keyword catches anything which isn't caught by the preceding conditions.

Logical Operators

  • and Returns True if both statements are true
  • or Returns True if one of the statements is true
  • not Reverse the result, returns False if the result is true

Main Assignment Operator

= Assigns a value to a variable

17 of 22

Conditionals

Comparison Operators

+ Addition

- Subtraction

* Multiplication

/ Division

% Modulus (remainder)

** Exponentiation

== Equal

!= Not equal

> Greater than

< Less than

>= Greater than or equal to

<= Less than or equal to

Arithmetic Operators

18 of 22

Python Third Program

  • Open Notepad++
  • Create favoritenumber.py code – See separate document (favoritenumbercode.txt), make edits, and save in Documents\Python directory
  • In CMD window, navigate to Python directory
  • Type python favoritenumber.py to run program.
  • Send me your output file in Blackboard or email.

19 of 22

Loops

  • While
      • Execute a set of statements as long as a condition is true.
        • Break
          • Stops the loop even if the while condition is true:
  • For
      • Execute a set of statements, once for each item in a list, tuple, set etc.

20 of 22

Python Fourth Program

  • Open Notepad++
  • Create addnumbers.py code – See separate document (addnumberscode.txt), make edits, and save in Documents\Python directory
  • In CMD window, navigate to Python directory
  • Type python addnumbers.py to run program.
  • Send me your output file in Blackboard or email.

21 of 22

Courtesy: Venus Glenn

22 of 22