9 Pages

CPSC230_Final_Exercise

Course: CPSC 230, Fall 2009
School: Christopher Newport...
Rating:
 
 
 
 
 

Word Count: 2377

Document Preview

COMPUTERS CPSC230 & PROGRAMMING I FINAL Exercise SUMMER 2001 Department Of Physics, Computer Science and Engineering Christopher Newport University Student Name: ______________________________ Student ID: ______________________________ Part 1 Basic 1. 2. 3. 4. 5. 6. 7. 8. 9. Why is it necessary to include iostream in a program that uses cin and cout? What is a compiler? What's the name of the compiler we...

Register Now

Unformatted Document Excerpt

Coursehero >> Virginia >> Christopher Newport University >> CPSC 230

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
COMPUTERS CPSC230 & PROGRAMMING I FINAL Exercise SUMMER 2001 Department Of Physics, Computer Science and Engineering Christopher Newport University Student Name: ______________________________ Student ID: ______________________________ Part 1 Basic 1. 2. 3. 4. 5. 6. 7. 8. 9. Why is it necessary to include iostream in a program that uses cin and cout? What is a compiler? What's the name of the compiler we use for our course? What is the difference between an object and a class? What is the difference between class and struct? What is the difference between pass by value and pass by reference? List one advantage and one disadvantage of passing parameters by reference instead of by value. In the function foo (int t[], int size); is the array t passed by value or by reference? When would you use a do/while loop instead of a while loop? Members of a class specified as ____________ are accessible only by members of that class and by friends of that class. 10. What is the difference between a void and a non-void function? 11. Suppose your executable is named a.out. Write the complete UNIX command to execute a.out but redirect its input so that cin reads from the file input.dat. 12. Suppose x and y are two int variables different than zero. Write a statement that computes the real number that results from dividing x by y. Assume x and y are already declared. 13. Write a single C++ statement that will compute the value of the formula y = ax2+bx+c. 14. Write a statement that assigns random integers to the variable n in the following ranges: a) 0 n 11 b) -4 n 15 15. Declare a string variable called firstname and give it the value "John". Part 2 Control Structures 16. Rewrite the following if/else statement using the conditional operator (?:) if (x % 3 == 0) cout << "x is a multiple of 3"; else cout << "x is NOT a multiple of 3"; 17. A company gives its customers a 20% discount if they order 1000 or more of the same item; 15% if they order 500-999; 10% if they order 100-499; and no discount if quantity < 100. Write an if/else if/else statement that will figure out the amount of discount and the order total. Assume that the variables quantity, discount, subtotal (order subtotal before discount is applied), and total (order total after proper discount has been applied) have already been declared. 18. Write a nested if/else statement that would assign grades to students based on their overall average. The grade cutoffs are A:90, B:80, C:70, and D:60. Assume that the variables grade and avrg were defined as: char grade; double avrg; 19. Rewrite the following for loop using a while loop. for (TempF = 0; TempF <= 100; TempF += 10) { TempC = (TempF - 32.0) * 5.0 / 9.0; cout << TempF << " " << TempC << endl; } 20. Re-write the following code using a for loop instead of the while loop. x = 1; product = 1; while (x <= 8) { product *= x; x += 2; } 21. Write the code (using two nested for loops) that would print the following shape (notice there is a difference of 2 stars between two consecutive lines) ********** ******** ****** **** ** 22. Write the code (using two nested for loops) that would print the following shape ****** * * * * * * ****** 23. Using while loop to write the code (not an entire program) that will ask a user for a number. As long as the number given by the user is a multiple of 5, print that number out and ask the user for a new number. Part 3 Functions 24. In the function foo (const int &x); is it possible for the function to modify the value of x? Why or why not? 25. Comment on the design of the following function: readAndPrintData (int dataArray[], int &arraySize). 26. A variable that can be accessed only within the function in which it was defined is called a _________ variable. A variable that can be accessed within any function is called a _________ variable. 27. In C++ it is possible to have various functions with the same name but different signatures. This is called function _____________________. 28. Write a function named triple that accepts as an input parameter one integer and returns triple that integer. For example, triple(4) will return the value 12. 29. Write a function named get that reads three integers from the user and passes their values back to the caller via output parameters. Here is an example of a call to this function: int x, y, z; get(x,y,z); cout << x << y << z; 30. Write a function named printNbrs that prints all even integers from 2 to 100, each on a separate line, using only one cout statement. 31. Write a function named rectangle which accepts as input parameters two integers h and w, and prints a rectangle consisting of * characters. w represents the number of * in a line (i.e. width), h represents the number of lines (i.e. height). 32. A shipping company charges $500 for the first 100 pounds and $1.50 for each extra pound of part thereof in excess of 100 pounds. Write a definition of the function calculateCharge to determine the shipping fee for a particular shipment. The argument to this function should be the weight in pounds of the shipment. 33. Define a function named isPositive() which accepts an integer parameter and returns true if that parameter is positive, otherwise it returns false. 34. Write the prototype and the definition of a function arrayMin that returns the minimum of the elements in a one-dimensional array of type double and size n. The arguments of this function should be the array itself and the size of the array. 35. The definition of the function convertFtoC that converts a Fahrenheit temperatures to Celsius are as follows: // function definition double convertFtoC (int fah) { return (fah - 32) * 5.0 / 9.0; } Use this function in a program to convert all Fahrenheit temperatures that are multiples of 5 in the range of 5-100 (i.e. 5, 10, 15, 20, 100) to Celsius temperatures and print the results in a nice tabular format. 36. Write a function that takes an array of integers and the integer size of the array as parameters and returns the difference between the sum of all the elements of the array located at even indices and the sum of all the elements of the array located at odd indices. 37. Given the definitions and the prototype below, write the definition of the function find that will find a particular value (val) in a bitmap (s). The function should return the value true if val is found and false if val is not found in the bitmap. If val is found, the parameters row and col indicate the row and column where val was found (only the first occurrence of val is reported). const int ROWS = 10; const int COLS = 40; struct bitmap { int map[ROWS][COLS]; int numRows; int numCols; }; bool find (const bitmap s, const int val, int &row, int &col); Part 4 Arrays 38. State what happens in memory when the statement char x[10]; is executed. 39. Can an array contain elements of different types? 40. Define a 3 by 5 array of string. Call it nameTable. 41. Declare the array score of size 100 and type double, and initialize its first 5 elements to 1, 3, 5, 7, 9 and the remaining elements to 0. 42. Declare the array X of size 100 and type int. Using a for loop, initialize its elements to 3, 6, 9, 12, 300. 43. Declare the array Y of size 100 and type int. Using a for loop, initialize the elements of the array with even indices to 2 and the ones with odd indices to 3. 44. Consider the one-dimensional array t declared as int t[100]. Write single statements that perform the following operations: a) Initialize the elements of the array to zero b) Add 2 to every element the of array c) In one statement, declare the array score of type int and size 1000 and initialize its first three elements to 5, 10, 15 and the remaining elements to 0. 45. Consider a 4 by 10 integer array t. a) How many elements does t have? b) Write a nested for structure that initializes each element of t to 3. c) Write a statement that prints out the elements of the first row of t. d) Write a statement that prints out the elements of the second column of t. Part 5 Structure and Class 46. A car is described by its make, model, and year. Define a struct named structCar to store such information about a car. 47. Answer parts a-c based on the following code: class Cjar { private: const int increment; int count; string label; public: void set(string plabel); // set label to the value of plabel int get()const; // return the value of data member count }; a) The code below is the body of the implementation of member function get(). What is the error in it, and why is it an error? // body of function get() { count += increment; return count; }; b) Implement the constructor for Cjar. It should set increment to 1, count to zero, and label to "?????". c) Assume Cjar is correctly defined/implemented. The following code is from a client of the Cjar class. If there are errors, identify them. All required include files have been included. // code from client of Cjar const Cjar jar1; Cjar jar2; cout << jar1.get() << jar2.get(); jar2.set("Pickles"); 48. Fill in the blanks. #include <iostream> #include <string> class Customer { public: string FirstName; // customer first name string LastName; // customer last name int IdNumber; // customer unique ID int AcctNumber; // customer account number double AcctBalance; // customer account balance }; int main() { Customer john; cout << "Enter customer ID number" << endl; cin >> _____________________; cout << "Enter customer first and last name" << endl; cin >> _____________________ >> _____________________; return 0; } 49. Consider the struct Sstudent. It has two data members: name (a string), and GPA (a double). Suppose that we declared s to be an Sstudent. Write C++ code to print the name of s and the GPA of s. 50. Write a class declaration for a class called herd which represents a herd of dairy cows. This class should have a private variable to represent the size of the herd and two public member functions, one of which will set the size of the herd, and the other which will return it. You do not need to implement these functions. Choose appropriate variable types, function names, parameter types, return types, etc. 51. Write the declaration for a class called Box which can contain up to MAX_SIZE objects of type Toy. Assume that class Toy and the constant MAX_SIZE have been correctly defined. You should be able to put Toy objects into the Box, take objects out of the Box, search for a specific Toy, and find out how many Toys are currently stored in the Box. You do not need to implement any of the member functions. Part 6 Tracing 52. What's wrong with the following code? double x; int y[10]; for (int i=0; i<10; i++) { cin >> x; y[i] = x; } 53. What's wrong with the following code? double x[10]; for (int i=0; i<=10; i++) cin >> x[i]; 54. What are the values of x and y after the following code is executed? int x = 17, y; x = x / 3; y = x % 3; 55. What are the values of x, y, and z after the following code is executed? int x = 19, y, z; x += 2; y = x++ % 3; z = --y; 56. Assume that x = 0, y conditions? a) (x < y) && (z b) (x <= y) || (y c) (w < z < y) d) (x < y) && ((y = 3, z = 5, and w = 8. What is the truth value (true/false) of the following != w) > z) + z) == w) 57. What is the value and data type of each of the following expressions? a) static_cast <int> (16.8) / 2 * 3; Type = _______ Value = _______ b) 20.0 - 36 / 9 * 4 % 4 + 1; Type = _______ Value = _______ 58. What exactly will be printed by the following code? int x = x += 2; y = ++x z = y++ cout << 10, y, z; % 5; * 2; "x = " << x << " y = " << y << " z = " << z; 59. What is the value of x after each of the following statements is executed? a) x = floor ( fabs (-9 + ceil (-4.5))); //ceil(-4.5)= 4.0; fabs(-13.0) = 13.0; floor(13.0)=13.0 b) x = fabs ( 1 + ceil (3.2)); //ceil(3.2) =4.0; fabs(1+4.0) =5.0 c) x = floor (1.23456 * 1000 + 0.5) / 1000; //floor(1234.56+0.5)/1000 = floor(1235.06)/1000 = 1...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Christopher Newport University - PHYS - 151
PHYS 151 INTERMEDIATE PHYSICSInstructor: Dr. Edward J. Brash Email: edward.brash@cnu.edu Tel. 594-7451 Office: Gosnold 112A Office hours: Tuesdays 4:00-5:00 pm, Wednesdays 2:30-3:30 pm, Thursdays 4:00 5:00 pm; and by appointment.Prerequisites:
Christopher Newport University - CPSC - 230
CPSC 230 Exercise/Home Work Review 3 Stream 1, 2 and 3; Structure ; Class 1, and 2 . Department of Physics, Computer Science and Engineering Christopher Newport UniversityQuestion 1 For each of the following, write a single statement that performs
Christopher Newport University - CPSC - 230
Exercise/Home Work Class 4 (Solution) CPSC 230 (Lecture 34) Department of Physics, Computer Science and Engineering Christopher Newport University Question 1 Object-oriented programming primarily focuses on the (a) classes. (b) functions. (c) variabl
Christopher Newport University - CPSC - 150
CPSC 150L Computers &amp; Programming I Laboratory required, 1 credits SYLLABUS Department of Physics, computer Science and Engineering Christopher Newport University Instructor: Contact Room: Telephone: Fax: Email: URL: Dr. Ming Zhang Gosnold 223 (757)
Christopher Newport University - CPSC - 230
CPSC 230 SCHEDULE Fall 2004WEEK 1 08/23/2004 LECTURE L01: Introduction of course *L02: Computers and flowchart *L03: Hello World! C+ L04_Problem solving using C + L05_Arithmetic operations L06_Completing the basic L07_Mathematics library L08_Selecti
Christopher Newport University - CPSC - 230
Exercise/Home Work Class 1 CPSC 230 (Lecture 31) Department of Physics, Computer Science and Engineering Christopher Newport University Question 1 Modify the Time class to include a tick member function that increments the time stored in a Time objec
Christopher Newport University - CPSC - 150
CPSC150 Computer Programming Course Schedule Spring 2009 Prof. Ming Zhang, PCSE, Christopher Newport Universityweek 1 01/19 2 01/26 3 02/02 4 02/09 5 02/16 LECTURE Chapter 1: Introduction of Course and Java Chapter 2: Elementary Programming Chapter
Christopher Newport University - CPSC - 230
Exercise/Home Work Class 2 CPSC 230 (Lecture 32) Department of Physics, Computer Science and Engineering Christopher Newport University Fill in the blanks in each of the following (Question 1 to 9): Question 1 The keyword _ introduces a structure def
Christopher Newport University - CPSC - 230
Exercise/Home Work Function 4 CPSC 230 (Lecture 19) Department of Physics, Computer Science and Engineering Christopher Newport University Question 1 Computers are playing an increasing role in education. Write a program that will help an elementary
Christopher Newport University - CPSC - 410
Time TableDr. Ming Zhang Department of Physics, Computer Science and Engineering, CNU(August 25 December 13, fall 2008)Monday08:00 - 09:15Tuesday5846 CPSC110-09 GOSN123 Office Hour Office Hour Office HourWednesdayThursday5846 CPSC110-09
Christopher Newport University - CPSC - 410
Course Outline CPSC 410 OPERATING SYSTEMSDr. Ming Zhang Department of Physics, Computer Science and Engineering, Christopher Newport UniversityWEEK 1 8/25 2 9/1 3 9/8 4 9/15 LECTURE L00: Operating system history L01: Computer system overview L02:
Christopher Newport University - CPSC - 410
AraFell ProjectBy: Joey PetersSystem Selection A video game Video games implement many OS principles Already working on the project Challenging Fun to makeAraFell Two-dimensional role-playing game Gameplay similar to SNES games Dynamic
Christopher Newport University - CPSC - 2
Windows 2000 - Distributed OS Features Part IIAngelo Cavone CPSC550 Distributed Operating Systems Spring 2001 Dr. ZhangIntroductionsssWindows 2000 Distributed Operating Systems Features Focus on Features of Windows 2000 Advanced Server and
Christopher Newport University - CPSC - 450
Windows 2000 - Distributed OS Features Part IIAngelo Cavone CPSC550 Distributed Operating Systems Spring 2001 Dr. ZhangIntroductionsssWindows 2000 Distributed Operating Systems Features Focus on Features of Windows 2000 Advanced Server and
Christopher Newport University - CPSC - 450
Artificial Neural Network Techniques For Estimating Heravy Rainfall From Satellite DataMing Zhang, Roderick A. Scofield NOAA/NESDIS/ORA 5200 Auth Road, Room 601 Camp Springs, MD 20746, USA Email: roderick.scofield@noaa.govPage 1ANSER System Inte
Christopher Newport University - CPSC - 450
Case Study: MachDavid Ramsey 3-17-2003 CPSC550Mach: OverviewMach is a microkernel that provides the most elementary services needed for an operating system. It is not a complete operating system. More advanced operating system functions are hand
Christopher Newport University - CPSC - 150
Chapter 5 MethodsBasic computer skills such as using Windows, Internet Explorer, and Microsoft Word Chapter 1 Introduction to Computers, Programs, and Java Chapter 2 Primitive Data Types and Operations Chapter 3 Selection Statements Chapter 4 Loops
Christopher Newport University - CPSC - 450
Neural Information SystemsFACEFLOW: Face Recognition System ANSER :Rainfall Estimating System THONN:Date Simulation SystemDr. Ming Zhang, Associate ProfessorDepartment of Physics, Computer Science &amp; EngineeringDr. Ming ZhangANSER System Inter
Christopher Newport University - CPSC - 230
CPSC 230 COMPUTERS &amp;PROGRAMMING I SYLLABUSINSTRUCTOR: CONTACT ROOM: TELEPHONE NUMBER: FAX: EMAIL: URL: Dr. Ming Zhang Gosnold 223, Christopher Newport University, VA 23606 (757) 594 7563 (757) 594 7919 mzhang@pcs.cnu.edu http:/www.pcs.cnu.edu/~mzhan
Christopher Newport University - CPSC - 150
Scale: M=Minor or No Importance; I=Important; E= Essential MI E CPSC150 Course Objectives 1 Gaining factual knowledge (Terminology, classifications, methods, trends) 2 Learning fundamental principles, generalizations, or theories 3 Learning to apply
Christopher Newport University - CPSC - 450
CPSC450/550 Operating systems II/Distributed Operating Systems Syllabus1SYLLABUS CPSC 450/550 OPERATING SYSTEMS II/DISTRIBUTED OPERATING SYSTEMS Department of Physics, Computer Science and engineering Christopher Newport UniversityINSTRUCTOR: CO
Christopher Newport University - CPSC - 450
Distributed Multimedia SystemsJames Maxlow March 24th, 2003Introduction This paper will cover the basic issues involved in the structure and implementation of distributed multimedia systems. As our computing world continues to become ever more con
Christopher Newport University - CPSC - 150
CPSC150 Assignment 3: HTML Table 2001 Christopher Newport University Comments to siochi@pcs.cnu.edu ASG PART Asg3 DUE DATE See course outlinePurpose practice analyzing a problem statement practice while loops practice functions practice increm
Christopher Newport University - CPSC - 150
CPSC150 EH121CPSC150 EH12Q1: Consider the code segment below. if(gender=1) { if(age&gt;=65) +seniorFemales; }/endif This segment is equivalent to which of the following? a. if(gender=1|age&gt;=65) +seniorFemales; b. if(gender=1&amp;age&gt;=65) +seniorFemales
Christopher Newport University - CPSC - 495
/* Part 1 Csh Numerical Computation * /* Csh Numerical Computation */ mzhang% @x = 1 + 1 @x: Command not found mzhang% @ x = 1 + 1 mzhang% echo $x 2 mzhang% @ x = $x + 2 mzhang% echo $x 4 mzhang% @ x += 4 mzhang% echo $x 8 mzhang% @ x+ mzhang% echo $
Christopher Newport University - CPSC - 150
CPSC150 EH071CPSC150 EH07Q1: Which of the following is a double-selection control statement? a.dowhile. b.for. c.ifelse. d.if. ANS: c. ifelse.Q2: Which of the following is not a Java keyword? a.do b.next c.while d.for ANS: b. nextQ3: What is
Christopher Newport University - CPSC - 495
/* /* /* */jg31.cc Using the stat system call John Gray p.31 &lt;stdio.h&gt; &lt;unistd.h&gt; &lt;sys/types.h&gt; &lt;sys/stat.h&gt; &lt;stdlib.h&gt; N_BITS#include #include #include #include #include #define3main(int argc, char *argv[]) { unsigned int i, mask = 0700; str
Christopher Newport University - CPSC - 495
/* Samples for UNIX Commands and Filters */ -NAME more -more - browse through a text fileSYNOPSIS /usr/bin/more [ -cdflrsuw ] [ -lines ] [ +linenumber ] [ +/pattern ] [ filename . ] AVAILABILITY /usr/bin/more SUNWcsu DESCRIPTION more is a filter
Christopher Newport University - CPSC - 150
Chapter 4 LoopsBasic computer skills such as using Windows, Internet Explorer, and Microsoft WordChapter 1 Introduction to Computers, Programs, and Java Chapter 2 Primitive Data Types and Operations Chapter 3 Selection Statements Chapter 4 Loops C
Christopher Newport University - CPSC - 450
AmeobaDesigned by: Prof Andrew S. Tanenbaum at Vrija University since 1981Ameoba Design PhilosophyComputers are rapidly becoming cheaper and faster s Widespread use and increasing performance in computer networks s Need for the ability to deal
Christopher Newport University - CPSC - 450
CORBA Case StudyBy Jeffrey Oliver March 2003History The CORBA (Common Object Request Broker Architecture) specification was developed in 1991 by the Object Management Group (OMG). The OMG was founded by eleven corporations to develop CORBA. COR
Christopher Newport University - CPSC - 450
FaceFlow: Face Recognition SystemDr. Ming Zhang, Associate ProfessorDepartment of Physics, Computer Science &amp; Engineering College of Liberal Arts and SciencesDr. Ming ZhangFACEFLOW (1992 - 2002)A computer vision system for recognition of 3-di
Christopher Newport University - CPSC - 450
A Data Simulation System Using sinx/x and sinx Polynomial Higher Order Neural NetworksDr. Ming Zhang Department of Physics, Computer Science and Engineering College of Liberal Arts and Sciences Christopher Newport UniversityThis research is supp
Christopher Newport University - CPSC - 450
Distributed Multimedia SystemsJames Maxlow March 24th, 2003Introduction Most multimedia is inherently time-based the arrival time and arrival order of data packets is important The Internet guarantees neither when transmitting data We dont jus
Christopher Newport University - CPSC - 450
Reducing Network LatencyPaul Johnson CPSC 550 21 APRIL 05UsinganIntelligentServicetoDetermine theCheapestCommunicationsPathProblemThevonNeumannbottleneckismadeworseby networking Thenetworkedinformationisjustanewlevelin thememoryhierarchy
Christopher Newport University - CPSC - 450
Neural Information SystemsANSER :Rainfall Estimating System THONN:Financial Date Simulation System FACEFLOW: Face Recognition system System Dr. Ming Zhang, Associate ProfessorDepartment of Physics, Computer Science &amp; Engineering Christopher Newport
Christopher Newport University - CPSC - 450
Case Study: ReplicationLibby Rasnick Christopher Newport University CPSC 550 Spring 2003Defining Replication Replication in distributed systems is the maintenance of copies of data at multiple computers as a technique for automatically maintainin
Christopher Newport University - CPSC - 450
CORBACase StudyJeffrey T. Oliver March 17, 2003CNU Class CPSC 550CORBA Case Study by J. T. Oliver 04/10/091ContentsHistory..3 Goal.3 Definitions..3 Features.4 CORBA IDL..4 GIOP.4 IIOP..4 CORBA Services.4 CORBA Naming Service..5 CORBA Even
Christopher Newport University - CPSC - 450
Adaptive-Neuron Artificial Neural Network FeaturesMing Zhang* PCSE, Christopher Newport University, Newport News, 1 University Place, Newport News, VA 23606, USA Shuxiang Xu School of Computing, University of Tasmania, Locked Bag 1 359, Launceston,
Christopher Newport University - CPSC - 450
CPSC450/550 Distributed Operating Systems 1/2ScheduleSpring 2008Dr. Ming ZhangCPSC 450/550 Operating Systems II/Distributed Operating Systems SPRING 2009, Dr. Ming ZhangWEEK 1 01/19 2 01/26 3 02/02 4 02/09 5 02/16 6 02/23 7 03/02 8 03/09 9 0
Christopher Newport University - CPSC - 450
Scale: M=Minor or No Importance; I=Important; E= Essential MI E CPSC450/550 Course Objectives 1 Gaining factual knowledge (Terminology, classifications, methods, trends) 2 Learning fundamental principles, generalizations, or theories 3 Learning to ap
Christopher Newport University - CPSC - 450
Case StudyCPSC450/550 Operating System II Department of Physics, Computer Science and Engineering Christopher Newport UniversityDue Date Between Week 10 to Week 11 Details see the CPSC450/550 Schedule Oral Presentation and Paper submitting Between
Christopher Newport University - CPSC - 450
CPSC450/550 Operating System IITechnical EssayDepartment of Physics, Computer Science and Engineering Christopher Newport UniversityTechnical Essay Due Date Week 15 Oral Presentation Week 15, during class time Aims To familiarize with the inter
Christopher Newport University - CPSC - 450
Case Study OnReal World Distributed Operating Systems SecurityMerv Wagner CPSC 550 24 Mar 03The purpose of this paper is to present a case study on distributed systems security from a real world operating systems perspective. History Distribute
Christopher Newport University - CPSC - 450
David Ramsey 3-17-2003 CPSC550 Real World Distributed Operating Systems: A Mach Case StudyMach is a microkernel that provides the most elementary services needed for an operating system. Due to this, it is not an operating system as such; its main
Christopher Newport University - CPSC - 450
ReplicationLibby Rasnick Christopher Newport University CPSC 550 Spring 2003Table of ContentsDefinition History Goals Features Structure How to Use Applications Benefits and Issues Cost of Replication Significant Points Summary ReferencesLibby R
Christopher Newport University - CPSC - 150
Chapter 8 Strings and Text I/OChapter 6 Arrays Chapter 7 Objects and Classes Chapter 8 Strings and Text I/O Chapter 9 Inheritance and Polymorphism 10.2, Abstract Classes 10.4, Interfaces Chapter 11 Object-Oriented DesignGUI can be covered after 10
Christopher Newport University - CPSC - 150
Chapter 7 Objects and ClassesChapter 6 Arrays Chapter 7 Objects and Classes Chapter 8 Strings and Text I/O Chapter 9 Inheritance and Polymorphism 10.2, Abstract Classes 10.4, Interfaces Chapter 11 Object-Oriented DesignGUI can be covered after 10.
Christopher Newport University - CPSC - 426
CPSC426JavaEH481Exercise/Homework EH48Q1: To evenly distribute fixed size components in a row using BoxLayout, use the method: a.createVerticalStrut(). b.createHorizontalStrut(). c.createVerticalGlue(). d.createHorizontalGlue(). ANS: Q2: To cr
Christopher Newport University - CPSC - 150
CPSC150 EH351CPSC150 EH35Q1: are synchronized communication threads. a. Files. b. Buffers. c. Interfaces. d. Pipes. channels betweenQ2:is an I/O performance enhancement technique. a. Buffering. b. Piping. c. Pushback. d. Transaction processi
Christopher Newport University - CPSC - 150
CPSC150 EH231CPSC150 EH23Q1: Using the protected keyword gives a member: a.public access. b.package access. c.private access. d.block scope. Q2: Every class in Java, except _, extends an existing class. a.Integer. b.Object. c.String. d.Class.Q
Christopher Newport University - CPSC - 150
CPSC150 EH171CPSC150 EH17Q1: Consider integer array values, which contains 5 elements. Which statements successfully swap the contents of the array at index 3 and index 4? a.values[ 3 ] = values[ 4 ]; values[ 4 ] = values[ 3 ];b.values[ 4 ]
Christopher Newport University - CPSC - 150
CPSC150 EH021CPSC150 EH02Q1: Which of the following is not a valid Java identifier? a.myValue b.$_AAA1 c.width d.m_x ANS:Q2: Which of the following cannot cause a syntax error to be reported by the Java compiler? a.Mismatched {} b.Missing */ i
Christopher Newport University - PHYS - 151
PHYS151/August 26, 2008/Gerousis 1PHYS151 Intermediate Physics IFall 2008Instructor: Dr. Gerousis Office Phone: 594-7603 Department Office: 594-7065 Office: Room 128 Gosnold Hall Email: gerousis@pcs.cnu.edu Office Hours: I will be available in my
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationHistory &amp; TechnologySome figures from Computer Organization&amp; Design, The Hardware/Software Interface Copyright 2007, Morgan Kaufmann PublishersOverviewnComputer History 1st Transistor 1st Integrated Circuit (IC)
Christopher Newport University - ULLC - 100
1TE4ET A1 VOL E G6MI NCROWAVES7EL2TS E L ES T E I A I N T3MA X W E L R5MA R C O N A T IILLION6SA TE C T C T R I C O N I C2MOR A P H7ELE L L3PH4ON YSCILLONS
Christopher Newport University - PHYS - 151
Vectors and ScalarsChapter 3 Vectors A Scalar is a physical quantity with magnitude (and units). Examples: Temperature, Pressure, Distance, Speed A Vector is a physical quantity with magnitude and direction: Displacement: Washington D.C. is ~
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 5-III The Processor Datapath and ControlWhy a single-cycle implementation is not used today?n nnn nnnnSingle-cycle design can work correctly. However, it is not used in modern designs because it i
Christopher Newport University - ULLC - 100
OverviewComputer History 1st Transistor 1st Integrated Circuit (IC) 1st MicroprocessorULLC 100History &amp; TechnologyComputer Technology Chip Manufacturing Process World's Smallest Working Silicon Transistor World's Fastest Silicon Transisto
Christopher Newport University - CPSC - 330
MIPS Technologies CPSC 330 Computer OrganizationChapter 2-I Instructions: Language of the computerMIPS is the #1 architecture in several high-volume, high-growth market segments Boxes shipped with MIPS-Based Silicon Cable STB 75% Digital STB 40%
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 3-II Arithmetic for computers ALU designARITHMETIC LOGIC UNIT (How many bits?)ACC to Data BusENBufferLoad PathStore Path44Load ACCACCEN+4Data BusBAALUControl Unit (FSM) +ALU Control