Write a snippet of code to declare an exception class

Assignment Help Computer Engineering
Reference no: EM132134697

Is there someone to help me on to write c++ code?

A) Write a snippet of code to declare ( what would go into the .h file) and then implement(what go into the .cpp file) an exception class called PetBitesException which holds an error message ,and a method called erroHandler which prints a message to a log file errorlog . The message is set by the custom constructor. Assume the log file has been already opened, and is globally available.

B) Write a snippet of code to declare (what would go into .h file) and then implement (what go into .cpp file) a public void method called treatPets scoped to PetHospital class, which takes a reference to Pet object , and throws PetBitesException if a Pet's mood attribute is set to "annoyed" . The exception needs to ouput a message identifying the Pet(example "Rufus just bit"), where pet's name class and the Pet class with all its attributes have been already implemented.

C) Write a try catch block of code, which invokes the treatPet method, catches PetBitesException and then invokes the errorHandler method on the exception object to log the error message.

D) Objective: class hierarchy and polymorphishm. Write a code snippet of code to declare (what would go into .h file) and then implement (what would go into .cpp file) the family of classes in Quality Control domain including,

- the base class "Test"

- two derived classes corresponding to the specialize tests: RegressionTest and LoadTest

The base class should have a virtual Boolean method called run which is overridden in the sub-classes, where specified logic is placed(some code).

As an exercise, let the method return true false randomly. Then in main.cpp file, declare a pointer to the base class Test and use it to instantiate and run LoadTest. Then use the same pointer to instantiate and run a RegressionTest.

Reference no: EM132134697

Questions Cloud

Normal distribution with a mean : We have a normal distribution with a mean of 71 and a standard deviation of 11
Partial relative frequency table : Given the following partial relative frequency table
Compute the t value of the sample test statistic : Use a level of significance of 0.05 to conduct a two-tailed test of the claim that the population mean is 11.5. Compute the t value of the sample test statistic
What networks were encountered along the way : What information about the geographic locations of the routers can you infer from the trace? What was the longest mean delay on any one hop along the way?
Write a snippet of code to declare an exception class : Write a try catch block of code, which invokes the treatPet method, catches PetBitesException and then invokes the errorHandler method.
How many results are possible to form the board : The Codechef Programming Society has 198 membership-paying mem- bers, 97 females and 101 males.
Display the rows in the vendor table : The bookstore has decided to keep track of the vendors' information. In order to do this, one new table will be added to the database.
Calculate the issue price of the bonds : On January 1, 2017 Lance Co. issued five-year bonds with a face value of $840,000, Calculate the issue price of the bonds
What is the probability that in the next six? flights : What is the probability that in the next six? flights, exactly four flights will be on? time?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down a statement to create a view

Write down a satement to add a check constraint to the above defined table that guarantees that values entered in the inspection small date field are not older than today, meaning from now on. According to new requirements from your business analys..

  Identify all the actors that will be using the system

Recall the On the Spot courier service introduced in Unit 1. The details of the package pickup and delivery process are described here.

  Create a web page that will pop up an alert message

Create a Web page that will pop up an alert message welcoming the user to the Web page. Use a script block in the area for this task.

  What are the constraints on this residual frequency error

Show that pilot symbols can be used to track both fading and small residual frequency errors in receiver. What are constraints on this residual frequency error?

  What is meant by atm having classes of service

What is meant by ATM having classes of service? Describe some applications that incorporate computer-telephony integration.

  Elaborate who are likely to be your competitors

Elaborate who are likely to be your competitors? Remember your competitors can only be individuals/businesses who have their operational websites online.

  How do you display the ps output without the header line

How does head display its output when used with multiple filenames? How do you display the ps output without the header line?

  Write a java method that takes an array of int values

Write a Java method that takes an array of int values and determines if all the numbers are different from each other (that is, they are distinct).

  Using social networking website to get applicant information

Some companies are starting to utilize the social networking websites like MySpace and Facebook, to get the information about the job applicants.

  The combat identification server cids technology

the combat identification server cids technology demonstrator project tdp has been delivered on time with quality and

  What are some of negative implication of participatory media

CMST 301- What are some of the negative implications of participatory media? Provide specific examples and cases. How has the increase in digital media resulted in an increase in ‘multi-tasking'?

  Write pseudo code to represent the logic of a program

Draw a flow chart or write pseudo code to represent the logic of a program that allows the user to enter a value for the radius of a circle.

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