(View Name Application) The View Name application allows the user to enter the user’s first and last name. When the user clicks the View Name Button, a MessageBox that displays the user’s first and last name appears. The application creates an instance of the Name class. This class uses its property declarations to set the first-name and last-name instance variables. Copy the directory

C:\Examples\Tutorial19\Exercises\Debug- ger\ViewName to your C:\SimplyCSP directory. Open and run the application. While testing your application, you noticed that the MessageBox did not display the correct output. Use the debugger to find the logic error(s) in the application. The application with the correct output is displayed









// Name.cs
// represents a name

using System;

namespace ViewName
{
///
/// Summary description for Name.
///

public class Name
{
private string m_strFirstName;
private string m_strLastName;

// Name constructor, first and last names supplied
public Name( string strFirstName, string strLastName )
{
First = strFirstName;
Last = strLastName;

} // end constructor Name

// property First
public string First
{
// return first name
get
{
return m_strFirstName;

} // end get accessor

// set first name
set
{
m_strFirstName = value;
} // end set accessor

} // end property First

// property Last
public string Last
{
// return last name
get
{
return m_strLastName;

} // end get accessor

// set last name
set
{
m_strLastName = value;
} // end set accessor
} // end property Last

} // end class Name
}

Computer Science & Information Technology

You might also like to view...

Which of the following has the worst average-case time bound?

a. binary search b. interpolation search c. sequential search d. two of the above have equivalent average-case bounds e. all of the above have equivalent average-case bounds

Computer Science & Information Technology

Multi-column layouts are created with CSS3 by setting either the number of columns or the width of each column.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A cell phone is cellular because

a. software can be plugged in or removed. b. phones have become so small in size. c. it uses a network made up of cells or base transceiver stations. d. of the pattern on the screen of the device.

Computer Science & Information Technology

F2 is the shortcut for Dreamweaver Help.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology