• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/82

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

82 Cards in this Set

  • Front
  • Back

The program development cycle

1. understand the problem


2. plan the logic


3. code the program


4. Use software (compile or interpret)


5. Test the program


6. Put the program into production


7. Maintain the program

1. Understand the problem

Professional computer programmers write programs to satisfy the needs of other, call users or end users. Several pieces of documentation are often provided to help the programmer understand the problem.

2. Plan the logic

During this phase of the process, the programmers plans the steps of the program, deciding what steps to include and how to order them. You can plan them with pseudcode and flowchart. Programmers don’t worry about syntax at this stage.


THIS STEP IS HARDER.

3. Code the program

You write the source code for the program. Only when you choose a language does a programmer need to worry about syntax.

4. Use Software (a compiler or interpreter) to translate the program into machine language

Change the high level programming language to low level machine language.

5. Test the program

You test for logical errors, not syntax errors. Fixing errors is called debugging.

6. Put the program into production.

The organization uses it. This may also mean using the program once. There might be a conversion process in which everyone in the organization switched over.

7. Maintain the program

After it is put into production, necessary fixes are made or updates need to be done.

Computer System

is a combination of all the components required to process and store data using a computer.

What are the parts of a computer?

1. Hardware


2. Software


3. Programs


4. Programming

Hardware

is the equipment or physical devices, associated with a computer. Some examples are keyboards, mice, speakers, and printers.

software

is computer instructions that tell the hardware what to do.

Programs

software, which are instruction set written by programmers.

Programming

is writing instructions.

.Application software

comprises all the programs you apply to a task, such as word processing programs, spreadsheets, payroll and inventory programs, and even games.

System software

comprises the programs that you use to manage your computer, including operating systems such as Windows, Linux, or UNIX

Computer software and hardware accomplish three major operations in most programs. What are they?

1. Input


2. Processing


3. Output

Input

data items enter the computer system and are placed in memory where they can be processed.

(data items)

include all the text, numbers and other raw material that are intered into and processed by a computer.

Processing

Processing items may involve organizing or sorting them, checking them for accuracy, or performing calculations with them.

Output

After data items have been processed, the resulting information usually is sent to a printer, monitor, or some other output device so people can view, interpret, and use the results.

(information)

Then the information is sometimes put in a storage device

(Storage device)

Disc or flash media, it sometimes serves an input because sometimes the information is sent out as input

Programming Language

examples are Visual Basic, C#, C++, or Java. The one used is the one that best fits the task at hand.

Program Code

The instructions you write using a programming language is called program code.

Coding the program

This is what it is called when you are writing the instructions.

Syntax

are rules that govern word usage and punctuation.

Syntax errrors

are mistakes in a language use.

Computer Memory

a computer's temporary storage

Random access memory or RAM

Is a form of internal, volatile memory.

Nonvolatile

permanent storage device, retained even after power is lost

Machine language

computer programming language statements are converted into millions of on and off circuits that are referred to as machine language.

Source Code

programming language statements are called source code.

Object code

machine language statements

compiler or interpreter

Is a piece of software that translates source code into machine code

Binary language

is also known as binary code and it is represented in a series of 0’s and 1’s.

Runs or executed

when a program instruction is ready it

scripting languages

Are typed from a keyboard and saved as text.


NOte Scripting language programs are interpreted line by line each time the program executes, instead of being stored in a compiled (binary) form.

Rules of Order of Operation and Precedence in both mathematical operation and Logical comparisons(1)

Rules of Order of Operation and Precedence in both mathematical operation and Logical comparisons

Rules of Order of Operation and Precedence in both mathematical operation and Logical comparisons(2)

Division and multiplication are the highest and carried out from left to right Then addition and subtraction




So, c * d, then result divided by e,




Answer = a + b + (temporary result just calculated) - f

Functional cohesion

The more the statements contribute to the same job, the greater the functional cohesion of the module. A module that checks the validity of a date variable’s value, or one that asks a user for a value and accepts it as input, is considered cohesive.

Features of Good Program Design (1)

Proper allowance for modularization, proper syntax and the ability to be easily understood by others.

To create good programs

(1) use program comments where appropriate (2) chooses identifiers thoughtfully


(3) strive to design clear statements within your programs and modules


(4) write clear prompts (asking for input) and echo (asking if sure input is correct) input


(5) continue to maintain good programming habits as you develop your programming skills.

The following are part of structured programming (1)

1. A structured program includes only combinations of the three basic structures - (1) sequence, (2) selection, and (3) loop. Any structured program might contain one, two, or all three types of structures.


Each of the structures has a single entry point and a single exit point.

The following are part of structured programming (2)

3. Structures can be stacked or connected to one another only at their entry or exit points.


Any structure can be nested within another structure

Housekeeping

Include any steps you must perform at the beginning of a program to get ready for the rest of the program. They can include tasks such as variable and constant declarations, displaying instructions to users, displaying report and constant declarations, displaying instructions to users; displaying headings, opening any files the program requires, and inputting the first piece of data.

What is a Variable?

Definition: a named memory location of a specific data type, whose contents can vary or differ over time.

How variables are used in the computer system?

Variables store data for processing.


Variable have types int, double, string.

1. A structured program includes only combinations of the three basic structures

(1) sequence


(2) selection


(3) loop.


Any structured program might contain one, two, or all three types of structures.

How can these structures be combined?

1. Each of the structures has a single entry point and a single exit point.


2. Structures can be stacked or connected to one another only at their entry or exit points.


3. Any structure can be nested within another structure.

What is a structure?

Is a basic unit of programming logic; each structure is one of the following: Sequence, Selection, loop

When to use the varying structures?

The these three structures alone, you can diagram any task, from doubling a number to performing brain surgery. You can also diagram each structure with a specific configuration of flowcharts symbols.

Sequence structure

you perform an action or task, and then you perform the next action, in order.

Selection structure/decision structure

you ask a question and depending on the answer, you take one of two courses of action. Then, no matter which path you follow, you continue with the next task.

Loop structure

continues to repeat actions while a test condition remains true.

Possible errors in with loops...

With loops that ask for input, one might forget to use an input primer


Loops that don’t return right back to loop, instead they might end up at another structure’s entry.point,

Logic errors

A syntax error is when you miss or incorrectly use a languages punctuation or grammar. A logical error is when you yield a result that does not give the results you intended to get.

Logic error

A logical error occurs when incorrect instructions are performed, or when instructions are performed in the wrong order.

Array

an array is a group of data item in which every item has the same data type, is referenced using the same variable name, and is stored in consecutive memory locations.

Subscript

is the position number of a value within an array. A subscript begins with 0.

What does it mean to declare an array?

Give it a name and specify the data type for the data that will be stored in it. In some cases, you also specify the number of items that will be stored in the array.

How to write an array called “cityPopulations” with four ints?

Int cityPopulations[] = new int[4]

The compiler allocates enough consecutive memory locations to store four references to String objects for the array names cities.

The compiler allocates enough consecutive memory locations to store four references to String objects for the array names cities.

Int citiedPopulations[] = {950000, 450000, 34000};

How do you assign a value to specific subscript after it has been initialized?

cityPopulations[0] = 950000;

A loop is often used to assign value to an array.

for(loopIndex = 0; loopIndex < 3; loopIndex++){


cityPopulations[loopindex] = 12345;


Cities[loopindex] = “anycities”’}


// since the loop is first at subscript 0, these values are assigned to both arrays.

What errors can you get with array?

(1) You will fail to access the first element that uses subscript 0,


(2) and you will attempt to access an extra element at position 10 when the highest usable subscript 9.

More information on errors

You may have initialized 10 memory slots that are within subscripts 0 - 9. However, you may incorrectly start you subcript at 1 instead of 0. Exception: is an event that disrupts the normal flow of program execution and can cause your program to terminate.

What are parallel arrays?

To maintain a relationship between the items stored in the arrays. This relationship is established by using the same subcript value when accessing each array.

searching for arrays:

searching thorugh an array to find a value you need involves initializing a subscript, using a loop to test each array element, and setting a flag when a match is found.

Selection structures

you perform an action or task, and then you perform the next action, in order.

Looping

you continue to repeat actions while a condition remains true.

Precedence

between AND and OR, AND takes precedence, meaning the Boolean values of their expressions are evaluated first.

Boolean expression

an expression whose value can be only true or false.

Giving the following variable declarations and method calls, write the method's header:


String name;


printNameBadge(name);



public static void printNameBadge(String name)

Write a method that require multiple parameters


String name, message;


printBanner(name, message);

public static void printBanner(string name, string message)


I guess you need the type to distinguish between two variable.

Who is gay?

Kevin, duh

Writing methods that return a value:

Void in methods indicate that the method does not return a value.


When you want to return a value, you must indicate the type of the value you want to return; this is considered the method’s return type.

How do method that return values work?

The method is designed to prompt a user for the number of hours an employee has worked (main program), retrieve the value (class), and then return that value to the location in the program where the method was called.

Writing methods that return a value:

Double price, percent, newPrice;


newPrice = calculateNewPrice(price, percent);


I think is is how you write it: public static double calculateNew(double price, double percent)

More information regarding methods (1)

Public static void main(String args[])Int number // this variable name is local to main()


Public static void even_or_odd(int number) // The value of the former parameter, number, is stored at a different memory location and is local to the even_or_odd() method.

More information regarding methods (2):

Passing an argument by value means that a copy of the value of the arguemnt is passed to the method. Within the method, the value is stored in the formal parameter at a different at a different memory location, and is considered lcoal to that method.