Write a test harness for these classes

Assignment Help Programming Languages
Reference no: EM13936179

1 Overview

Dr. Bradbury's Circus of Total Evil travels the galaxy terrorizing children both good and bad. In an effort to save money, Dr. Bradbury has purchased his Robotic Clown Troupe from the Acme Company of Walla Walla, Washington on Planet Earth. The Acme Company's robotic clowns can be funny, scary, or both at the same time. You have been contracted to write a collection of classes that simulate Acme's evil clowns.

2 Background

The initial code from Acme has a clown class named TallGuyClown
public class TallGuyClown
{
public string name;
publicint height;
public void TalkAboutYourself()
{
MessageBox.Show("my name is " + Name
+ " I'm " + height + "feet tall");
}
}

3 The IClown interface

Write an interface IClown that defines one method Honk(). Modify the TallGuyClown class to implement that interface so that calling Honk() will display a MessageBox (as above) that says "Honk my horn!". Add a property FunnyThingIHave to the interface and modify TallGuyClown to implment that property.

4 Adding a new class that implements IClown

Define a new class FunnyClown that uses a private string variable to store the "funny" thing this clown says to the children in the audience. This class should have a constructor that has a single string and use the public FunnyThingIHave property to set the private instance variable. This class needs to define the Honk() method to say "Honk, Honk! I have a" followed by its funny thing.

5 Extending the clown interface

Define a second interface IScaryClown that extends the IClown interface. The new interface needs to define a second string property named myScaryThings and a void method called ScareTheChildrens().

6 Using the IScaryClown interface

Define a new class ScaryClown that uses a private variable to store an integer that was passed to the class in the class constructor. The myScaryThngs getter method needs to return a string consisting of this number followed by "spiders". The ScareTheChilrens() method should pop up a mesasge that says "Boo, Gotcha!". Don't forget to implement the Honk() method.

7 Test framework

Write a test harness for these classes that stores a list of IClown objects. Insert a random collection of TallGuyClown, FunnyClown, and ScaryClown objects into this list. Then traverse the list calling the Honk() method in each object.

Attachment:- Program.zip

Reference no: EM13936179

Questions Cloud

Design, implement and evaluate a mobile/web : Interpret the broad range of business activities that are supported or enabled by Mobile/Web technologies and be able to advise organisations on the appropriate use of Mobile and Web Technologies.
Choose a planning approach and describe an ideal situation : Part of being effective in participation in program planning is being comfortable with using different approaches in different situations. Choose a planning approach and describe an ideal situation and a least ideal situation for its use. Strateg..
Type of organizational culture-market oriented : 1) what type of organizational culture? Market oriented? 2) what type of org structure, organizational chart?
What would happen to the profit of this bank : Suppose the reserve-requirement is 25% and this bank decides to comply by a marketing campaign. If the campaign increases checking deposits, how much additional funds do they need to raise to satisfy the requirement?
Write a test harness for these classes : Write an interface IClown that defines one method Honk(). Modify the TallGuyClown class to implement that interface so that calling Honk() will display a MessageBox (as above) that says "Honk my horn!". Add a property FunnyThingIHave to the interf..
Relationship between obesity and lack of exercise : Clearly there is a relationship between obesity and lack of exercise and poor diet. In addition, most philosophers throughout the history of the world have agreed that happiness will, at some point, require meaningful relationships with other hum..
Determine a set of heuristic usability principles : Note: You have to describe about Heuristic usability principles in this part using your own words and in this part you can use the reference. I have upload a PDF file for your information which will be mostly enough to for this part or if you know..
What are the major effects of urban bias : Generally speaking, higher income countries tend to have less income inequality than low income countries, however this does not always hold true. What could cause a low income country to have low income inequality?
Does the doctrine of impossibility apply : Who wins? Does the doctrine of impossibility apply? Should the court imply a condition of "good health" into the contract for the ski lessons?

Reviews

Write a Review

Programming Languages Questions & Answers

  Building airline reservation system

Problem Description The aim of this project is to build airline reservation system. System must give two basic sets of services to an airline: First set of services allows the airline to provision its system.

  Explaining exception handling using program

Use exception handling appropriately. Use comments to illustrate the various concepts applied / utilized in the solution.

  Write a vhdl code for soda vending machine

Write a VHDL code that implements the above soda machine. You have to turn in the following: A state diagram showing the implementation of your design. Clearly show all the states and the conditions on which transitions occur.

  Explain why competition synchronization is not a problem

Explain clearly why competition synchronization is not a problem in a programming environment that supports coroutines but not concurrency.

  Program for insertion sort and selection sort algorithms

Write a program involving the insertion sort, merge sort and selection sort algorithms.

  Write program which simulates checkout queue object

Write program which simulates checkout line at supermarket. Line is queue object. Customers (i.e., customer objects) arrive in random integer intervals of 1-4 minutes.

  Utilize branching and looping syntax with parameters

the file"values.txt" with following data: 88 85 89 64 78 85 92 60 91 96 63 59 83 89 74 93 92 92 63 100. write down the program which will give the following output.

  Prepare the logic for a program which performs arithmetic

create the logic for a program that performs arithmetic functions. design the program to contain two numeric variables.

  Write down a program which reads an integer between 0 and

write a program that reads an integer between 0 and 10000 by selecting the integer at random then sum the digits. for

  Write program for department of motor vehicles

Department of motor vehicles has finally decided to computerize its list of licensed drivers. Program you write must make use of existing file call Licenses with records of given form. Name, License Number

  Create-implement program which creates exception

Create and implement a program which creates an exception class called StringTooLongException, designed to be thrown when string is discovered that has too many characters in it.

  Program that prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd