Free Essay

Programming

In:

Submitted By mosesm
Words 4344
Pages 18
CS 2203 Unit 1 – 8 Self Quiz Review Questions

The main purpose of the information model is to inform software developers and provide protocol-specific constructs.
Select one:
True
False

Question 2
Which term describes each two-dimensional table or file in the relational model?
Select one:
a. Database
b. Relational Database
c. Data Warehouse
d. None of the Above

Question 3
If a relation has more than one candidate key the one chosen to represent the relation is called the:
Select one:
a. primary key
b. foreign key
c. alternate key
d. candidate key

Question 4
The first hierarchial DBMS was ____ and was released by IBM in 1968?
Select one:
a. IMS (Information Management System)
b. SQL
c. DB2
d. Oracle

Question 5
What is a field that uniquely describes each record?
Select one:
a. Composite Key
b. Foreign Key
c. Primary Key
d. None of the Above

Question 6
The number of attributes in a relation is known as:
Select one:
a. The relation degree
b. The relation cardinality
c. The relation domain
d. The relation schema

Question 7
Which of the following is NOT an information model?
Select one:
a. pureXML model
b. Relational Model
c. Hierarchial model
d. Network model

Question 8
The network model (CODASYL) was released in what year?
Select one:
a. 1979
b. 1969
c. 1964
d. 1980

Question 9
A formal description of all the database relations and all of the relationships existing between them is called a database schema.
Select one:
True
False

Question 10
A unique KEY field
Select one:
a. Is a special field that each database has to have.
b. Is a special field that identifies a particular record in a database
c. Is a special field that identifies a particular record in a data table
d. is a special field that has to be a unique number

Question 11
A foreign key is an attribute in one relation whose values match those of a primary key in another relation.
Select one:
True
False

Question 12
Which of the following is NOT a valid relationship for an entity relationship model?
Select one:
a. 1-to-1
b. m-to-1
c. 1-to-n
d. n-to-n

Question 13
A tuple is an ordered set of values that describe data characteristics at one moment in time. An informal term for tuple is:
Answer:

Question 14
A characteristic of data, a real-world data feature modeled in the database is called:
Select one:
a. attribute
b. cell
c. column
d. value

Question 15
The surrogate key provides a unique alternate for using a foreign key that is used to save space.
Select one:
True
False

Question 1
Which of the following statements BEST describes data integrity.
Select one:
a. ensures that data entered into the database is accurate, valid, and consistent.
b. Rules that ensure that no primary key is allowed to accept null values
c. Ensures consistency between the primary key and foreign key of relations
d. Ensure that primary keys are unique identifiers

Question 2
The AND logical operator is represented
Select one:
a. by the set of all things not contained within a set ( the compliment of the set)
b. by the overlap of two sets (the intersection)
c. by the union (overlap) of the universal set and a second set
d. by the contents of either of two sets (the union)

Question 3
Consider the following table:

SREF | INIT | SNAME | DOB | GENDER | RES | KIDS | HTOWN | 1 | TJ | OSMAN | 29-Sep-53 | M | No | 0 | MILLHOUSE GREEN | 2 | S | LANGLEY | 21-Aug-57 | F | No | 0 | HUDDERSFIELD | 3 | H | WILSON | 07-Jul-62 | M | Yes | 1 | HUDDERSFIELD | 4 | J | CARTER | 21-Mar-54 | F | Yes | 2 | BARNSLEY | 5 | A | JONES | 10-Nov-48 | F | Yes | 2 | SHEFFIELD | 6 | S | ISHEMO | 05-Dec-50 | M | No | 0 | LEEDS | 7 | K | ARNOTT | 01-Aug-60 | F | Yes | 2 | SHEFFIELD | 8 | B | ARNOTT | 23-May-62 | F | Yes | 1 | LEEDS | 9 | N | GREEN | 30-Sep-58 | M | Yes | 1 | SHEFFIELD |

the filter KIDS=1 OR RES=True will
Select one:
a. list all those who are resident and all those who have one child
b. list all those with 1 child
c. list all those who are resident
d. list only those who have one child as well as all those who are resident

Question 4
In strict relational terminology, an attribute is
Select one:
a. a table
b. a field
c. an entity
d. a record

Question 5
The entity integrity constraint says that if a relation R2 includes a foreign key FK matching the primary key PK of other relation R1, then every value of FK in R2 must either be equal to the value of PK in some tuple of R1 or be wholly null.
Select one:
True
False

Question 6
The primary key does not have to be unique in relations that have a one to many relationship.
Select one:
True
False

Question 7
A foreign key can accept a null value unless otherwise restricted by a null constraint.
Select one:
True
False

Question 8
Integrity constraints are rules that help ensure the quantity of the information.
Select one:
True
False

Question 9
A primary key must consist of one and only one field.
Select one:
True
False
Question 10
If a salesperson attempts to order merchandise for a customer not in the customer service database, the database will typically generate an error message. This message indicates that an integrity constraint has been violated.
Select one:
True
False

Question 11
>=1 is the same as >0 (for integers)
Select one:
True
False

Question 12
Consider the following table:

SREF | INIT | SNAME | DOB | GENDER | RES | KIDS | HTOWN | 1 | TJ | OSMAN | 29-Sep-53 | M | No | 0 | MILLHOUSE GREEN | 2 | S | LANGLEY | 21-Aug-57 | F | No | 0 | HUDDERSFIELD | 3 | H | WILSON | 07-Jul-62 | M | Yes | 1 | HUDDERSFIELD | 4 | J | CARTER | 21-Mar-54 | F | Yes | 2 | BARNSLEY | 5 | A | JONES | 10-Nov-48 | F | Yes | 2 | SHEFFIELD | 6 | S | ISHEMO | 05-Dec-50 | M | No | 0 | LEEDS | 7 | K | ARNOTT | 01-Aug-60 | F | Yes | 2 | SHEFFIELD | 8 | B | ARNOTT | 23-May-62 | F | Yes | 1 | LEEDS | 9 | N | GREEN | 30-Sep-58 | M | Yes | 1 | SHEFFIELD |

the filter KIDS >=1 OR KIDS=0 will
Select one:
a. List no-one
b. List everyone
c. List those who have 1 child
d. List those who have no children
Question 13
What do integrity constraint rules help you ensure?
Select one:
a. Quantity of the information
b. Quantity of the data
c. Quality of the information
d. All of the above

Question 14
There can be duplicate primary keys in the same file in a database.
Select one:
True
False

Question 1
A given relation is known to be in third normal form. Select the statement which can be inferred from this:
Select one:
a. All attributes contribute to the primary key
b. Each non-key attribute determines the primary key
c. Each non-key attribute is determined by the primary key
d. Every determinant is a candidate key
e. The relation is not in fourth normal form.

Question 2
A lack of normalisation can lead to which one of the following problems
Select one:
a. Lost Updates
b. Deletion of data
c. Insertion problems
Inserting data into an unnormalised system can result in the same data being entered in multiple tables. This gives rise to the possibility of data for the same object being entered "slightly differently" in more than one table. For instance, if a person's surname appeared in more than one table, and that person then changed his name, this change would have to be done in all tables where the name appeared. Ensuring this can be difficult, and so it is better to avoid such duplicated data by normalising the database design.
d. Deadlock conditions

Question 3
To transform a relation from second normal form to third normal form we must remove which one of the following?
Select one:
a. All partial-key dependencies
b. All inverse partial-key dependencies
c. All repeating groups
d. All transitive dependencies

Question 4
An athletics meeting involves several competitors who participate in a number of events. The database is intended to record who is to take part in which event and to record the outcome of each event. As results become available the winner attribute will be updated with the cid of the appropriate competitor. Competitor(cid, name, nationality) Event(eid, description, winner) Competes(cid, eid) Competitor | cid | name | nationality | 01 | Pat | British | 02 | Hilary | British | 03 | Sven | Swedish | 04 | Pierre | French | | Event | eid | description | winner | 01 | running | | 02 | jumping | | 03 | throwing | | | Competes | cid | eid | 01 | 01 | 02 | 01 | 03 | 02 | 04 | 02 | 04 | 03 | |
Select one:
a. A numeric attribute should be added to the Competes table
b. A numeric attribute should be added to the Event table
c. A numeric attribute should be added to the Competitor table
d. Three numeric attribute should be added to the Competitor table
e. Two numeric attributes should be added to the Competitor table

Question 5
The rule that prohibits transitive dependencies is
Select one:
a. first normal form
b. second normal form
c. third normal form
d. BCNF

Question 6
Most RDB designers will accept that in order to deal with the complexities of "real life" transactions, a design needs to reach
Select one:
a. second normal form
b. first normal form
c. third normal form
d. the standard of a flat file

Question 7
The rule that specifies that there should be no repeating fields and that fields should be atomic is
Select one:
a. first normal form
b. second normal form
c. third normal form
d. None of the above

Question 8
Consider the table (Relation) CARS REGNO
(Key Field) | MODEL | COLOUR | OID |

The key is REGNO (car registration number), OID is a foreign key that identifies the car's owner.

This table is in? select one:
a. first normal form
b. second normal form
c. third normal form
d. None of the above
Question 9
It is impossible to represent which of the following in a relational schema?
Select one:
a. any mandatory participation constraint in a many-to-one relationship
b. any mandatory participation constraint in a many-to-many relationship
c. a one-to-one relationship
d. a many-to-one relationship
e. a ternary relationship

Question 10
We know that table
Q has only one candidate key. Q is in 2NF.
Select one:
True
False

Question 11
Consider the table STUDREC SREF
(Key Field) | INIT | SNAME | DOB | GENDER | RES | KIDS | HTOWN | DISTANCE |

Which field (attribute) is transitively dependent on the key (SREF)
Select one:
a. RES (is the student residential)
b. KIDS (number of children)
c. DISTANCE (how far from The Northern College does the student live)
d. HTOWN (the student's home town)

Question 12
An atomic field is
Select one:
a. a single valued field
b. a key field
c. a numerical field
d. a key that contains only a single field

Question 13
Consider the table (Relation) CLASSES CLASSREF
(Key Field) | CLASS_TITLE | TUTOR_ID | ROOM_ID |

Why is the class title not suitable as a key field?
Select one:
a. The key field needs to be a unique number
b. The key field has to be an extra field to the actual data that we store about classes
c. It is likely that as time passes, we'll need to add more classes with different names to our CLASSES table.
d. It is possible to have more than one class with the same name (e.g. a database design class could run on Monday for one group and on Tuesday for another group)

Question 14
One of the tasks of a relational database management system (RDBMS) is to ensure that relational schemas are in at least 3NF.
Select one:
True
False

Question 15
Which of the following is generally a benefit of normalisation?
Select one:
a. Performance is improved
b. Insertion anomalies are avoided
c. Selection anomalies are avoided
d. Number of tables is reduced

Question 1
A given relation is known to be in third normal form. Select the statement which can be inferred from this:
Select one:
a. All attributes contribute to the primary key
b. Each non-key attribute determines the primary key
c. Each non-key attribute is determined by the primary key
d. Every determinant is a candidate key
e. The relation is not in fourth normal form.

Question 2
A lack of normalisation can lead to which one of the following problems
Select one:
a. Lost Updates
b. Deletion of data
c. Insertion problems
Inserting data into an unnormalised system can result in the same data being entered in multiple tables. This gives rise to the possibility of data for the same object being entered "slightly differently" in more than one table. For instance, if a person's surname appeared in more than one table, and that person then changed his name, this change would have to be done in all tables where the name appeared. Ensuring this can be difficult, and so it is better to avoid such duplicated data by normalising the database design.
d. Deadlock conditions

Question 3
To transform a relation from second normal form to third normal form we must remove which one of the following?
Select one:
a. All partial-key dependencies
b. All inverse partial-key dependencies
c. All repeating groups
d. All transitive dependencies

Question 4
Incorrect
An athletics meeting involves several competitors who participate in a number of events. The database is intended to record who is to take part in which event and to record the outcome of each event. As results become available the winner attribute will be updated with the cid of the appropriate competitor. Competitor(cid, name, nationality) Event(eid, description, winner) Competes(cid, eid) Competitor | cid | name | nationality | 01 | Pat | British | 02 | Hilary | British | 03 | Sven | Swedish | 04 | Pierre | French | | Event | eid | description | winner | 01 | running | | 02 | jumping | | 03 | throwing | | | Competes | cid | eid | 01 | 01 | 02 | 01 | 03 | 02 | 04 | 02 | 04 | 03 | |
Select one:
a. A numeric attribute should be added to the Competes table
b. A numeric attribute should be added to the Event table
c. A numeric attribute should be added to the Competitor table
d. Three numeric attribute should be added to the Competitor table
e. Two numeric attributes should be added to the Competitor table

Question 5
The rule that prohibits transitive dependencies is
Select one:
a. first normal form
b. second normal form
c. third normal form
d. BCNF

Question 6
Most RDB designers will accept that in order to deal with the complexities of "real life" transactions, a design needs to reach
Select one:
a. second normal form
b. first normal form
c. third normal form
d. the standard of a flat file

Question 7
The rule that specifies that there should be no repeating fields and that fields should be atomic is
Select one:
a. first normal form
b. second normal form
c. third normal form
d. None of the above

Question 8
Consider the table (Relation) CARS REGNO
(Key Field) | MODEL | COLOUR | OID |

The key is REGNO (car registration number), OID is a foreign key that identifies the car's owner.

This table is in
Select one:
a. first normal form
b. second normal form
c. third normal form
d. None of the above

Question 9
It is impossible to represent which of the following in a relational schema?
Select one:
a. any mandatory participation constraint in a many-to-one relationship
b. any mandatory participation constraint in a many-to-many relationship
c. a one-to-one relationship
d. a many-to-one relationship
e. a ternary relationship

Question 10
We know that table
Q has only one candidate key. Q is in 2NF.
Select one:
True
False
Question 11
Consider the table STUDREC SREF
(Key Field) | INIT | SNAME | DOB | GENDER | RES | KIDS | HTOWN | DISTANCE |

Which field (attribute) is transitively dependent on the key (SREF)
Select one:
a. RES (is the student residential)
b. KIDS (number of children)
c. DISTANCE (how far from The Northern College does the student live)
d. HTOWN (the student's home town)

Question 12
An atomic field is
Select one:
a. a single valued field
b. a key field
c. a numerical field
d. a key that contains only a single field

Question 13
Consider the table (Relation) CLASSES CLASSREF
(Key Field) | CLASS_TITLE | TUTOR_ID | ROOM_ID |

Why is the class title not suitable as a key field?
Select one:
a. The key field needs to be a unique number
b. The key field has to be an extra field to the actual data that we store about classes
c. It is likely that as time passes, we'll need to add more classes with different names to our CLASSES table.
d. It is possible to have more than one class with the same name (e.g. a database design class could run on Monday for one group and on Tuesday for another group)

Question 14
One of the tasks of a relational database management system (RDBMS) is to ensure that relational schemas are in at least 3NF.
Select one:
True
False

Question 15
Which of the following is generally a benefit of normalisation?
Select one:
a. Performance is improved
b. Insertion anomalies are avoided
c. Selection anomalies are avoided
d. Number of tables is reduced

Question 1
A Database Language Concerned with The Definition of the Whole Database Structure and Schema Is ________
Select one:
a. DCL
b. DML
c. DDL
d. All of the above

Question 2
Which of the following are valid CREATE statements in the world of DDL?
Select one:
a. CREATE SCHEMA
b. CREATE TABLE
c. CREATE DOMAIN
d. CREATE INDEX
e. All of the above

Question 3
To increase the number of nullable columns for a table,
Select one:
a. Use the alter table statement.
b. Ensure that all column values are NULL for all rows.
c. First increase the size of adjacent column datatypes, then add the column.
d. Add the column, populate the column, then add the NOT NULL constraint.

Question 4
The CREATE TABLE statement is used to…
Select one:
a. create a new database table.
b. change existing database table
c. create a new database.
d. None of the above

Question 5
Which SQL statement is used to update data in a database?
Select one:
a. update
b. save
c. modify
d. save as

Question 6
User JANKO would like to insert a row into the EMPLOYEE table, which has three columns: EMPID,LASTNAME, and SALARY. The user would like to enter data for EMPID 59694, LASTNAME Harris, but no salary. Which statement would work best?
Select one:
a. INSERT INTO employee VALUES (59694,’HARRIS’, NULL);
b. INSERT INTO employee VALUES (59694,’HARRIS’, SALARY);
c. INSERT INTO employee (EMPID, LASTNAME, SALARY) VALUES (59694,’HARRIS’);
d. INSERT INTO employee (SELECT 59694 FROM ‘HARRIS’);

Question 7
How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
Select one:
a. UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
b. UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
c. MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
d. MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

Question 8
Which three of the following are valid database datatypes in Oracle? (Choose three.)
Select one or more:
a. CHAR
b. VARCHAR
c. NUMBER
d. OBJECT

Question 9
The SQL ALTER statement can be used to:
Select one:
a. change the table structure.
b. change the table data.
c. add rows to the table.
d. delete rows from the table.
Question 10
With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
Select one:
a. INSERT INTO Persons (LastName) VALUES ('Olsen')
b. INSERT ('Olsen') INTO Persons (LastName)
c. INSERT INTO Persons ('Olsen') INTO LastName
d. None of the above
Question 1
The left outer join is one type of outer join. Another one is the.
Select one:
a. right
b. full
c. right outer
d. full outer
e. All of the above

Question 2
With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
Select one:
a. SELECT * FROM Persons SORT BY 'FirstName' DESC
b. SELECT * FROM Persons ORDER BY FirstName DESC
c. SELECT * FROM Persons ORDER FirstName DESC
d. SELECT * FROM Persons SORT 'FirstName' DESC

Question 3
Which SQL keyword is used to sort the result-set?
Select one:
a. SORT BY
b. ORDER
c. ORDER BY
d. SORT

Question 4
Developer ANJU executes the following statement: CREATE TABLE animals AS SELECT * from MASTER.ANIMALS; What is the effect of this statement?
Select one:
a. A table named ANIMALS will be created in the MASTER schema with the same data as the ANIMALS table owned by ANJU
b. A table named ANJU will be created in the ANIMALS schema with the same data as the ANIMALS table owned by MASTER
c. A table named ANIMALS will be created in the ANJU schema with the same data as the ANIMALS table owned by MASTER.
d. A table named MASTER will be created in the ANIMALS schema with the same data as the ANJU table owned by ANIMALS.

Question 5
The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T ;
Select one:
a. Equi-join
b. Natural join
c. Outer Join
d. Cartesian Join

Question 6
Partially correct
Which of the following is one of the basic approaches for joining tables?
Select one:
a. Subqueries
b. Union Join
c. Natural join
d. All of the above
Question 7
A UNION query is which of the following?
Select one:
a. Combines the output from no more than two queries and must include the same number of columns.
b. Combines the output from no more than two queries and does not include the same number of columns.
c. Combines the output from multiple queries and must include the same number of columns.
d. Combines the output from multiple queries and does not include the same number of columns.

Question 8
What type of join is needed when you wish to return rows that do have matching values?
Select one:
a. Equi-join
b. Natural join
c. Outer Join
d. All of the above

Question 9
Consider the following database:
MOVIE(id,title,yr)
ACTOR(id,name)
CASTING(movieid,actorid)
Identify the SQL command which will return the titles of all 1959 Marilyn Monroe films. 1. The following SQL... SELECT title FROM movie,casting,actor WHERE movieid = movie.id<> AND name = 'Marilyn Monroe' ; 2. The following SQL... SELECT title FROM movie,actor WHERE name = 'Marilyn Monroe' AND yr = 1959 ; 3. The following SQL... SELECT title FROM movie,casting,actor WHERE movieid = movie.id AND actor.id = actorid AND name = 'Marilyn Monroe' AND yr = 1959 ; 4. The following SQL... SELECT title FROM movie,casting,actor WHERE movieid = movie.id AND actor.id = actorid AND movie.yr = casting.yr AND name = 'Marilyn Monroe' AND yr = 1959 ; 5. None of the above
Select one:
a. Choice 1
b. Choice 2
c. Choice 3
d. Choice 4
e. Choice 5

Question 10
An athletics meeting involves several competitors who participate in a number of events. The database is intended to record who is to take part in which event and to record the outcome of each event. As results become available the winner attribute will be updated with the cid of the appropriate competitor. Competitor(cid, name, nationality) Event(eid, description, winner) Competes(cid, eid) Competitor | cid | name | nationality | 01 | Pat | British | 02 | Hilary | British | 03 | Sven | Swedish | 04 | Pierre | French | | Event | eid | description | winner | 01 | running | | 02 | jumping | | 03 | throwing | | | Competes | cid | eid | 01 | 01 | 02 | 01 | 03 | 02 | 04 | 02 | 04 | 03 | |
Select the BEST answer from the following options based upon the provided data and data structures:
Select one:
a. There is a British competitor in every event.
b. Pierre does not compete in any event
c. Sven has been entered in two events
d. Pat is competing in the jumping event
e. Hilary has entered only the running event

Question 1
If we write a program in a programming language and switch to SQL when we require to use the database, then the SQL environment in use is known as _______ SQL.
Select one:
a. Real - time
b. Dynamic
c. PL -
d. Embedded

Question 2
Embedded SQL is which of the following?
Select one:
a. Hard-coded SQL statements in a program language such as Java.
b. The process of making an application capable of generating specific SQL code on the fly.
c. Hard-coded SQL statements in a procedure.
d. Hard-coded SQL statements in a trigger.
Question 3
In JDBC, what represents a single instance of a particular database session?
Select one:
a. a thread
b. an opened connection
c. a closed connection
d. a pipe
Question 4
A relational database query normally returns many rows of data. But an application program usually deals with one row at a time. Which of the following is used to bridge this gap allowing the program to deal with on row at a time.
Select one:
a. Cursor
b. Trigger
c. PL/SQL
d. Sub select join

Question 5
The JDBC API is a Java API that can access any kind of tabular data, especially data stored in a relational database.
Select one:
True
False

Question 6
True or False: ODBC requires manual installation of the ODBC driver manager and driver on all client machines. JDBC drivers are written in java and JDBC code is automatically installable, secure, and portable on all platforms.
Select one:
True
False

Question 7
True/False: ODBC can be directly used with Java because it uses a C interface.
Select one:
True
False
Question 8
True/False: JDBC API is a natural Java Interface and is built on ODBC. JDBC retains some of the basic features of ODBC
Select one:
True
False

Similar Documents

Premium Essay

Programming

...flowcharts to describe a program’s structure. Use pseudocode to define a program’s structure. Formulate solution algorithms for calculations by properly following the order of operations. Assignment Requirements Answer: * Short Answer 1, 2, 3, and 4 on page 71 * Algorithm Workbench Review Questions 1 and 2 on page 71 * Programming Exercises Questions 1 and 4, starting on page 72 Required Resources Textbook Submission Requirements Submit your written answers to your instructor at the beginning of Unit 3. Unit 2 Research Assignment 1: Researching Variable Naming Rules Learning Objectives and Outcomes Determine program input, processing, and output stages. Create the necessary flowcharts to describe a program’s structure. Use pseudocode to define a program’s structure. Formulate solution algorithms for calculations by properly following the order of operations. Assignment Requirements Use the Internet and the ITT Tech Virtual Library to research the following questions: What are the variable naming rules of Visual Basic, Python, and Java? List three similarities and differences in between the three programming languages. Required Resources Textbook ITT Tech Virtual Library: http://library.itt-tech.edu Submission Requirements Submit your written answers to your instructor at the beginning of Unit 3. Labs Unit 2 Lab 2.1: Pseudocode Learning Objectives and Outcomes * Use pseudocode to define a program’s structure. * Formulate...

Words: 450 - Pages: 2

Free Essay

Programming

...the module in which its declared and only statements inside that module can access that module can access the variable. 5. The local variable usually beings at the variables declaration and ends at the end of the module which is then the variable is declared. 6. The difference between the both is that only a copy of the arguments value is passed and passing by reference means that the argument is passed into a specific type of parameter. 7. Global variables make debugging difficult because they make programming hard to understand, modules that use global variables are usually dependent and you have to track down every statement. Algorithm Workbench 1. Module main() Declare userNum as Integer Display “Enter a number” Input userNum Call TimesTen(usernum) Display usernum End 5. 13.4 00.0 00.0 6. 1, 3.4 0, 0 0, 0 7. Allows changes the values of passed parameters 1,3.4 0,0 0,0 Doesn’t allow changing of parameters 1,3.4 0,0 1,3.4 Programming Exercises 1. Kilo=input (“Enter distance in kilometers”) Miles=Kilo Print”, Kilo 2. Module TotalPurchase Declare Double amount, total Declare TAX=.06 While I<6 Display “Enter the price” Input amount Total=total+amount I=I+1 End while Display “Subtotal is:” + total Display “Tax is:” + (total*TAX) Display “Total is:”=(total*TAX)+total) End...

Words: 309 - Pages: 2

Free Essay

Programming

...Calling an external function or program that is written in a different programming language like a Java program within a Visual Basic program you first need to know the Function fundamentals that’s executed in any programming language. I came across this website called maples, where they have the ability to connect to and call functions from other programming languages. Maple uses this for various reasons. Like all other languages, the F# function has a name, it can have parameters, has a body and takes arguments. F# also supports functional programming constructs such as handling functions as values, depleting unnamed functions in expressions, composition of functions to form new functions, curried functions, and the implicit definition of functions by way of the partial application of function arguments. Maple's help system documents all the External Calling functions so you can see what is available. Briefly, however there are functions for converting Maple types to C and back, creating and interacting with Maple data structures creating and interacting with Maple language elements (names, procedures, etc), printing to the Maple interface, memory allocation, evaluating Maple statements and raising exceptions. There is even a C interface to the Task Programming Model. The function-name is an identifier that represents the function. The parameter-list consists of successive parameters that are separated by spaces. You can specify an explicit type for each parameter, as described...

Words: 394 - Pages: 2

Free Essay

Programming

...Introduction Selection structures allow computer programs to perform different functions depending on if the condition of the function is true or false. Selection structures also enable the program to decide on a particular action based on the input of the user or other processes. There are several different types of selection structures that can be put into operation, they are the IF selection statement, the IF ELSE selection statement and switch selection statement. This paper will attempt to explain selection structure and its different types and will also give a real life scenario in pseudo code. Selection Control Structure Computer programs utilize selection structures to choose from a variety of actions or processes. These processes typically have an outcome of true or false. When a program reads as true the process will be directed to the output that enables it to be true and vice versa for false processes. With computers having the ability to solve problems, make decisions and follow direction with the aide of a program it eliminates many human errors. The “IF” selection statement structure is used when there is a solitary or a collection of inputs to be executed to decide if the condition is true or false. If a process is submitted as false the “IF else” statement is rendered and the false output is passed over and the computer continues executing to the next selection structure. The IF statement structure also compares two values with relational operators: •...

Words: 505 - Pages: 3

Free Essay

Programming

...Reverse engineering involves taking something apart to see how it works. The advantages are you can learn the kind of system functions a target program is using. You can learn the files the target program accesses. You can learn the protocols the target software uses and how it communicates with other parts of the target network. The most powerful advantage to reversing is that you can change a program's structure and thus directly affect its logical flow. The disadvantages would be by enabling competitors to create competing devices, the possibility of reverse engineering might decrease the incentive for technology creators to develop new products, and reducing the manufacturer’s control over consumer uses for the product might have the same effect. One tool is REC Studio 4 - Reverse Engineering Compiler some of the features are Disassembler, Disassembler, Calling conventions, Floating-point, Windows Debugger. Short Answer 5. The variable’s name, and the variable’s data type 6. Some languages assign a default value such as 0 to uninitialized variables. In many languages, however, uninitialized variables hold unpredictable values. Algorithm workbench review 3. set b = 2+a Set a = b * 4 Set b = a / 3.14 Set a = b – 8 4. a. Set result = x + y b. Set result = z * 2 c. Set result = y / x d. Set result = y – z result = x++   - y; Answer   -4 result = 4 – 8 = -4     result =   ++w + y; Answer w = w + 1 = 5 + 1 = 6 result = 6 + 8 = 14 5. Declare...

Words: 297 - Pages: 2

Premium Essay

Programming Languages

...Exploring Programming Languages Computers don't do anything without someone telling them what to do, much like the average teenager. To make the computer do something useful, you must give it instructions in either of the following two ways. When you write a program it tells a computer what to do, step by step, just as you would like when taking directions. When you buy a program that someone else has already written, it tells the computer what to do. Ultimately, to get a computer to do something useful, you (or somebody else) must write a program. A program does nothing more than tell the computer how to accept some type of input, manipulate that input, and spit it back out again in some form that humans find useful. Table 1 lists some common types of programs, the types of input that they accept, and the output that they produce. The five popular programming languages in the 1970’s were Pascal, C, SQL, KRL, and COMAL. Pascal is an influential imperative and procedural programming language, designed in 1968–1969 and published in 1970 by Niklaus Wirth. C (/ˈsiː/, as in the letter C) is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. SQL was developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. SQL often referred to as Structured Query Language. KRL is a knowledge representation language, developed by Daniel G. Bobrow and Terry Winograd while at Xerox PARC and Stanford University...

Words: 839 - Pages: 4

Free Essay

Computer Programming

...Computer Programming Computers and machines have definitely changed people's lives over the years influencing academic life, workplace, and even the home setting. Therefore, it is important to become knowledgeable about computers and its different applications. Without doing so can severely affect one's chances in succeeding especially in his or her professional life since majority, if not all, of companies around the world depend on computers and machines. There are numerous jobs that deal specifically on the development of technology, including computers. One of the major careers in the field of computers is computer programming. People who work in this field are responsible for “writing, testing, and maintaining the instructions that computers follow to perform their functions. They also focus on conceiving, designing, and testing logical structures for solving problems by computer” (“Computer Programmers”). Literally, they program computers, softwares, and applications to function the way computers should. In 2007, “40 percent of companies expected to add programmers and information technologists, 45 percent expected to maintain their staffs, and 81 percent planned to increase the salaries of their computer programmers” (“The 2007 Job Market Outlook for Computer Programmers”). However, these numbers are not enough because it seems that the job outlook for this profession is not good. “The occupation is forecasted to grow more slowly than the average for all other occupations...

Words: 911 - Pages: 4

Premium Essay

Programming Timeline

...After researching the programming languages between the eras of 1970s-2000s I discovered there were many types of programming languages being developed at a spectacular rate. The popularity of the languages were dependent upon what you were trying to program. Below you will find a general idea of 5 programming languages and a brief description of those languages. 1970s- PASCAL • Designed in 1968-1969 • Published in 1970 by Niclaus Wirth • Historically influential and procedural programming language • Intended to encourage good programming practices using structured programming and data structuring • Influential imperative and procedural programming language 1980s- C++ (pronounced see plus plus) • Statically typed, free-form, multi-pariadigm, compiled, general-purpose programming language • Middle-level language o Comprises a combination of both high-level and low-level language features • Developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language • Renamed C++ in 1983 • Has imerative, object-oriented, generic programming features • Provides low-level memory manipulation • For use in embedded systems or operating system kernels • Is a compiled language • Available on many platforms and provided by various organizations 1990s- JAVA • Originally developed by James Gosling at Sun Microsystems • Released in 1995 as core component of Sun Microsystems’ Java platform • Derives much of its syntax from C and...

Words: 470 - Pages: 2

Free Essay

Programming Solutions

...Programming Solutions Being able to create a solution to a certain problem through programming can be a huge task to undertake, but it is a task that must be accomplished in order to get certain things done. Many companies face problems in the IT field that can be solved through programming, from simple to very complex, these problems usually require some sort of input and variables in order to create a solution. One problem that I face in the workplace of construction, is trying to figure out the number of ceiling tiles we will need to fit the ceilings in most offices we build. The ceiling tiles are a certain size and cover large areas which can be a tedious task trying to count how many tiles it will take to fill in the ceiling. A programming solution could be very beneficial in an instance such as this because by creating inputs such as the size of the tiles and the area they need to cover, an output could be the number of tiles that will be needed and thus saving a large amount of time on counting every space they need to fill. This problem of having to determine the number of ceiling tiles it will take to cover the celling area is normally done by counting the spaces in the ceiling that need to be filled and then determining how many tiles will need to be purchased. By coming up with a program to solve this problem would no doubt save a lot of time and even money by not buying an excess amount and either throwing them away or storing them. I believe a simple program would...

Words: 701 - Pages: 3

Premium Essay

Benefits of Programming

...Benefits of Programming Knowledge John Padgett IT/ 215 August 8, 2013 Chan Benefits of Programming Knowledge When you are an IT professional, you really want to know as much as you can about your particular specialty as an IT member and you also need to have some knowledge in programming concepts as well. It really doesn’t matter what you do as an IT team member for a particular company, but as a member you need to have basic programming concept skills to be effective and understanding how to solve any problems that you may encounter. The main problem today for any IT division of a company is being able to support all aspects of IT that company may need. It starts with security for the company and its data all the way to systems managers and network engineers just to name a few of the positions that IT professionals have skills to perform those jobs within the companies IT team. Everything that you will do as an IT professional will require you to have some basic knowledge in programming concepts because just about all the areas in the IT field ultimately come down to programming the computer to do a specific function or task. If you don’t have the basic skills of programming concepts you will be lost when it comes to trouble shooting any problems. As an It professional you will come across many circumstances that will require you to have programming fundamentals to do the job required at the time. Having knowledge in the JAVA language is beneficial...

Words: 515 - Pages: 3

Free Essay

Errors in Programming

...can occur in a program but can be handled in a way that allows the program to continue operation.(Editorial Board, 2014) Dealing with errors in a well-defined way allows programmers to write code to handle errors. This is exception handling. There are pros and cons for using error and exception handling. Exception handling enables normal code to be written and to deal with the exceptional cases code elsewhere. It also provides the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program. A second advantage of exceptions is the ability to propagate error reporting up the call stack of methods which allows grouping and differentiating error type objects. In traditional programming, error detection, reporting, and handling often leads to confusing code. This presents disadvantages because you lose compile time support, the calling method must take care is testing all possible return values, and the code blends leading to cluttering. These errors can only be corrected by fixing the program. The best programs of this type forestall errors if possible, recover from them when they occur without terminating the application, or (if all else fail) gracefully terminate an...

Words: 401 - Pages: 2

Free Essay

Modular Programming

...Introducing Algorithms Dedric D. Owens PRG/211 – Algorithms and Logic for Computer Programming October 28, 2013 John Rogers Describe the Top-Down Approach to Algorithm Writing When developing a program, the top-down approach is more than not the preferred method. This is driven by what the program actually does; basically the function of the program. According to Penn State Lehigh Valley, “top-down design or stepwise refinement is an approach to designing an algorithm” and, there are four steps in this top-down design. These steps are as follows: You have to “understand the problem by thoroughly analyzing it.” Then, “formulate the algorithm by determining and writing the main tasks to be carried out as a sequence of general steps”. The third step is to “fill in more details by determining the sub-tasks, if any, for each main task. Lastly, “repeat step third step until you arrive at a precise algorithm expressed in terms of basic executable instructions.” How is pseudo-code used to assist in writing an algorithm? Pseudo-code is defined as an outline of a program written in a form that can easily be converted into real programming statements. It is sometimes confused with an algorithm when developing a program. In reviewing Prelude to Programming: Concepts and Design, Fifth Edition, (para. 2.1, pg 72 an algorithm is “a step by step method for solving a problem or doing a task.” Pseudo-code uses short and easy to understand phrases in plain...

Words: 602 - Pages: 3

Free Essay

Programming Languages

...Assignment 1: Exploring Programming Languages 1970’s Pascal- created by Nicklaus Wirth Designed in 1968-1969 and published in 1970 Intended to teach students structured programming. Used to introduce as undergraduate courses. The first compiler was designed in Zurich for the CDC 600 mainframe computer. Small Talk- Created by Alan Kay, Dan Ingalls, Adele Goldberg Appeared/created in 1972 Was designed to underpin the new world of computing by the human computer symbiosis. For educational use. Influenced by Logo and Sketchpad. Scheme- Created in 1975 Designed Guy L. Steele and Gerald Jay Sussman Was influenced by Lisp, ALGOL, and MDL. Designed to choose lexical scope and was the first to require implementations to perform tail call optimization which gives stronger support for functioning programming. Once was one of the first to support first class continuations. SQL- Created in 1974 Designed by Donald D. Chamberlin and Raymond F. Boyce Influenced by Data log. Designed to manipulate and retrieve data stored in IBM’s original quasi-relational database management system. ML - Created by Robin Milner & others at university of Edinburgh Created in 1973 Motivated by or inspired by ISWIM ...

Words: 1049 - Pages: 5

Premium Essay

Programming Ch3

... | | | 4. In a structured program, any structure can be nested within another structure.   | a.  | True |   | b.  | False | | | | 5. A structured program must contain a sequence, selection, and loop structure.   | a.  | True |   | b.  | False | | | | 6. Because you may stack and nest structures while retaining the overall structure, it might be difficult to determine whether a flowchart as a whole is structured.   | a.  | True |   | b.  | False | | | | 7. As a general rule, an eof question should always come immediately after an input statement because the end-of-file condition will be detected at input.   | a.  | True |   | b.  | False | | | | 8. Structured programming is sometimes called goto-less programming.   | a.  | True |   | b.  | False | | | | 9. No matter how complicated it is, any set of steps can always be reduced to combinations of the two basic structures of sequence and loop.   | a.  | True |   | b.  | False | | | | 10. The case structure is a variation of the sequence structure and the do loop is a variation of the while loop.   | a.  | True |   | b.  | False | | | | 11. Programs that use _____ code logic are unstructured programs that do not follow the rules of structured logic.   | a.  | case | b.  | loop |   | c.  | spaghetti | d.  | nested | | | | 12. With a(n) ____, you perform an action or task, and then you perform the next action, in order.   | a.  |...

Words: 1062 - Pages: 5

Free Essay

C# Programming

...True or False (Circle T/F if you think the statement is true/false) (Each question worth 5 points) 1. In C#, a project is a set of files and a solution is a set of projects. T 2. Every object you create or use in C# programming has a specific type usually. When a method doesn’t return anything, there is no return type defined for the method. F 3. In C#, some of the objects, variables or constants don’t have a specific type. F 4. The continue statement skips the remaining statements in the loop (any loop) and transfers control to the test condition. T 5. A smaller type must be explicitly cast to a compatible larger type. F 6. Assume you declared a constant when you’re programming. Although it is called a “constant”, its value can be changed when the program is running. F 7. The members in class A that are marked by private are accessible to methods of class A and also to methods of classes derived from class A. F 8. In C#, when you declare a variable without initializing it, the system will initialize the variable to 0 automatically as VB does. F 9. The system will execute a mathematical formula from left to right; you don’t have to consider the issue of operator precedence in C#. F 10. Implicit casting sometimes runs the risk of data loss. F Multiple Choice questions: (Circle all that applies. If all of your choices are correct but you missed the other correct choices, you will receive partial...

Words: 390 - Pages: 2