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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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