Systems Analysis

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is the result of the code int a = 13; int b = a * (1/2);

0

When using a loop to compute the sum of all numbers in an array, we should, before the loop, declare a variable and initialize it into

0

How many steps does the following loop go through before it breaks?

1

When using a loop to compute the multiplication of all the numbers in an array, we should, before the loop, declare a variable and initialize it into

1

Which two of the following functions have identical signatures? 1. void Move(int z, int y) 2. bool Move(int a, int b) 3. void Move(double x, double y) 4. bool Move(int a)

1 and 2

Assume the database has information about student registration and course offerings. What inputs does the process need to check whether a student has time conflicts to take another class? 1.student ID of the student who is going to take the class 2.class ID for the class to take 3.the available time of the students 4.the name of the tables for student registration and course offerings

1 and 2 only

Which of the following is the correct way to define and initialize an array of 4 integers 1. int[] a = {25,30,40,5}; 2. int[] a; a[0] = 25; a[1] = 30; a[2] = 40; a[3] = 5; 3. int[] a; a = new int {25,30,40,5}; 4. int[] a; a = new int[4] {25,30,40,5}; 2. int[] a; a = new int[4]; a[0] = 25; a[1] = 30; a[2] = 40; a[3] = 5;

1, 4, 5

In order to check whether a student has met the prerequisites to take a new course, how many loops do we need in the activity diagram to model the logic?

2

BizByOrder Books is specialized in ordering books for two types of customers: individuals and businesses in lower Manhattan. This is how these two different customers are different. When an individual customer orders books, he or she has to pay 100% down payment. A business customer can establish a credit line with BizByOrder and pays 50% down if and only if the order amount exceeds its credit limit. The bookstore orders its books through five national distributors. Because of various special agreements in the book industry, each publisher sells its books exclusively to one distributor. Each time when a customer comes, the bookstore uses its database system t find the title and locate the distributor. Then the cashier takes the order and a down payment (if needed) and send the order to a distributor. When an order arrives, the customer will be contacted to pickup and pay the rest of the balance. Which ones are use cases. 1. Serve Customer 2. Order Books 3. Credit Line 4. Collect Payment 5. Locate Distributor 6. Search for books 7. Setup Vendor Agreement

2, 4, 6

What is the following loop correctly prints the elements of the array?char[] arr = new char [] {'k', 'I', 'c', 'I', 't'};

2: foreach( int I in arr) { Consol.writeLine((char) I ); }

Which two of the following functions have identical signatures 1. List<int> Factorize() 2. List<int> Factorize(int a) 3. List<int> Factorize(long x) 4. List<int> Factorize(long b)

3 and 4

What is the final value of variable y? Int x = 24; Double y = x/5;

4

What is the result of FibArray[1] after running the following for-loop code? Int[] FibArray = {1,2}; For(int I = 2; 9 <4; i++) { FibArray[1] = FibArray[1] + FibArray[0]; FibArray[0] = FibArray[1] + FibArray[0]; }

5

If one exceptional flow needs to branch out of the step 3 of the alternative flow labeled 6a, then it should be labeled as

6a.3a

Object A can send a message to object B

A -->B A--B

Conceptually, an actor is

A class

Which statement is true about a conceptual class

A class is a collection of all objects of the same type

An abstract class is which of the following?

A class that has no direct instances, but whose descendants may have direct instances

In structured methodology, the basic unit of reusable program is?

A function

A decision node usually allows one flow in and multiple optional flows out. However, when using IBM Rhapsody, if there is an out flow eventually comes back to the decision node, Rhapsody will turn the decision node into

A node representing a for- loop

Create a Account class that has data members balance and method Debit(double x) Code A: Public class Account { Private double balance; Public void Debit (double x) { Balance = balance -x;}} Code B: Public class Account() { Public double balance; Public void Debit(double x) { Balance =balance - x; }} Code C: Public class Account { Protected double balance; Public double Debit(double x) { Balance = balance -x; }}

A only

StreamReader myReader = File.OpenText("myFile.txt"); Which of the following is the correct code to find a line in myFile.txt that contains word windows? Note a.IndexOf(b) return the position of text b in text a or -1 Code A: StreamReader r = File.OpenText("myFile.txt"); String aLine = r.ReadLine(); While(aLine! && aLine.IndexOf("Windows") <0) aLine = r.ReadLine(); return aLine; Code B: StreamReader r = new StreamReader("myFile.txt); While (r.ReadLine(). INdexOf("Windows") >=0) break; Return r.ReadLine();

A only

Which of the following is the correct code to open the text file myFile to read its 5th line? Code A: StreamReader r = File.OpenText("myFile"); String line; For(int I = 0; I <5; i++) line = r.ReadLine(); Code B: StreamReader r = File.OpenText("myFile"); Int n=0; While (n<5) {line = r.ReadLine();

A only

You have been hired a design a system for a small health care organization to improve or automate some portions..... Which situations are modeled using inclusion use cases?

A: A clerk checks patients in and assign examination rooms C: A physician writes diagnostic notes and creates prescriptions D: A clerk enters the new billing data into the system, collects any payment and prints a list of charges and a receipt

Example situations to demonstrate the advantage of inclusion use cases:

A: Both return and checkout will need to handle payments D: both check out and return scan items and come up with the total payment

Which pair of use cases may be modeled as inclusion relationships

A: Checkout and collect payments E: Checkout and scan items

In a sequence diagram for Post Grade use case, you have two instances: James:ProfessorActor and James:Professor, which is their difference?

A: James:ProfessorActor is a real person while James:Professor is an abstraction of the real person B: ames:ProfessorActor is a outside the system while James:Professor is part of the system

If a step needs to refer to a user interface

A: List the user interface in a separate section of the same use case document

In the following sequence diagram, between "Open()" and "Scan()" messages, some messages appear missing,. What do you think the messages should be about?

A: for order screen to be displayed properly, it needs to get information about the order

A collaboration takes _ objects to _ to each other for help in order to perform a use case

A: one or more objects....send messages

Among the three principles on user interface design, which of the following are implied by Character Principle

A: size, location and look of each visual control must be consistent throughout the system B: size, location and look for each visual control must be visually sound

What are examples of generalization/specialization relationship between use cases?

A:withdraw money and withdraw cash E: Check out and Return Orders

Identify the class name for the following code: ABC123 crs = new ABC123();

ABC123

Which of the following relationships should be modeled with aggregation?

Account--Customer CourseSection--Student Professor--CourseSection

Which of the following relationships should be modeled with composition?

Account--Transaction Dependent--Employee Course--College

The following code validates users using a text file, but there is an error. Point out the error. Bool Validate(string usr, string pwd, string file) { StreamReader r = File.OpenText(file); String aLine; String [] u; Bool found = false; aLine = r.ReadLine(); while(aLine != null) { u=aLine.Split(','); If((usr ==u [0]) && pwd == u[1])) { found = true; } Else { aLine = r.ReadLine(); } r.Close(); return found; }

After 'found = true;' should be 'break;' or 'return found;' to prevent an infinite loop

In which of the following situations, you will use a join node?

After checking time conflicts and prerequisites in parallel we need to decide if it is okay to enroll a course

In which of the following situations, you will use a decision node?

After finding out the car to be reserved is not available, we need to present with a choice to the customer

In which of the following situations, you will use a fork node?

After getting a list, we cut the list into three sections and find the maximum number for each section

What does an integrated CASE tool do

All of the Above Draw Diagrams Translate business models into computer specifications Reverse Engineer code

Which role does a systems analysis play?

All the Above A communicator between end users and programmers A psychologist who read people's mind An architect who designs or redesign business processes

What does an integrated CASE tool do?

All the above Draw Conclusions Translate business models into computer specifications. Reverse Engineer code

What is not true about the formation of a project team for systems development

An end user can talk to a program directly

What is not true about the formation of the project team for systems development?

An end user can talk to a programmer directly.

Which statement is true about an object

An object is any real world object that has both data and behavior

Assume two classes are related as follows: Author(0..*)—Book(0..*). Where do you house the operation that search for books by author name?

Another class that holds a list of all book objects

Assume classes are related as this: Author(*) - (*) Book. Which class should hold the operation that can print a list of books written by an author?

Author

If a customer calls in to make a request and a customer service representative key is in, which one is the primary actor

B CSR

What is wrong with the following sentence in describing use case "check out" books in a library system? ... 4.Each book is scanned 5. Information is retrieved ...

B: Active voice should be used instead of passive one D: Missing subjects in the sentences

In which of the following situations, you will use a merge node?

B: After a customer choose one of three payment methods, we need to finish the transaction and print a receipt C: After consolidating three parallel actions, we need to go back to the beginning to re-perform the parallel actions

What is the correct operation or function head for the following process?

B: List<Course> getPrerequisites(string CNO) D: void getPrerequesistes(string CNO, out List<Course>I)

Which pair of use cases may be modeled using extension?

B: check out and handle coupons C: check out and exempt sales tax D: check out and adjust prices

To program the summation of the numbers 2+4+6+...+100 using for-loop, the step index increment or decrement should be

B: i=i+2 E: i+=2 D: i=i-2

In a sequence/collaboration diagram, each interaction between a user and the system has to be refined as

B: interactions between the user and one or more objects of the system

Example to demonstrate the advantage of extension uses:

B: managers can override fees while renewing membership C: advisers can override prerequisites while registering students into a class D: Cashiers can lookup inventory during checkout in a local department store

Which are examples of errors in use case documents?

B: missing artifacts such as business rules or messages D: a sentence has two or more interpretations

If a running condition prevents a use case from being successfully performed, how do you describe the condition

B: use Exceptional flows

Assume two classes are related as follows: Author(0..*)—Book(0..*). Where do you house the operation that finds a list of book authors?

Book

Assume two classes are related as follows: Author(0..*) - Book (0..*). Which of the following are true in their implementations?

Book class will have data members List<Author> authors Authors class will have data members List<Book> books

What is the correction operation or function head for the following process?

Bool checkTimeConflict( TimeSpan a, TimeSpan b)

You are developing a system for library staff and borrowers to check out, return, make reservations, locate items and track status. Who are the primary actors

Borrower Circulation Librarian

A printer can be turn on and off and is used mostly for printing, and has certain characteristics such as Brand Name, Resolution, Speed and Capacity. Which are considered members?

Brand Name, Resolution, Speed, and Capacity

Which of the following is not included in RAD tools?

Business Rules

The following is a list of functions and attributes with their context. Which ones are functions?

C: "A title of a book" in a college library system E: "The grade point average (gpa)" in a registration system

If a step needs to reference a business rule such as a formula or a table

C: List the user interface in a separate section of the same use case document

To track an order status, the system should delegate which object to do it?

C: Order Object

The following is a segment of the basic flow is a use case, which steps may spawn off an exceptional flow? 5. The customer enters account pin 6. The system send the pin to the bank for verification 7. The bank validates the account 8. The system displays the menu screen 9. The customer chooses Transfer Money.

C:7

An order object has Order ID, order date, promised date, porder amount, status etc. as attributes. Which functions do you think should be included into the order object

Check for eligibility of an order for a discount rebate offered in a certain time Compute Lead Time Check Order Status

Which ones are use cases in a point-of-sale system

Check out Return Order

You are developing a system for library staff and borrowers to check out, return, make reservations, locate items and track status. What are the use cases?

Checkout books Return books

A and B are classes. A-->B will be implemented as

Class A { private B b;} and class B {//}

A and B are classes. A—B (maximum cardinality is 1 on both sides) will be implemented as

Class A {private B b;} and class B {private A a;}

A and B are classes. To implement the relationship that A is a parent of B, you should write C# code as

Class B: A{//} and class A{//}

Which of the following may not be a use case for Point-of-Sale systems used for cashiers to use

Compute Subtotal

What is a best object to house the following operation so that it involves a least number of parameters and also supports the responsibility of the object Get Flights(get a list of booked flights for a customer)

Customer

The following is a segment of the basic flow of a use case, which steps may spawn off alternative flows .. 5. The doctor selects a test procedure 6. The doctor picks a date and a time 7. The system display the selection or confirmation 8. The doctor confirms the selection 9. The doctor enters a note for the test

D- 8

The following is a segment of the description of a use case. Which ones are correct alternative or exceptional flows spawned off? 3a. invalid login .1 The system displays "incorrect login" message (PM1) .2 The system increments the error count .3 The system checks the number of entry errors .4 The system checks the number of entry errors .5 Go back to Step 2

D: 3a.3a Error count Exceeds Limit

The following is a segment of the basic flow of a use case, which steps may spawn off alternative flows? 5. The cashier presses payment button 6. The system displays payment screen 7. The customer swipes a credit card 8. The system retrieves the credit information 9. The system sends the charge for approval 10. The credit issuer approve the card

D: 8 and 10

In a sequence diagram, Object A sends a message "get prerequsites (cno)" to Object B. Then, in the class diagram, you should add the operation GetPrerequisites(sno string) to which class

D: B

Which of the following is not an interaction between a cashier and the checkout system

D: Customer loads a basket of items on the stand

What are correct about collaboration in object-oriented development?

D: No class should attempt to do everything E:Each class must do something, not do too much, not too little

Which of the following are not correct about collaborations and responsibilities?

D: Some classes can focus on providing data while others provide services

To check prerequisites in a student registration system, the system may best delegate the job to

D: Student Object E: Section Object

Among the three principles on user interface design, which of the following are implied by cognition principle?

D: User interfaces should not count on user's short time memory or mental math capacities E: User interfaces should accommodate user's perceptual biases

What models describe what functions are required in the structured methodology?

Data Flow Diagrams

An object is any real world entity that have both ___ and ___

Data and functions

A narrow view of information systems includes

Database and Business Applications

Declare a variable to hold your birth date

DateTime myBirthDate;

In order to prepare a memory block to hold a birth date, what do you need to do in code?

Declare a variable: DateTime birthdate;

Before you can use a variable for computing, what do you need to do first with the variable in code?

Declare the variable and then initialize the variable.

Assume PrimaryAuthor class has data member List<Book> books and Book class has a method GetRoyalty to find the amount royalty. Which of the following is the correct way to compute the total royalty paid to each primary author?

Double r=0; foreach(Book b in books) {r+=b.GetRoyalty();} Double r=0; for(int I =0; I <books.Count; i++) { r+=books[i].GetRoyalty();} Double r=0; int I =0; while(i<books.Count){r+=books[i].GetRoyalty();i++;}

Declare a variable to hold your county sales tax rate.

Double salesTaxRate;

BizbyOrder Books is specialized in ordering books for two types of customer: individuals and businesses in lower Manhattan. This is how these two different customers are different. When an individual customer orders books, he or she must pay 100% down payment. A business customer can establish a credit line with BizbyOrder and pays 50% down if and only if the order amount exceeds its credit limit. The bookstore orders its books through five national distributors. Because of various special agreements in the book industry, each publisher sells its books exclusively to one distributor. Each time when a customer comes, the bookstore uses its database system to find the title and locate the distributor. Then the cashier takes the order and a down payment (if needed) and send the order to a distributor. When an order arrives, the customer will be contacted to pick up and pay the rest of the balance. Create use case diagram with optimization.

E: A and C

What are examples between generalization and specialization use cases?

E: Deposit check and deposit money B: Approve loans and Approve account application D: Check in outpatients and Admit in-patient

You are developing a system for a library stuff and borrowers to check out, return, make reservations, locate items and track status. Both borrowers and library employees can checkout books, how do you assign the "check out" use case to a primary actor?

Employee --|> Borrower --- Checkout books

How will you complete the foreach loop in the C#.NET code snippet given below such that it correctly prints all elements of the array a? Int [][] a = new int [2][]; A[0] = new int [4]{6, 1, 4, 3}; A[1] = new int[3]{9,2,7}; Foreach (int[ ] I in a) { /* Add loop here */ Console.Write (j + " "); Console.WriteLine(); }

Foreach(int j in i)

In activity diagrams, in order to split one flow into multiple parallel flows, you will use

Fork

The following is a class diagram with associative objects for a hotel reservation system. What is the operation that lists the name of the customer who reserved a specific room on a specific date assuming the operation is placed into a right object?

GetCustomer(d.DateTime):string

What is a signature in the following? public double GetGPA(string sid){//}

GetGPA(string sid)

What are the basic members in a c# class

Global variables, properties, methods, and constructors

The following is a class diagram with associative objects for a hotel reservation system. Where should you put the operation to print the customer who had reserved a particular room on a specific date

HotelRoom

BizByOrder Books is specialized in ordering books for two types of customers: individuals and businesses in lower Manhattan. This is how these two different customers are different. When an individual customer orders books, he or she has to pay 100% down payment. A business customer can establish a credit line with BizByOrder and pays 50% down if and only if the order amount exceeds its credit limit. The bookstore orders its books through five national distributors. Because of various special agreements in the book industry, each publisher sells its books exclusively to one distributor. Each time when a customer comes, the bookstore uses its database system t find the title and locate the distributor. Then the cashier takes the order and a down payment (if needed) and send the order to a distributor. When an order arrives, the customer will be contacted to pick up and pay the rest of the balance. Which of the following are primary actors for the bookstore system? 1. Cashier 2. Store Manager 3. Customer 4. Vendor 5. Publishers 6. Distributors

I and II

What is wrong with the following while loop? Int x = 100; While (x>1) { X=x+1; }

Infinite loop

Declare a variable to hold the number of classes you are taking.

Int numberofClasses;

Describe the role of SQL in systems development

It is the language that bridges business applications and databases

Which ones of the following symbols must be used to represent the situation that the execution must follow several parallel paths

Join Node Fork Node

What is the correct way to use a List data structure to store a list of Employee objects

List<Employee> employees

what is the correct operation or function head for the following process

List<course>getPrerequisites(string CNO) void getPrerequisites(string CNO, out List<Course>I)

Which of the following model shows how data are organized in a database?

Logical Data Model

What are the deliverables of the analysis stage of the SDLC using structured methodology?

Models that capture user data and process requirements

Which operations/functions should be declared as void?

Ones that do not return any values back to the caller

What is a best object to house the following operation so that it involves a least number of parameters and also supports the responsibility of the object Get item Count(to find the number of items in an order)

Order

An activity diagram is an example of

Procedural Model

What of the following model shows how each process is performed in structured programming?

Procedural Model

The board of Watson town memorial hospital has recently decision to develop a new information system to manage their patient admission and discharge. The hospital handles two types of patients: outpatients and resident patient. As typical, each time when a new patient comes, the data about his/her identification, address, phone, and issuance carriers are recorded. If a patient is resident, he/she will be assigned a bed and an admission date is recorded. After the treatment, a nurse has to sign off the discharge card. For an outpatient, the nurse will set a check back time after each treatment. Which of the following should be modeled using associative objects?

Relationship between inpatient visit and bed

The following is Customer class with missing code for the function that checks if they customer has made the order 0 Public class Customer { Private string name; Private List<Order> orders; Public bool hasMadeOder(order 0) { // missing code }}

Return oders.Contains(o);

What does a prototype do in systems development

Show what the system looks and feel like

What does a prototype do in systems development?

Show what the system looks and feel like

Check all that Apply. To check if a number X is smaller than all the numbers in a list, what should we do?

Sort the list in increasing order and then pick the number to compare with X Use a for-loop to compare each item in the list with X Use a for-loop to find the min and then compare the min with X

Which object do you use to hold the data retrieved from a text file?

StreamReader

What object and function do you need to open a text file

StreamReader File

Which of the following is the correct code to open the text time myFile.txt to read?

StreamReader myReader = File.OpenText("myFile.txt");

Write the code to open text file "customer.txt" to read data from

StreamReader reader = File.OpenText(@"c:\customer.txt");

Which one is the code to open file "customer.txt" to write data to?

StreamWriter myWriter = new StreamWriter("customer.txt");

What is a best object to house the following operation so that it involves a least number of parameters and also supports the responsibility of the object? Check prerequisites (to check if a student has prerequisites to take a new course

Student Section

Assume the database has information about student transcripts and course catalogue. In order to check whether a student has the prerequisite to take a course, what input data do you need?

StudentID and course no

SDLC stands for

System Development Life Cycle

Which ones are use cases for a typical restaurant food order system

Take Order View Kitchen Order

When using a loop to compute the maximum of all the numbers in an array, we should, before the loop, declare a variable and initialize it into

The first item in the array

Operations or functions are used in both structured and object-oriented design methodologies. However, one problem associates with functions is reduced in object-oriented method. Which problem is it?

The function needs separate data inputs and outputs to work

What is wrong with the following method that returns the minimum of two decimal numbers? Double min(double a, double b, out double min) { If(a<b) Min = a; Else Min = b; }

The return type should be void

The following is correct code to loop through strap 1, 2, 3, ..., 50: For (int I = 1, I <= 50, i++) { // }

True

What does overloading mean

Two or more functions have the same name but different signatures

When using a loop to compute the variance of all the numbers in an array, we should, before declare and initialize

Two variables respectively for sum of the numbers and sum of the numbers squared

How do you model the relationship that some employees supervise other employees using a class diagram

Use recursive associations

In order to procedurally or logically determine whether two lists of names are overlapping, i.e., having identical entries, what should you do?

Using two nested for-loops and compare each item from list 1 to each item from list 2

Assume that temp is an int variable initialized to be greater than zero and that a is an array of ints. Consider the following code segment: For(int k=0; k < a.length; k++) { while (a[k] < temp) { a[k] *= 2; }} What of the following will cause an infinite loop?

Whenever a includes a value that is less than or equal to zero

What is the missing loop code in the following segment that processes a text file? StreamReader myStream = File.OpenText(@"c:\users.txt"); String aLine = myStream.ReadLine(); //missing loop code { //missing code to process aLine aLine = myStream.ReadLine(); } //missing cleanup code

While (aLine != null

What are the values of a and b after the loop finishes? Int a = 10, b =3, t; For (int i=1; i=6; i++) { t=a; a= i+b; b= t -i;

a = 13 and b = 0

WHat is a symbol for parallel processes

a solid black bar

In activity diagram, a rectangular box represents

action

What inputs do we need to perform the process of make a new doctoral appointment? 1. Patients ID 2.Doctoral ID 3.Date and Time 4.Reason for appointment

all of the above

To check if a student has time conflicts to take a new class, the problem is essentially to check if

any class time period for the new class is overlapping with any time period of any other class that student has already enrolled

Variables of which of the following type is appropriate to hold 100 orders

array of order objects

what is the correct operation or function head for the following process

bool checkOraConnection(string UID, string PWD, string Host_

what is the correct operation or function head for the following process

bool checkTimeConflict(TimeSpan a, TimeSpan b)

In order to check whether a state name is inside a list of names, before you use the loop to check each name inside the list, you should initialize the result variable as

bool result = false

In order to check whether a student has time conflicts to take a new course, how do we initiate the result variable before the loop(s)

bool result = false;

In order to check whether a student has met the prerequisites to take a new course, how do we initiate the result variable before the loop(s)

bool result = true;

Given two list of numbers, in order to check if all the numbers of in the first line are small than all the numbers in the second list, if you find one number in the first list is not smaller than one number in the second list, which loop does not have to continue

both loops

To check if a student has met all the prerequisites to take a new class, if we find one prerequisite is not taken by the student, what should we do algorithmically?

break both inner and outer loops

To check if a student has time conflicts to take a new class, what do you algorithmically if you find one class time period for the new class is overlapping with a class time period of another class that the student has already enrolled

break both inner and outer loops

To check if a student has met all the prerequisites to take a new class, if we find one prerequisites is already taken by the student, what should we do algorithmically?

break the loop for the list of the courses taken

user requirements include which two essential aspects

business processes and business data

Which of the following is not included in RAD tools

business rules

In an activity diagram, an arrow means

control flow

In activity diagram, a diamond node represent

decision merge

In activity diagram, to split one flow into several optional flows, you will use

decision node

When using IBM Rhapsody, which of the following symbol is used to represent for-loop construct

decision node

after adding items to a shopping cart, a customer must choose one method to pay for the order. In activities diagram, which node represents the situation

decision node

Assume there is an associate class Enrollment between Studetn and Section. Assume Enrollment has attribute grade and method ChangeGrade(string grade) to change grade. Assume you have the following attribute in Student Class Dictionary<Section,Enrollment>enrollRecords; What is the code to implement the operation void PostGrade(Section s, string grade)

enrollRecords[s].ChangeGrade(grade);

To check if a student has met all the prerequisites to take a new class, the problem is to check if

every prerequisites is in the list of courses that the students has taken

Describe the role of a systems analysis in a software development team

facilitate the communication between users and programmers

When using a loop to compute the maximum of all the numbers in an array, we should, before the loop, declare a variable and initialize it into

first item in the array

After finishing an order, the system needs to print a receipt, update inventory decrements, and update revenue increments. Assume these actions are independent of each other. In activity diagrams, which node represents the situation?

fork

The relationship among a function, operation and method is that the operation is ___ of a function and the method is ___ of a function

head ... body

Which one of the following is correct to check if two time periods are overlapping given public class Period { private DateTime beginTime; private DateTime endTime; Public bool Overlap(Period p) { // to be finished }}

if(this.beginTime <= p.endTime && p.beginTime <= this.endTime

Which of the following code will create an array of 4 integers

int[] myintegers = { 1,2,3,4}; int[] myintegers = new int [4];

In activity diagrams, in order to consolidate a few parallel flows into one flow, you will use

join

In activity diagrams, to merge or consolidate several optional flows that only one is followed into one flow, the notation to use is

merge node

Which of the following variable name are allowed in C#?

myAge

In the following code segment, what should be in the place of missing cleanup code? StreamReader myStream = File.OpenText(@"c:\users.txt"); String aLine = myStream.ReadLine(); //missing loop code { //missing code to process aLine aLine = myStream.ReadLine(); } //missing cleanup code

myStream.Close();

When using IBM Rhapsody, for a decision node representing for-loop for(int i =1; i < n; i = i+2){//} where do you specify the loop continuation expression "i<n"

name or make the decision node as "i<n"

To check if a student has met all the prerequisites to take a new class, if we find one prerequisites is already taken by the student, what should we do?

pick another prerequisites to check with the list of courses taken

To check if a student has time conflicts to take a new class, what do you do algorithmically if you find one class time period for the new class is not overlapping with a class time period for the existing classes that the student has already enrolled

pick another time period for the enrolled classes

Which of the following model shows how each process is performed in structured programing

procedural model

To check if a student has time conflicts to take a new class, which is the best to initialize the result variable, assuming the function return true if there is any conflicts

result = false

Given two list of numbers, in order to check if all the numbers of in the first list are small than all the numbers in the second list, which of the following is the best way to initialize the result variable before the loops

result = true;

To check if a student has met all the prerequisites to take a new class, what is the best way to initialize the result variable

result = true;

When using IBM Rhapsody, for a decision node representing for-loop for(int i =1; i < n; i = i+2){//} where do you specify the initialization expression "i=1"?

set the stereotype to FlowChartLoop and then enter i=1 as loop initialization

To check if a number X is smaller than all the numbers in a list, what should we do?

sort the list in increasing order and then pick the first number to compare with X use a forloop to compare each item in the list with x use a forloop to find the min and then compare the min with x

In order to create a memory block with a fixed number of sub-blocks that will store the different kinds of sata only, a variable of which of the following types is appropriate

struct

When using a loop to compute the variance of all the numbers in an array, we should, before the loop, declare a variable and initialize it into

two variables respectively for sum of the numbers and sum of the numbers squared

How do you compute (2.4)^5 and (3.6)^101 in C#

use Math.Pow() function

In order to procedurally or logically determine whether two list of names are overlapping i.e. having identical entries, what should you do?

use two nested for-loops and compare each item from list 1 to each item from list 2

what is the correct operation or function head for the following process

void findStat(List<double> data, out double max, out double mean)

The following code is to convert a 10-based integer 9823232 into 6-based integer using a while-loop, what is the condition that you will be using in the miss place? Int x = 9823232; String result = ""; While ( // your code here //) { result = x%6 + result; X = x/6; } Result = x + result;

x>=6


Ensembles d'études connexes

Legal Interpretations Affecting Contracts Ambiguities in a Contract of Adhesion

View Set

mbio 305 week 5 practice problems

View Set

Chapter 15: Assessing Head and Neck

View Set