Lec 1 Flashcards

1
Q

What is a computer

A

A computer is machine that can be programmed to carry out a wide variety of task

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

What is a program

A

A program or software is a set of instructions the computer follows to perform a task

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

What is a programmer

A

A programmer is someone trained to test computer programs

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

What is hardware

A

All the physical devices that make up a computer
-Note a computer is not a single device but a system of devices that work togther

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

What type of hardware makes makes up a computer and how you interact with them

A

Central Processing unit-Processes information, “the computers brain”

Main memory-RAM

Secondary Storage-disk, drive, ss, drives, usb, CDS, floppy disk(Physical memory)

Input devices-mouse, keyboards,microphones, webcame

Output devices monitor, printers, disk drives

Cell phone-listen to music through speakers

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

What can a computer do without software

A

A computer can’t do anything without software

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

How do computers store information digitally

A

Computer store information digitally into units of bits and bytes. Bytes are storage locations, where each byte can be stored.

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

What is a bit

A

A bit is a binary digit and 8 bits per bytes
-Switches on is 1 and switched off is 0

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

How to count in Binary
01101100
represent 115

A

bytes 1 is 2^15——–2^8
bytes 2 is 2^7——–2^0

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

What is the largest number that can be stored on one bytes

A

it is 255 because because add all the solutions of 2 ^x togather get you to 255

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

8516 is a decimal represented as

A

00100001 01000100
2^13–2^8–2^6—-2^2=8516

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

What is ASCII

A

The American standard code for information is a systems developed to represent text information

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

How does ASCII work

A

Each letter is case sensitive, and is assigned a decimal value and that gets converted and stored as binary values that the computer can undertsand and work with

Example
Binary-01000001
Decimal 65
Character is A

Binary-01100001
Decimal 95
Charavter a

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

How do program work

A

Computer store information i binary and the the central processing unit can only understands in 1 and 0’s called machine language

Example machine language input is 100110000 may tell computer to move values from storage to memory

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

What cpu can and can’t do

A

CPU’s can only perform simple task(add, subtract, divide, move from memory to storage, store, compare and programs in machine language are thosand of lines long ,so you need assembley language

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

What is assembly language

A

It was written in response to CPU only doing simple task but we have long lines of code.

Assembly language is one of the oldest programming languages. It is characterized by add, mul, mov

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

What does assembly language do

A

An assembler will translate assembly language into machine language, so the computer can execute the program .Assembly is low level language because it is extremely simple and close to machine language

Assembler language(add, mul, mov) to assembler to Machine language(binary)

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

What his high level language

A

High level language allows complex programs to be written without needing to know machine language-MatLab, CTT, CLT, JAVA, python,SQL
Each language has it own syntax

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

What is high level language syntax

A

They are rules that must be followed in order to write a program(like grammatical rules in language)Syntax indicates key words, operators, and punctuations can be used

Example:Like in Mat lab “NOT” is a wavey line but in CTT or Java… its !

20
Q

What is an compiler

A

A compiler takes the entire program written in high level language, and translate it to machine language so the computer can understand it
-The language version of the program is executed in a separate step and the compiler give those machine language instructions to the CPU
-A program in compiler language will not work with errors of bugs

21
Q

What are the two catagoies for high level language

A

Compiler or Interpreter language

22
Q

What is an interpreter language

A

An interpreter take a high level program line by line and translates it into machine language so the computer can understand it

The interpreter is also executing the machine language program immediately(line by line as translated) and provides the machine language instructions to the CPU
An interpreter will run the program line by line until an error is found and then it will stop

23
Q

How to design a program

A

A computer must be programmed to achieve a set of task. A programmers will typically use high level language. They never start code right way but create a design of the program.
Even though each program language has it own syntax- the logic and flow of information stays the same

24
Q

Program development design

A

It is continuous refinement and maintenance process
1.Requirment analysis(User need)
2.Program Design stage(Map solution)
3.Implementation(Do)
4.Documentation and Testing(Write down who fixed or designed)
5.Operation and Maintenance(Revise solution and future maintenance)

25
Q

WHAT stage of Program development design cycle is most important and why

A

Stage 1:the requriment anaysis stage serves a a solid foundation for the design of the program and consists of 2 major steps

1.Understand the task the program must perform(by collect information from user

2.Determine the logical sequences of steps that must be taken in order to perform the task by generated a algorithm and flowchart

What a programmer does
1.Work directly with client to agree program requirement were met
2.Porgrmmer will create algoritem-Set od well- defined logical steps requried to perfrom a task(Baking recipes)

26
Q
A

Terminator – used to denote the start
and end of a flowchart/program
(Start)

Input/Output – used to denote any
instance where the program gets input
from the user or displays output to the user
/_Display____/

Process – used to denote any general
process or operation performed on the
data
[Solve] or [Calculate]

Module – used to denote any user-
defined subroutine or user-defined
function
[ Call|]

Decision – used to denote the start of a
decision structure or conditional
statement(Make a choice)

Diamond(arrow down, arrow true to the right out)
On-Page Connector – used to connect
between flowchart segments that are
located on the same page (A in a circles with down arrow on top)(A in a circles with down arrow at the bottom)

Off-Page Connector – used to connect
between flowchart segments that are
located on separate pages(upside-down pentagon with down arrow on top both pages) but slightly different

Arrow – used to denote the flow of
data in a program from one symbol to
the next(right arrow)

27
Q

Algoritm for circufernces of a circle

A

1.Measure the diameter of a circle which is a line that goes from one side of the circle tot he other
2.Multiply by Pi

28
Q

Generate flow chart for circumferences

A

Start-(______)
1.Get radius from user-/_Input____/
2.Set d=2* radius[}
3.Set c=d*pi-[]
4.Display answer to user /_Display____/
End

29
Q

Make algorithm for 3x^2=-6x-9

A

1.Add -6x+9 to both sides
2.Solve for x using (a=3, b=6, c=9)
3.Solving/ Claculating is a process
4.Display answer to users

start-
rectangles-Add (6x+9)
Solve for x=-b
Solve for x^2+ib-
Display first root “x”
Display second root ^2
End

30
Q

What is a variable is programming

A

A varibel is a a storage location inthe computer memory like radius =5 or x=2.7 or pi=3.1416

31
Q

What does a program variable need

A

name
data type
values

32
Q

What program variables have or don’t have

A

don’t have spaces
don’t have special characters except underscores
it can’t start with a number but a letter

33
Q

What is data types

A

When creating a variable you must decide the type of information that can be stored and mismach variable values and data type leads to error

Integer-Whole numbers, no fractions or decimal values(3,-7)

Real or Float-Real numbers (fractions and decimals), floating-point(3.1416,36.4)

Char or charater-Text info, single characters, anything that can be entered on a keyboard like initial ‘A’

String-Text info, a sequence of characters(“bob”

Bool-Logical variable, can only hold the value TRUE
(1) or FALSE (0(is open=false)

34
Q

What is the data type

A

3-integer
‘3’-char
3.0-float/real
“3.0”-String

35
Q

What is the problem in

1Display “What is your favorite type of food?”
2Input favorite Food
3Display “The user’s favorite food is: “
4Display “favorite Food”

A

Its the space in favorite food in line 2
Its the “” in line 4

36
Q

What is the differences between 3 and 3.0

A

they are different between 3 and 3.0 because they are represented differently in binary
3 is 00000011
while 3.0 is has an indicator at the beginning that the exponents are multiplied by

37
Q

Step 1:Requriment Analsysis

A

break down larger problem into algorithmn-they are sequences of logical well-deifned steps that must be executed in order to accomplish the task
-must be communicated step by step
-algorithmns turn into flowcharts
-graphically repsent flow of infromation thru program help visualize the structure

38
Q

Step 2 :Program design Stage

A

Teh alogirthm is step by step instrtcuion and the flow charts is a map showing the flow of information throughout your program

In stage 2 the programmer will use the flowchart to make a more dtailed blueprint of the program called peusudo code

39
Q

What is Pseudocode

A

Pseudocode is an informal language that does not have syntax code.
- it is not executable
-it is used before the actual code is written
-they don’t worry about grammer, punication or speicifc deyails but design content, and form of program

It goes from pseudcode to highlevel language like python or matlab

40
Q

Pseudo code what is your age

A

Declare Integer age
Display “What is your age?”
User Inputs age
Display “Your age is”,age

41
Q

Pseudocode -Declare

A

You create a varibel and assign a data type
(Delcare Real num, date, temperature, name 1

42
Q

Pseudocode -Display

A

“Prompt user”“Get from user” “show”
(Display “Todays date is”, date

43
Q

Pseudocode -Input

A

STore into/ vlaue a variable

(Display “Please enter a number”)
(Input num)

44
Q

Pseudocode -set

A

A.Initial vlaue of variable or assign a result of calc, fxn to a variable

Set counter=0
Set isFinished=Flase
Set

45
Q

Pseudocode -call

A

call module

46
Q

Write the pseudocode for area of a circle

A

Declare Real area
Declare Integer Radius
Display “Enter radius:”
Input( Radius^2)*3.1416
Display “Area is”, area

47
Q

Wriete a

A