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 4th Edition Barbara Doyle - Solutions
For the following table, identify which properties can be used to set the given values for the controls. Desired action Get the selected item from a ComboBox object Change the label over a group box Arrange the items in a list box in ascending order Change the color of the text in a label Change
From the following partial code listing, identify the name(s) of event-handler method(s)that would need to be written. To what object(s) are they wired? public class Question System.Windows.Forms.Form { : private System.Windows.Forms.Label label1; private private System.Windows.Forms. Text Box
Create a graphical user interface that allows the users to enter personal information such as their names, e-mail addresses, and phone numbers.Include a menu that provides a minimum of four features. The first displays the information entered by the user in a message box. The second clears the
Create a Windows application that can be used as a sign-up sheet for ski equipment for the Flyers Sports Club. The club has ski equipment that it makes available to members at a minimal charge. In an attempt to determine what type of equipment members might need for an upcoming trip, they have
Create a graphical user interface that can be used by a community group to enable youths to sign up for different sporting events. Include radio buttons with five different sport names. Only one of these should be selectable.Program your event-handler method so that a message is displayed with each
Create a Message Displayer that has one ComboBox object with a list of at least four of your favorite sayings. In your design, include the capability of letting users enter their own sayings. When a selection is made or a new entry is typed, display the selection on a Label object on your form. Add
Create an order form that allows bags to be purchased. There are six different types: full decorative, beaded, pirate design, fringed, leather, and plain. Create a ListBox object for the different styles. Include a ComboBox for quantity. Quantities up to 10 should be provided. After the user makes
Add to the application in Exercise 5 by including a control that allows the user to determine the type of shipping they desire. Include a set of radio buttons that contain shipping options of overnight, three day, and standard. Add the price for each bag to the listbox selection as follows: full
The computer club is selling T-shirts. Create an attractive user interface that allows users to select sizes (S, M, L, and XL) and quantity. Which controls would be most appropriate? Remember, the fewer keystrokes required of the user the better. Display the selections made by the user with the
Add to your solution in Exercise 7 by including two more sizes, XSmall and XXLarge. Add statements that process the order by calculating the total cost.Each shirt is $16 except the XSmall and XXLarge; their specialty prices are$20.00 each. Allow users to purchase different sizes on the same order.
Create aWindows application for purchasing floor covering. Allow the length and width (feet and inches) of a room to be entered. Be sure to include program statements that will keep your program from crashing if they enter nonnumeric characters for the room dimensions. Have a control that displays
Create an application for a Pizza Delivery Company. You might check out the graphical user interface shown in Figure 10-21. Your solution does not need to resemble this one; however, it might give you some ideas. You must provide a place for the user to enter their contact information (i.e.,
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
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
The ‘‘is a’’ relationship is associated with:a. inheritanceb. interfacesc. polymorphismd. encapsulatione. all of the above
In C#, the super class, or base class of all others, is:a. superb. basec. valued. classe. object
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
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. protected
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, public, public
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
In .NET, applications are deployed in terms of:a. .dll’sb. .exe’sc. solutionsd. assembliese. applications
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
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.
A class from which an object cannot be instantiated could be a(n):a. base classb. derived classc. implemented classd. virtual classe. abstract class
Classes can extend or derive from class(es) and implement interface(s).a. one, oneb. many, onec. many, manyd. one, manye. one, twelve
Abstract classes can include:a. data membersb. abstract methodsc. nonabstract methodsd. propertiese. all of the above
Interfaces can include:a. data membersb. abstract methodsc. nonabstract methodsd. propertiese. all of the above
allows a method of a class to be called without regard to what specific implementation it provides.a. Polymorphismb. Abstractionc. Assembliesd. Versioninge. Class libraries
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
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
Explain the difference between an overloaded and an overridden method. Give an example of each.
How do abstract classes differ from interface classes?
Given the following program segment, answer questions a through h. public class Employee { private int empNumber; private decimal pay; } a. Define a read-only property for the pay data member. b. Define a default constructor for Employee. C. Define a more useful constructor that could be used to
Create a base class to hold information about sporting teams on campus. It should not be possible to instantiate the class. Include common characteristics such as primary coach and type of sport. Define properties, ToString( )methods, and a minimum of one virtual method. The ToString( )method
Select two types of sporting teams and define subclasses for them. These classes should inherit from a base team class such as that created in Exercise 1.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
Add a new project to the solution you designed for Exercises 1 and 2.The new project should test your designs of the base team class and individual sporting team subclasses. Your class can be a console or Windows application.One approach would be to instantiate objects of both teams when the
Define an interface for the sporting team relating to budgeting. Any teams that implement the interface must provide details about how they are budgeted. Modify your design for Exercises 1 through 3 to implement the interface for both teams.
Create a ticket reservation class for issuing tickets to on-campus events such as plays, musicals, and home basketball games. Design the ticket class to be abstract. Create subclasses for at least three different types of events.Determine unique characteristics for each of the events. Define a
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 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
Create a base class titled ReadingMaterial. Include subclasses of Book and Magazine. Define an interface called IPrintable that has a method describing how it is available as a hard copy form of publication.Design your classes so that common characteristics are placed in the ReadingMaterial class.
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 ToString(
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 of
________________ are unexpected conditions that happen very infrequently.a. Bugsb. Conditionsc. Exceptionsd. Streamse. Objects
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
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
What type of exception would be thrown if the user enters the wrong type of data when requested from the keyboard?a. System.FormatExceptionb. System.Invalid.CastExceptionc. System.NullReferenceExceptiond. System.IndexOutOfRangeExceptione. System.ArithmeticException
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. System.FormatExceptionb. System.Invalid.CastExceptionc. System.NullReferenceExceptiond. System.IndexOutOfRangeExceptione. none of the above
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. System.FormatExceptionb. System.Invalid.CastExceptionc. System.ArgumentExceptiond. System.DivideByZeroExceptione. none of the above
If an application is written to filter several exceptions including System.Exception, System.DivideByZeroException, and System.ArithmeticException, in what order should they be listed?a. System.Exception, System.DivideByZeroException, then System.ArithmeticExceptionb. System.Exception,
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
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 (System.Exception) { }d. throws an exceptione. none of the above
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
errors are the easiest to discover and correct.a. Exceptionb. Compilerc. Run-timed. Logice. Omission
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
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
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
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
Which of the following lines contains information regarding a thrown exception named e?a. e.Messageb. e.ExceptionTypec. e.ExceptionInfod. e.ExceptionMessagee. e.Information
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
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 ApplicationException class is derived from:a. Systemb. SystemExceptionc. System.Exceptiond. ExceptionApplicatione. Exception
The result of division by zero is undefined for both integral and floating-point values.Describe how avoiding floating-point division by zero differs from integral division by zero.
Give one example of what would cause each of the following exceptions to be thrown:a. System.ArithmeticExceptionb. System.FormatExceptionc. System.IndexOutOfRangeException
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. You might investigate classes such as ArithmeticException, FormatException, IndexOutOfRangeException, and Exception. For each exception, write a try block containing
Given any number of inputted scores, write a program that calculates an average.After values are entered and the average is calculated, test the result to determine whether an A, B, C, D, or F should be recorded. The scoring rubric is as follows:A—90–100; B—80–89; C—70–79; D—60–69;
Create a class called Fraction that can be used to represent the ratio of two integers. Include appropriate constructors, properties, and methods. One of the methods should reduce the fraction to its lowest terms. If the denominator becomes zero, throw and handle an exception. Create an application
Write a WeightConverter class that can be used to convert standard weight measurements. In your list of options, include as a minimum grams, kilograms, pounds, and ounces. If the user enters a negative number or a nonnumeric value, throw and handle an exception. Create an application class to test
Write an application that lets users enter their weight and height in feet and inches. Calculate their body mass index (BMI). Create a multiclass solution that has exception-handling techniques.
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 Windows application that has the functionality of a calculator but works with decimal values. Because division by zero is not thrown by the CLR when the operands are nonintegral, create a custom exception class that can be thrown if division by zero is attempted. Instead of doing 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 exception-handling techniques
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
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.
Which class allows you to use the Read( ) and ReadLine( ) methods to retrieve data from a text file?a. TextReaderb. FileReaderc. BinaryReaderd. StreamReadere. 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
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
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
To which namespace does the File class belong?a. Objectb. System.FileSystemc. System.Objectd. Object.IOe. System.IO
The members of the _____________ class allow you to create, move, copy, and delete files.a. Fileb. FileInfoc. Directoryd. DirectoryInfoe. File and FileInfo
All of the following are exceptions classes that are thrown in conjunction with files, except:a. DirectoryNotFoundExceptionb. EndOfStreamExceptionc. InvalidDataFileExceptiond. FileNotFoundExceptione. IOException
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
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
Which of the following is an abstract class?a. DirectoryInfob. Streamc. StreamReaderd. all of the abovee. 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
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
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( )
To make a duplicate copy of a file, you could use a static method in the class.a. Fileb. StreamWriterc. Streamd. TextWritere. BinaryWriter
Streams can be used in C# for writing data to:a. text filesb. networksc. memoryd. binary filese. all of the above
StreamReader is a direct descendent of:a. MarshalByRefObjectb. Objectc. Filed. TextReadere. IO
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
Which of the following methods could be used to retrieve a decimal value from a binary file?a. ReadDec( )b. ReadDecimal( )c. ReadNumber( )d. ReadDoubleValue( )e. ReadDecimalValue( )
All of the following methods of the BinaryReader class could be used to retrieve data, except:a. ReadChar( )b. Read( )c. ReadChars( )d. ReadInt( )e. ReadString( )
Write a file declaration for a file that holds text characters and can be stored in C:\CSharpProjects\WorkDirectory. The file will be used to store data.
For the file declared in Exercise 21, write a method that stores the numbers 10 through 49 in the text file.
For the file created in Exercise 22, write a method that retrieves the values from the text file. Display 10 characters per line on the console output screen.
Showing 700 - 800
of 5433
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Last
Step by Step Answers