Computer Programming Final Review Questions PDF

Title Computer Programming Final Review Questions
Author Samantha Polidoro
Course Intro to Computer Programming
Institution Fairleigh Dickinson University
Pages 18
File Size 330 KB
File Type PDF
Total Downloads 44
Total Views 153

Summary

A full final review of all lectures!...


Description

Computer Programming Final Study Guide

Chapter 1: ● What is a program? o The set of instructions that a computer follows to perform a task ● What is hardware? o All the physical devices, or components, that a computer is made of ● List the 5 major components of a computer system. o CPU (Central Processing Unit) o Main Memory o Secondary Storage o Input Devices o Output Devices ● What part of the computer actually runs programs? o CPU ● What part of the computer serves as a work area to store a program and its data while the program is running? o Main Memory ● What part of the computer holds data for long periods of time, even when there is no power to the computer? o Secondary Storage ● What part of the computer collects data from people and from other devices? o Input Device ● What part of the computer formats and presents data for the people and other devices? o Output Device ● What fundamental set of programs control the internal operations of the computer’s hardware? o Operating Systems ● What do you call a program that performs a specialized task, such as a virus scanner, a filecompression program, or a data backup program? o Utility Program ● Word processing programs, spreadsheet programs, email programs, Web browsers, and game programs belong to what category of software? o Application Software ● What amount of memory is enough to store a letter of the alphabet or a small number? o 1 Byte=8 Bits ● What do you call a tiny “switch” that can be set to either on or off? o A Bit ● In what numbering system are all numeric values written as sequences of 0’s and 1’s? o Binary ● What is the purpose of ASCII? o It is an encoding scheme that uses a set of 128 numeric codes to represent the English letters, various punctuation marks, and other characters. These numeric codes are used to store characters in a computer’s memory ● What encoding scheme is extensive enough to represent all the characters of many of the languages in the world? o Unicode ● What do the terms digital data and digital device mean? o Digital Data - Data that is stored in binary o Digital Device - Any device that works with binary data ● A CPU understands instructions that are written only in what language? o Machine Language ● A program has to be copied into what type of memory each time the CPU executes it? o Main memory, or RAM ● When a CPU executes the instructions in a program, it is engaged in what process? o Fetch-Decode-Execute ● What is assembly language? o It is an alternative to machine language. Instead of using binary numbers for instructions, assembly language uses short words that are known as mnemonics ● What type of programming language allows you to create powerful and complex programs without knowing how the CPU works? o A high-level language ● Each language has a set of rules that must be strictly followed when writing a program. What is this set of rules called? o Syntax

0

Computer Programming Final Study Guide







● ●



● ● ● ● ●

● ● ●

● ●

● ● ● ●

● ● ● ●

What do you call a program that translates a high-level language program into a separate machine language program? o A compiler What do you call a program that both translates and executes the instructions in a high-level language program? o An interpreter What type of mistake is usually caused by a misspelled keyword, a missing punctuation character, or the incorrect use of an operator? o Syntax Error What is a user interface? o The part of the computer with which the user interacts How does a command line interface work? o A command line interface requires the user to type commands. If a command is typed correctly, it is executed and the results are displayed. If a command is not typed correctly, and error message is displayed. When the user runs a program in a text-based environment, such as the command line, what determines the order in which things happen? o The program What is an event-driven program? o A program that responds to events that are caused by the user, such as the clicking of a mouse What is an object? o A program component that contains data and performs operations What type of language is used to create programs by putting together a collection of objects? o Object oriented What two general capabilities does an object have? o An object can (1) store data in fields or properties and (2) perform operations called methods What term is commonly used to refer to objects such as TextBoxes, Labels, and Buttons that are visible in a program’s graphical interface? o Controls What is the purpose of an object that cannot be seen on the screen and exists only in memory? o To perform some task What is a class? o Code that describes some particular type of object What is the .NET Framework? o A collection of classes and other code that can be used, along with a programming language such as C#, to create programs for the Windows operating system Why might you need to write your own classes? o When a program needs specific objects that cannot be found in the .NET framework List the 6 steps in the program development cycle. o Understand the program’s purpose o Design the graphical user interface (GUI) o Design the program’s logic o Write the code o Correct syntax error o Test the program and correct logic errors What is an algorithm? o A set of well-defined logical steps that must be taken to perform a task What is a pseudocode? o An algorithm that is written out in this manner, in plain English statements What is a flowchart? o A diagram that graphically depicts the steps of an algorithm What do each of the following symbols mean in a flowchart? o Oval - terminal symbol o Parallelogram - input or output o Rectangle - processing Briefly describe the purpose of the Solution Explorer window. o Allows you to navigate among the files in a Visual C# project Briefly describe the purpose of the Properties window. o To examine and change a control’s properties Briefly describe the purpose of the standard toolbar. o Buttons that execute frequently used commands What is the difference between the toolbar and the Toolbox?

1

Computer Programming Final Study Guide

o







● ● ● ● ●

● ●

● ● ● ●

● ●

● ●

● ●





The ToolBox is a window that allows you to select the controls that you want to use in an application’s user interface. The toolbar contains buttons that execute frequently used visual studio commands What is a ToolTip? o A small rectangular box that pops up when you hover the mouse pointer over a button on the the toolbar or in the the Toolbox for a few seconds What is a project? o A Visual C# project consists of several files. You can think of a project as a collection of files that belong to a single application What is a solution? o A solution is a container that holds one or more Visual C# projects. If you are developing applications for a large organization, you might find it convenient to store several related projects together in the same solution Negative numbers are encoded using the _________ technique. o Two’s complement The ________ translates an assembly language program to a machine language program. o Assembler Real numbers are encoded using the ________ technique. o Floating-Point If you were to look at a machine language program, you would see _________. o A stream of binary numbers A ________ is a program that translates a high-level language program into a separate machine language program. o Compiler A ________ is code that describes a particular type of object. o Class The ________ is a collection of classes and other code that can be used, along with a programming language such as C#, to create programs for the Windows operating system. o .NET Framework Before GUIs became popular, the _______ interface was the most commonly used. o Command line _______ programs are usually event driven. o Command line How big is a hard drive? o Measures things in terms of megabytes (MB), gigabytes (GB), and terabytes (TB) How fast is a computer (speed)? o The speed that a CPU works at it measured in hertz (Hz). Modern processors often run so fast that gigahertz (GHz) is used instead. One gigahertz is one billion cycles per second. What is a programmer/software developer? o A person with the training and skills necessary to design, create, and test computers What is software? o Programs are easily referred to as this. It is and creates what a computer is able to do, which is created by programmers/software developers Running/Executing a program o What the computer does when given a program What is the CPU (Central Processing Unit)? o Runs the program on the computer. It is the most important component b/c without it the computer could not run the software. They’re microprocessor (ex. Intel/AMD) it’s the brain! Optical Devices o Compact disk (CD), digital versatile disk (DVD) recorded as pits, no laser System Software o Programs that control and manage the basic operations of the computer ▪ Operating systems ▪ Utility programs ▪ Software development tools Operating Systems o The most fundamental set of programs on a computer. Controls the internal operations of a computer's hardware, manages all devices connected to the computer, allows saved to, retrieved, and ran on their and other computers (the manager of resources) Utility Program o Performs a specialized task that enhances the computer's operation or safeguards data. Ex. Virus scanners, file compression programs, data backup programs

2

Computer Programming Final Study Guide



Software development tools o The software that programmers use to create, modify, and test software. Ex. Assemblers, compilers, and interpreters ● What the CPU does o Reads a piece of data from main memory, add 2#’s together, subtracts one # from another, multiply 2#, divides one number by another, moves a piece of data from one memory location to another. Determines whether one values is equal to another ● Low-level language vs. high-level language o Low-level language: close in nature to machine language o High-level language: creates powerful and complex programs without knowing how CPU works without writing low-level language. Ex. Java, python, basic ● Keywords/reserved words o Words that make up a high level programming language ● Syntax and Syntax Error o A set of rules that must be strictly followed when writing a program. The syntax dictates how keywords, operators, and various punctuation characters must be used in a program. Error is a mistake of the rules which could be misspelling missing punctuation. Or incorrect operator use. ● VS 15 o A professional IDE integrated development environment which means that it provides all the necessary tools for creating, testing, and debugging software ● An integer typically needs how many ___ of storage o 4bytes ● A float/decimal typically needs ___ of storage o 8 bytes Chapter 2: ● When you start a new Visual C# project, what is automatically created and displayed in the Designer? o An empty form ● How can you tell that an object is selected and ready for editing in the Designer? o It is enclosed by a thin dotted line called a bounding box ● What is the purpose of an object’s sizing handles? o To resize an object’s bounding box using the mouse ● What must each form and control in an application’s GUI have to identify it? o A name ● What is the purpose of the Properties window? o To display the properties of the currently selected object ● What does the Alphabetical button do when it is selected in the Properties window? o Causes the properties to be displayed in alphabetical order ● What does the Categorized button do when it is selected in the Properties window? o Causes the properties to be displayed in groups ● What does a form’s Text property determine? o The text that is displayed in the form’s title bar ● What does a form’s Size property determine? o The forms height and width in pixels (automatically 300x300) ● What is shown in the ToolBox? o A scrollable list of controls that you can add to a form ● How do you add a control to a form? o Double click, or drag it to the form from the ToolBox ● What should the text that is displayed on a button indicate? o What the button will do when clicked ● What are the rules for naming controls? o First Character must be a-z or A-Z, or (_) o After: a-z, A-Z, (_), 0-9 o Name cannot contain spaces ● What naming convention do most C# programmers use to separate words in multiword identifier? o camelCase ● A file that contains program code is known as what type of file? o Source code ● What must you do if you want your application to perform any meaningful actions? o Write code ● What does the Program.cs file contain? o The application's start-up code ● What does the Form1.cs file contain?

3

Computer Programming Final Study Guide

● ● ● ● ● ● ● ● ● ● ● ●

● ● ● ● ● ● ● ● ● ● ● ●

● ●

● ●

o Code associated with the Form1 form How is C# code organized? o Namespaces, classes, methods What is a namespace? o A container that holds classes What characters do code containers, such as namespaces, classes, and methods use to enclose code? o Brackets {} How do you switch between the Designer and the code editor? o Click the tab for the desired window How do you create an event handler for a button? o Double-click the button control in the Designer What is a Click event? o An event that occurs when an application is running and the user-clicks a control What method do you use in Visual C# to display a message box? o messageBox.Show() What is a literal? o Data that is literally written into a program What are string literals enclosed in? o Quotations marks “” How do you run a project that you have open in Visual Studio? o Press F5 key or Start Debugging button In which group of the ToolBox can you find the Label control tool? o Common controls Once you have placed a Label control on a form, which property do you use to set the text that you want to display? o The text property What property can you use to change the appearance of a Label control’s text? o The font property What is the default value of a label’s BorderStyle property? o None How do you change the BorderStyle property of a control in the Properties window? o Click down arrow that appears next to properties value. Select desired value from the list What property determines whether a label can be resized? o AutoSize What property determines the way text is aligned in a Label control? o TextAlign How can you use a Label control to display output while a program is running? o I know how to do this What happens if you assign an empty string to a control’s Text property in code? o It clears the contents What is a PictureBox control used for? o To display a graphic image on a form Where is the PictureBox tool located in the ToolBox? o Common controls How do you display an image in the PictureBox? o Use image property to specify the image will display What is the default value of the PictureBox control’s SizeMode property? o Normal How does setting the SizeMode property to Zoom affect the image that is to be displayed in the PictureBox control? o Uniformly resized to fit in the PictureBox without losing its original aspect ratio How do you create a clickable image? o Create a click event handler Does the value of a control’s Visible property change how the image appears at runtime and design time? o Yes, if the Visible property is set to False, the control can still be seen at design time, but during runtime, the control will not be visible What purpose do comments serve? o Brief notes that are placed in a program’s source code to explain how it works How are line comments and block comments different? o Line comment: //comment o Block comment: /*comment

4

Computer Programming Final Study Guide

● ● ● ● ● ● ● ● ●

● ●



● ● ● ●

● ●

● ● ● ●



comment comment*/ What should you be careful to remember about the beginning and ending symbols of block comments? o Not to reverse the beginning and ending symbols, and don’t forget ending symbol Why do programmers insert blank lines and indentations in their code? o Visual organization What statement do you use to close an application’s form in code? o this.Close(); How can you tell that Visual Studio has found a syntax error? o Underlined with jagged line What happens if you hold the mouse cursor over a jagged line in the code editor? o A description of the error will pop up in a ToolTip window What happens if you attempt to compile and execute a program that contains syntax errors? o A window appears that displays the errors The statement MessageBox.Show(“Hello World”); is an example of an _________. o Event handler A _________ property can be set to one of two possible values: True or False. o Binary ________ is a feature of Visual Studio that provides automatic code completion as you write programming statements. o IntelliSense The standard notation for referring to a control’s property in code is ________. o ControlName.PropertyName Once you have created a PictureBox control, you use its ________ property to specify the image that it will display. o Image What is the difference between a void method and a value-returning method? o A void method simply executes a group of statements and then terminates. A value-returning method returns a value to the statement that called it. What two parts does a method definition have? o A header and body What does the phrase “calling a method” mean? o You are causing the method to execute When a void method is executing, what happens when the end of the method is reached? o Control of the program goes back to the part of the program that called the method Describe the steps involved in the top-down process. o The overall task that the program is to perform is broken into a series of subtasks o Each subtask is examined to determine whether it can be further broken down into more subtasks. This step is repeated until no more subtasks can be identified o Once all the subtasks have been identified, they are written in code What is the purpose of an argument? o A method uses arguments to pass data into the method using parameter variables Briefly summarize how assignment compatibility applies to argument passing? o Assignment compatibility applies to argument passing in the following ways: ▪ You can pass only string arguments into string parameters ▪ You can pass int arguments into int parameters, but you cannot pass double or decimal arguments into int parameters ▪ You can pass either double or int arguments into double parameters, but you cannot pass decimal values into double parameters ▪ You can pass either decimal or int arguments to decimal parameters, but you cannot pass double arguments into decimal parameters What is the scope of a parameter variable? o The scope of a parameter variable is limited to the method in which it is declared What is a named argument? o A parameter variable with a default value What does it mean when an argument is passed by value? o A copy is passed into the parameter variable, and it does not modify the original argument What is a reference parameter? o A reference to the argument it was passed. Any changes done to the parameter are also done to the argument How can methods communicate using reference parameters? o The calling method can communicate with the called method by passing an argument

5

Computer Programming Final Study Guide

o

The called method can communicate with the calling method by modifying the value of the argument via the reference parameter ● What keyword is used to specify a reference parameter? o The ref keyword ● What is an output parameter? o Works like a reference parameter, but the value passed into it can be uninitialized and it must be set by the method before the method terminates ● Documentation Comments o Used by professional programmers to embed extens...


Similar Free PDFs