New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer science
systems analysis design
C# Programming From Problem Analysis To Program Design 5th Edition Barbara Doyle - Solutions
Which of the following would store an integer in a binary file?a. Write7BitEncodedInt( )b. WriteInt( )c. WriteLine( )d. StoreInt( )e. none of the above
StreamReader is a direct descendent of:a. MarshalByRefObjectb. Objectc. Filed. TextReadere. IO
Streams can be used in C# for writing data to:a. text filesb. networksc. memoryd. binary filese. all of the above
To make a duplicate copy of a file, you could use a static method in the class:a. Fileb. StreamWriterc. Streamd. TextWritere. BinaryWriter
What method in the StreamReader class retrieves a full line of text-up until the newline character is encountered?a. Flush( )b. ReadBlock( )c. Retrieve( )d. ReadLine( )e. Peek( )
Using the verbatim string, you could write the full path of C:\CSharpProjects\ Ch13\WorkDirectory as:a. @"C:\CSharpProjects\Ch13\WorkDirectory"@b. @"C:\\CSharpProjects\\Ch13\\WorkDirectory"c. @"C:\CSharpProjects\Ch13\WorkDirectory"d. "@C:\CSharpProjects\Ch13\WorkDirectory"e. none of the above
In Visual Studio, if you do not specify the full path of a file, what directory is used?a. C:\b. the project directoryc. C:\App_Datad. bin\Debuge. C:\WorkDirectory
Which of the following is an abstract class?a. DirectoryInfob. Streamc. StreamReaderd. all of the abovee. none of the above
To append data onto the end of a text file:a. use the AppendStream classb. add the Append argument to the constructor for the FileStream classc. add the Append argument to the constructor for the StreamWriter classd. add true as the second argument (Append) to the StreamWriter classe. open the file
The members of the _______________ class allow you to create, move, copy, and delete files.a. Fileb. FileInfoc. Directoryd. DirectoryInfoe. File and FileInfo
To which namespace does the File class belong?a. Objectb. System.FileSystemc. System.Objectd. Object.IOe. System.IO
The File class:a. has only instance members, so to call one of its methods you must have an objectb. has only instance members, so to call one of its methods you must use the class namec. has only static members, so to call one of its methods you must have an objectd. has only static members, so to
When you are finished processing a text file, you should:a. call the Finished( ) methodb. call the Close( ) methodc. throw an exceptiond. erase the filee. reset the file
Which class allows you to use the Write( ) and WriteLine( )methods to write data to a text file?a. TextWriterb. FileWriterc. BinaryWriterd. StreamWritere. File
Which class allows you to use the Read( ) and ReadLine( ) methods to retrieve data from a text file?a. TextReaderb. FileReaderc. BinaryReaderd. StreamReadere. File
To avoid an IOException exception with files, you can either use a try. . .catch block or make sure there is a file before attempting to read characters from it. This can be done by:a. calling the File.Exists( ) methodb. using a loop to cycle through the file structurec. throwing an exceptiond.
One difference between the DirectoryInfo class and the Directory class is:a. Methods of the Directory class allow you to move directories and files; DirectoryInfo does not.b. The DirectoryInfo class also has public properties.c. The DirectoryInfo class is a static class.d. The Directory class
All of the following are exception classes that are thrown in conjunction with files, except:a. DirectoryNotFoundExceptionb. EndOfStreamExceptionc. InvalidDataFileExceptiond. FileNotFoundExceptione. IOException
Create a BankAccount class that can be used to maintain a bank account balance. Include appropriate constructors, properties, and methods to enable the account to be originally created and for amounts to be deposited and withdrawn for the account. Write the NegativeException class to extend the
Write an application that can be used to count the frequency of characters in a paragraph. Allow the user to input several sentences using a graphical user interface. Display the count for nonzero characters.Use an array as part of your solution. Include appropriate exceptionhandling techniques so
Revise the calculator application created in Exercise #7 to enable decimal values to be entered. Recall that an exception is not automatically thrown by the CLR when the divisor operand is a non-integral value.Create a custom exception class that can be thrown if division by zero is attempted. If
Create a Windows application that has the functionality of a calculator and works with integral values. Allow the user to select buttons representing numeric values. If the user attempts to divide by zero, throw and handle an exception.
Create a multi-class solution that includes a WeightConverter class.The WeightConverter class should be used to convert standard weight measurements. In your list of options, include as a minimum grams, kilograms, pounds, and ounces. Create an application class to test the WeightConverter class. If
Create a multi-class solution that includes a Fraction class. Fraction should have data members of numerator and denominator and be used to represent the ratio of the two integer values. Include appropriate constructors, properties, methods, and a ToString( ) method that returns a fraction using
Include exception-handling techniques with the traditional averaging program. Allow the user to input multiple sets of scores. Ensure that only numeric values are entered and that values fall between 0 and 100.Calculate the average for each set of values. Test the result to determine whether an A,
Create a multi-class solution that can be used to calculate body mass index (BMI). The BodyMassIndexCalculator class should have data members of weight and height. Write an application that lets users enter their weight and height in feet and inches. Calculate their BMI.Include appropriate
Design an application that enables users to enter two values of type int. Write a method that retrieves the values and stores them and their products in separate structures. If you are designing a Windows application, you might allow the user to input the values in a TextBox and then retrieve and
Write an exception tester application that enables you to see the impact of exceptions being thrown. Include multiple catch clauses. Include in our investigation the ArithmeticException, FormatException, IndexOutOfRangeException, and Exception classes. For each exception, write a try block
If an application is written to filter Exception, ArgumentException, IndexOutOfRangeException, and ArithmeticException, does it matter which order they should be listed? If so, what is the order?
Give one example of what would cause an IndexOutOfRangeException exception to be thrown.
Give one example of what would cause a FormatException exception to be thrown.
Give one example of what would cause an ArithmeticException exception to be thrown.
The result of division by zero is undefined for both integral and floatingpoint values. Describe how avoiding floating-point division by zero differs from integral division by zero.
The ApplicationException class is derived from:a. Systemb. SystemExceptionc. System.Exceptionsd. ExceptionApplicatione. Exception
The primary difference between using Step Into and Step Over is:a. Step Into halts at the last line of code inside a called method.b. Step Over halts at the first line of code inside a called method.c. Step Over steps into the most deeply nested method.d. Step Over executes the called method and
The Debugger in Visual Studio offers all of the following options for stepping, except:a. Step Intob. Step Overc. Step Outd. Step Throughe. none of the above
Which of the following lines contains information regarding a thrown exception named e?a. e.Messageb. e.ExceptionTypec. e.ExceptionInfod. e.ExceptionMessagee. e.Information
If a method throws an exception and the exception is not caught inside the method:a. The program automatically crashes.b. The rest of the program is executed, but the program statement(s)that caused the problem is skipped.c. An exception is thrown.d. The method execution returns to the first line
A marker that is placed in an application, indicating the program should halt execution when it reaches that point, is called a(n):a. exceptionb. debuggerc. watchd. pausee. breakpoint
The Debugger can be used to:a. observe syntax errorsb. rewrite the grammar for the programc. review what the output should bed. step through an applicatione. none of the above
C# Language Specifications are:a. the authoritative source for C# grammarb. the specifications that detail information on all aspects of the languagec. the authoritative source for C# syntaxd. available for a free downloade. all of the above
_____ errors are the easiest to discover and correct.a. Exceptionb. Compilerc. Run-timed. Logice. Omission
Two major types of errors found in programs are:a. compiler and syntaxb. compiler and exceptionsc. logic and grammard. compiler and run-timee. exceptions and logic
Writing a catch clause without including the parentheses and an argument list such as catch { }:a. generates a syntax errorb. requires a finally clausec. has the same effect as catch (Exception) { }d. throws an exceptione. none of the above
To avoid an exception with files, you can use a try. . .catch block and include which exception class in your catch clause?a. File.ExistsExceptionb. IOExceptionc. FileExceptiond. ExceptionFilee. none of the above
If an application is written to filter several exceptions including Exception, DivideByZeroException, and ArithmeticException, in what order should they be listed?a. Exception, DivideByZeroException, then ArithmeticExceptionb. Exception, ArithmeticException, then DivideByZeroExceptionc.
What type of exception would be thrown if the following arithmetic were performed?double aValue = 0, bValue = 0;int result = (int) aValue / (int) bValue;a. FormatExceptionb. Invalid.CastExceptionc. ArgumentExceptiond. DivideByZeroExceptione. none of the above
What type of exception would be thrown if a program statement attempted to access location 0 in an array defined to hold 20 elements?a. FormatExceptionb. Invalid.CastExceptionc. NullReferenceExceptiond. IndexOutOfRangeExceptione. none of the above
What type of exception would be thrown if the user enters the wrong type of data when requested from the keyboard?a. FormatExceptionb. Invalid.CastExceptionc. NullReferenceExceptiond. IndexOutOfRangeExceptione. ArithmeticException
The segment of code that might create an unexpected problem should be:a. placed in a try blockb. placed in a catch blockc. placed in a finally blockd. placed on the outside of the try. . .catch. . .finally blocke. included in the Main( ) method
A Just-In-Time Debugging window is displayed when a(an):a. application is executedb. unhandled exception is thrownc. handled exception is thrownd. unhandled exception is caughte. handled exception is caught
Raising an exception is the same as:a. catching an exceptionb. trying a block of code that might create an exceptionc. throwing an exceptiond. defining a new exception classe. rolling back an exception
_____ are unexpected conditions that happen very infrequently.a. Bugsb. Conditionsc. Streamsd. Exceptionse. Objects
Create a housing application for a property manager. Include a base class named Housing. Include data characteristics such as address and year built. Include a virtual method that returns the total projected rental amount. Define an interface named IUnits that has a method that returns the number
Define an application to include classes for Student, GraduateStudent, and UndergraduateStudent. Create .DLL files for the three classes. Include characteristics in the Student class that are common to GraduateStudent and UndergraduateStudent students. All three classes should override the
Create a base class titled ReadingMaterial. Include subclasses of Online, Book, and Magazine. Design your classes so that common characteristics are placed in the ReadingMaterial class. Provide the unique characteristics of the subclasses in the derived classes. Define an interface called
Create a base class for a banking account. Decide what characteristics are common for checking and saving accounts and include these characteristics in the base class. Define subclasses for checking and savings. In your design, do not allow the banking base account to be instantiated—only the
Modify your solution for Exercise 5 so that the source code files for each of the classes you designed are available for edit within the solution project.Enhance the solution by defining an interface for the sporting teams relating to budgeting. Any teams that implement the interface must provide
Provide a test class to demonstrate that your design of a base team class and individual sporting team subclasses works. If you completed Exercise 4, provide a reference in your project to the DLLs you designed for Exercise 4; otherwise create the classes for this exercise. Your test class can be a
Include unique characteristics about the sport. For example, for a sporting team such as a tennis team, the field location and/or the person to contact to restring rackets may be of interest.Be sure to implement any virtual methods included in the base class. Provide ToString( ) methods in both
Select two types of sporting teams and define subclasses for them. If you are using Visual Studio to develop your solution, use the class library template. These classes should inherit from a base team class such as that created in Exercise
Create a base class to hold information about sporting teams on campus.If you are using Visual Studio to develop your solution, use the class library template. Design the base class so that it is not possible to instantiate the class. Include characteristics you would find with all sports, such as
Create a base class to store characteristics about a loan. Include customer details in the Loan base class such as name, loan number, and amount of loan. Define subclasses of auto loan and home loan. Include unique characteristics in the derived classes. For example, you might include details about
Create a ticket reservation class for issuing tickets to on-campus events such as plays, musicals, and home basketball games. Design the ticket class so that it cannot be instantiated. Create subclasses for at least three different types of events. The subclasses should extend the ticket class.
Define the heading for a generic method ProcessData that has one generic parameter as part of its signature.
Provide new implementation details in the HourlyEmployee class for the method you defined in the preceding question (28).
Create a method in the Employee class to determine the pay amount.It should be capable of being overridden in subclasses.
Define a constructor for HourlyEmployee that sends the employee number to the Employee class when an object is instantiated. Are there any changes needed in the Employee class? If so, what?
Define a subclass named HourlyEmployee with additional members of hours and payrate.
Define a more useful constructor that could be used to instantiate objects of the class.
Define a default constructor for Employee.
Define a read-only property for the pay data member.
How does an abstract class differ from an interface?public class Employee{private int empNumber;private decimal pay;}Given the above program segment, answer Questions 23 through 30.
Explain the difference between an overloaded and an overridden method. Give an example of each.
A multitier application would probably have:a. a class defined to interact with the userb. one or more classes defined to handle the business logicc. a class defined to deal with the datad. a client classe. all of the above Exercises | 781
The feature that enables you to split source code between two or more files is:a. genericsb. base classc. dynamic link libraryd. partial classese. package
_____ allows a method of a class to be called without regard to what specific implementation it provides.a. Polymorphismb. Abstractionc. Assembliesd. Versioninge. Class libraries
Interfaces can include:a. data membersb. abstract methodsc. nonabstract methodsd. propertiese. all of the above
Abstract classes can include:a. data membersb. abstract methodsc. nonabstract methodsd. propertiese. all of the above
Classes can extend or derive from ______________ class(es) and implement ______________ interface(s).a. one, oneb. many, onec. many, manyd. one, manye. one, twelve
A class from which an object cannot be instantiated could be a(n):a. base classb. derived classc. implemented classd. virtual classe. abstract class
To avoid having to use fully qualified referenced classes, you could:a. Add a reference to the class.b. Add an import statement for the class.c. Add a using directive.d. Inherit from the class.e. Package the classes in the same solution.
The one constraint for having a solution include code from more than one programming language is the requirement that:a. Each project must consist of code in one language only.b. Each project must reference all the other projects.c. A using directive must be placed in the source code files for each
In .NET, applications are deployed in terms of:a. .dll’sb. .exe’sc. solutionsd. assembliese. applications
To enable derived classes to override methods defined in a base class, methods of the base class should be defined using a(an) ______________ keyword:a. virtualb. overridec. staticd. publice. none of the above
Constructors are normally defined with a ______________ access modifier; data members with a ______________ access modifier; and properties with a ______________ access modifier.a. public, public, publicb. private, private, privatec. public, public, privated. public, private, publice. private,
If you want to keep classes that instantiate objects of a class from changing their data members, but enable derived classes to change base class data members, the data members in the base class should be defined with a ______________ access modifier.a. privateb. publicc. internald. statice.
Using the following declaration, which of the following statements is true?public class aClass : bClass, IClassa. IClass is an interface.b. aClass is the derived class.c. bClass is the base class.d. all of the abovee. none of the above
In C#, the super class, or base class of all others, is:a. superb. basec. valued. classe. object
The “is a” relationship is associated with:a. inheritanceb. interfacesc. polymorphismd. encapsulatione. all of the above
Polymorphism is useful in languages because it facilitates ______________ methods:a. overridingb. overloadingc. overstrikingd. interfacinge. inheriting
Components are normally compiled and stored with a file extension of:a. .exeb. .snoc. .projd. .dlle. .csc
To be considered a true object-oriented language, designers of the language must provide support for:a. propertiesb. objectsc. inheritanced. IDEse. command-line tools
Packaging data attributes and behaviors into a single unit so that the implementation details can be hidden describes an object-oriented feature called:a. abstractionb. inheritancec. objectsd. encapsulatione. polymorphism
What output is produced by the following code?int i;int [ ] anArray = new int [5];for (i = 0; i < anArray.Length; i++)anArray[i] = 2 * i;for (i = 0; i < anArray.Length; i++)Write(anArray[i] + " ");a. 22222b. 246810c. 0246810d. 02468e. none of the above
Using the above declarations, use a member of the Array class to locate the index in the bArray array where 14 is stored.
Using the above declarations, use a member of the Array class to order the values in the bArray array in ascending order.
Using the above declarations, use a member of the Array class to change the order of the elements in the bArray array. The contents of the first cell should hold what was in the last cell. The second cell should hold what was in the next to last cell.
Create array declarations for the following problem specifications.a. An array to hold the names of five font strings. Initialize the array with your favorites.b. An array to hold 12 state names. Initialize with the 12 states closest to your campus.c. An array to hold the 10 most common single
Explain the difference between the pass by reference and pass by value.When an array is sent to a method, which one is used?
Showing 400 - 500
of 5433
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Last
Step by Step Answers