Mid term project Flashcards

By the end of this unit, you will be able to create flowcharts to design, plan, and write pseudocode for your programs. Understand the concepts of encryption, decryption, and a letter shift algorithm.

1
Q

When writing larger programs, it is often useful to _______ and ________.

A

When writing larger programs it is often useful to break down the task into manageable pieces and make a plan before you even start to write code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Two particular useful tools that programmers will use in this planning process are writing _____ and constructing a _______.

A

Two particular useful tools that programmers will use in this planning process are writing pseudocode and constructing a flowchart. Planning things out in advance with a lot of pseudocode or a flowchart for simple programs may not be necessary. However, with more complex programs, spending some time planning in advance of writing actual code can save you a lot of time as it helps you break down a large program that could be hard to grasp the entirety of into several smaller pieces that are much easier to code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is pseudocode?

A

Pseudocode is just a description with normal words of the various steps that go into an algorithm or your program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Write a pseudocode based on this instruction.
Let’s imagine that we were going to write a program to help a user add numbers together until they tell us to stop.

A

We might write:

Ask the user if they would like to add more numbers

If yes:
Ask them for the next number
Add that number to the running total
Go back to ask the user if they would like to add more numbers

If no:
Print out the sum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are flowcharts and how does it help when writing code?

A

Flowcharts can also be useful for planning and representing how a program will work, though they are visual. To help people understand what everything in our flowcharts means at a glance, there are a number of specific meanings behind different symbols.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the different symbols that are used in flowcharts to plan for how you will code a program?

A

Rectangle but will curve sides on the left and right—> Meaning: this is the start or end of your program (a “ terminal point”).

Rectangle—> Meaning: this represents a process or action (something that changes values).

Triangle at the top + a triangle at the bottom combined to form a shape—> Meaning: this is a decision point where we do different things based on a condition.

Rhombus—> Meaning: This indicates a place where we get put input or provide output.

——> (This arrow indicates the direction in which the program runs.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is encryption?

A

Encryption is the process of translating plain text data (plaintext) into something that appears to be random and meaningless (cipher text).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is decryption?

A

Decryption is the process of converting cipher text back to plaintext.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why do we need to use decryption and encryption?

A

These methods are used to transfer data securely.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Did Julius Caesar use data encryption?

A

Yes. Julius Caesar (100-44 BC) used a simple substitution with the normal alphabet in his government communications. This cipher was not very strong, but in a time when few people read in the first place, it was good enough. He also used transliteration of Latin into Greek letters and a number of other simple ciphers. When Julius Caesar sent messages to his trusted acquaintances, he didn’t trust the messengers. So, he replaced every A with a D, every B with an E, and so on through the alphabet. Only someone who knew the “shift by 3” rule could decipher his messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Data encryption has been widely used throughout history and in present day, so this is a very useful skill to know. Is this statement true or false?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does ASCII stand for and what does it mean?

A

ASCII stands for American Standard Code for Information Interchange, and is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Mode modern character-encoding schemes are based on ASCII, although they support many additional characters. In ASCII, each character has a corresponding integer number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In python, how can you switch between a character and its ASCII value?

A

In python, you can switch between a character and its ACSII value using the functions ord() and chr(). For example:

print(ord(‘a’))
Output:
97

print(chr(97))
Output: a

Consider the following code:
print(ord(‘5’) - ord(‘0’))
Output: 5

This evaluates to 53-48

How well did you know this?
1
Not at all
2
3
4
5
Perfectly