1 / 31

CIS 199 Test 1 Review

CIS 199 Test 1 Review. Computer Hardware. Five logical units of computer system: Input unit Mouse, keyboard Output unit Printer, monitor, audio speakers Memory unit (Primary storage or Main Memory) Retains input and processed information Central processing unit (CPU)

hlyons
Download Presentation

CIS 199 Test 1 Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIS 199 Test 1 Review

  2. Computer Hardware Five logical units of computer system: • Input unit • Mouse, keyboard • Output unit • Printer, monitor, audio speakers • Memory unit (Primary storage or Main Memory) • Retains input and processed information • Central processing unit (CPU) • Supervises operation of other devices • Contains Arithmetic and logic unit (ALU) • Performs calculations • Secondary storage unit • Hard drives, SSDs, flash drives

  3. Input, Output Devices • Input • Takes data IN • Keyboard, Mouse, Game Controller, Microphone • Output • Pushes, places data OUT • Display, Speakers, Printers

  4. Programs and Digital Data • Programs • Operating Systems. Microsoft Office, Web browsers • Instructions read by CPU and processed • Digital Data • 1’s • 0’s • …forms binary (base 2)

  5. Object Oriented Programming (OOP) An extension of procedural programming • Objects • Similar to concrete objects in the real world • Contain their own attributes and behaviors • The attributes of an object represent its characteristics • The state of an object is the collective value of all its attributes • The behaviors of an object, or methods, are the things it “does”

  6. Built-In Types

  7. Scope • “private” – Can only be accessed by the class, object itself • “protected” – Can only be accessed by the class, object, or any child classes, objects • “public” – Available access for all

  8. Compares two items • An expression containing a comparison operator returns a Boolean value • Boolean can hold only one of two values—true or false • Declare a Boolean variable with data type bool Relational Operators

  9. Comparing Strings • Use == and != • Use the Equals() method, Compare()method, and CompareTo()method • You cannot use >, >=, <, <=

  10. String Interpolation • For outputting into a control on a form, the format is • NameOfControl.Text = $”{variableName:Format}”; • For outputting in a Console application, the format is • Console.WriteLine($”The variable is {variableName:Format}.”);

  11. Conditional Logic • if(expression) • If ‘expression’ is true • If not true, skipped • else if(expression) • Can be used to ‘chain’ conditions • Code runs if ‘expression’ is true • else • Code to execute if ‘expression’ false • Statements can be nested

  12. Switch Statement • switch structure • Tests a single variable against a series of exact matches • Keywords • switch – starts the structure and is followed immediately by a test expression enclosed in parentheses • case – followed by one of the possible values that might equal the switch expression • break – usually terminates a switch structure at the end of each case • Default – optionally is used prior to any action that should occur if the test expression does not match any case

  13. Data Conversion Exception Handling If user enters invalid data when you attempt to Parse, program will crash due to an exception • The TryParse methods can prevent these • int.TryParse • double.TryParse • decimal.TryParse • The generic syntax is: type.TryParse(string, out targetVariable) • The out keyword is required; it specifies that the targetVariable is an output variable

  14. Sample Questions

  15. What does ‘WYSIWYG’ stand for? • What • You • See • Is • What • You • Get

  16. GroupBox Vs Panel • GroupBoxes have: • Group Title • Panels have: • Scroll bar • Border styling options

  17. What is the difference between a high-level and a low-level language? • Low-Level • Little to no ‘abstraction’ from the hardware or computer • “Close to the hardware” • Simple, but Difficult to use • Machine code, assembly, C (in some cases) • High-Level • Very strong ‘abstraction’ from the hardware or computer • “Far from the hardware” • Easier to use, abstraction adds complexity • C++, Java, C#, Python

  18. How is the lifetime of a FIELD different from a lifetime of LOCAL variable? • Fields are members of their containing type • Fields can be used everywhere with appropriate scope • Local variables can be used only in their “local” environment

  19. What two things does a variable declaration specify about a variable? • Type • Identifier (Name) TYPE IDENTIFIER

  20. Describe ‘&&’ and ‘||’ and how they work. • && (AND) • Returns true if conditions are ALL true • “If you do well on the test AND the quiz, you will earn a great grade!” • || (OR) • Returns true if ANY conditions are true • “You can run a mile OR walk two miles (possible do both!)”

  21. Why is ‘TryParse’ more effective than ‘Parse’? • Less code • No try / catch required

  22. What is the difference between a SIGNED an UNSIGNED int?

  23. What is the difference between syntax errors and logic errors? • Syntax Errors – Errors that prevent compilation or other factors that prevent successful compilation • striing myString = string.Empty; // Won’t compile, syntax error • Logic Errors – Errors that occur during runtime, such as incorrect comparison or other unexpected behavior • If(grade > 60) { Code if grade is F } // Incorrect operator used

  24. What are the “Five logical units”? • CPU – Processing, instructions • Memory – Scratch pad, working space (Temporary) • Secondary Storage – Hard drives, storage (Long term) • Input – Keyboards, Mice, Controllers • Output – Monitors, Speakers, Printers

  25. Explicit type conversion? Why and how? • Variables must be used for a single type never change • Move from one type to another, must cast • EXPLICIT cast / type conversion • Aware of information loss

  26. Write a code fragment that will display “Good Job” when int variable score is 80 or more, “OK” when score is 70 – 79, and “Needs Work” for any score under 70.

  27. Write a code fragment that will apply a 10% discount to the value in double variable total when int variable numItems is 5 or more and int variable zone is 1, 3 or 5.

  28. Class Vs Objects • A Class can be described as a logical collection of attributes and behaviors (methods) that describe how a group of objects “look” and behave. • An object is an instance of a class. • Classes can be viewed as templates from which objects are created e.g. building plan (class)  houses (object) • The objects from a class can share the same features and structures but can differ in implementation and use e.g. Car (Class)  RedCar (object 1), BlueCar (object 2), SilverFastCar (object 3), SilverSlowCar (object 4) class Car RedCar = new Car(“Red”, 90.0); //object 1 Car BlueCar = new Car(“Blue”, 90.0); //object 2 Car SilverFastCar = new Car(“Silver”, 100.0); //object 3 Car SilverSlowCar = new Car(“Silver”, 20.0); //object 4 Car Color MaxSpeed Accelerates() Attributes method

  29. Question?

  30. How can REACH further help you today? • Ask Questions Now! • Need to see an Example? • Need to see a concept again? • Need additional help? • Visit us at: • CRC (Ekstrom Library) • Monday-Thursday9:00am – 8:00pm • Friday9:00am – 4:00pm • Sunday12:00pm – 2:00pm

More Related