Free Essay

Exception

In: Computers and Technology

Submitted By cptrcis
Words 334
Pages 2
Professor Damion Mitchell wants you to develop a C++ program that enables a user to enter the name of two species, as well as the number of breed x and y that are involved in a cross breed experiment. By utilising exception handling techniques display “hybrid experiment is viable,” that is if both species are the same and breed x is greater than or equal to breed y; otherwise display “hybrid experiment is invalid and irrational.”
Question 2
Create a C++ program that accepts a family‘s information and consequently displays a four generation family tree of the specific family. Therefore your program should accept the name, family position (i.e. great-grandfather, grandfather, father or son) and age of each family member. With the utilisation of exception handling and other concepts you have learnt ensure that the age of a descendant is never greater than the ancestor.

Question 3
Write a C++ program that finds the square root of a number, as well as quotient of the number and by utilising exception handling avoid arithmetic fatal errors. For this program ensure the user does not divide by zero or tries to find the square root of a negative number. (Please note that the user will be required to enter the number, as well as the denominator for the number)
Question 4
Develop a C++ console application that populates a ten element array with the multiples of five that are less than fifty-five (55). Consequently display all the even numbers that are in the array by utilising pointers.
Question 5
Create a C++ program that accepts a sentence from a user and consequently with the aid of pointer(s) reverse the order of the words within the sentence. Furthermore display the reversed order of words.
Hint: Utilise the strtok() function.

Your Challenge
With the aid of pointers develop a C++ program that accepts five first names and consequently display the names of all the persons whose first name started with a vowel.…...

Similar Documents

Premium Essay

You Are the Judge Paper # 1

...at-will-employment business, Jerry decided to fire Elaine after two-months and hire a man in for her position, Kramer, who had less job experience and education then Elaine. Elaine has now sued Jerry for being terminated, she wishes to have her job back and have a steady income and an annual salary. Elaine’s lawsuit has a strong case for sexual discrimination and unlawful business ethics by her employer, ensuring that Elaine, who was given no reason for the termination and after the termination Jerry hired a man, who had less job experience and education, gets her job back. However, there are certain exceptions that favor Elaine for being mistreated and fired so abruptly. The exceptions that I believe will help Elaine in the Lawsuit against Jerry other then sexual discrimination, are as follows; Tort Exceptions, Implied-In-Fact Contracts. Statutory Exceptions, and the Public Policy Exception. Certain issues need to be considered and discussed before beginning this lawsuit to ensure that there is a legitimate case. Some things to consider are; is there a valid contract with Elaine and Jerry that she must receive a reason or explanation for being terminated that is related to company policy? Does the job require any certain skills or education that Kramer may not be qualified for? Was Elaine on an annual contract with the company or was that just an item to bring people into joining the company? Was there any type of salary contract that had been signed? Was Elaine received any......

Words: 1530 - Pages: 7

Free Essay

Vcctytfggjghyhui

...compiles but raise runtime exceptions (java.lang.ArrayIndexOutOfBoundsException) 9.Answer (2), (4) Explanation: This sample code compiles and execute successfully with output 10 but with a warning that "The static method method() from the type ball should be accessed in a static way" 10. Answer (2) Explanations This program execute with printing the output 10 on console. 11. Answer (2) Explanations:  The abstract keyword must be place before the class Ball because abstract method can only exist in the abstract class not in concrete class. 12. Answer (1) 13. Answer(2) 14. Answer(4) Explanation: It has no issue with the code. It will display the output on console. 15. Answer(4) 16. Answer:(2) Explanation: It will compile and run successfully there is no issue of using the static method here. 17. Answer: (1) or (2) Explanation: Place statement (1) or (2) both allow the ClassA method to be called from ClassB 18. Answer (2) 19. Answer : D is the correct answer. Thread priorities are set using a positive integer, usually between 1 and 10. t1.setPriority(-3); throws java.lang.IllegalArgumentException. 20. Answer : A is the correct answer. Thread.currentThread().getName() return name of the current thread. 21. Correct answer is : A Explanations : You cannot have two methods in the same class with signatures that only differ by return type. 22. "Throwable", the parent class of all exception related......

Words: 532 - Pages: 3

Premium Essay

Business Law

...parties, they can’t give verbal evidence to add extra words to the agreement in any way or to modify the meaning. However, there are ways of exception to the rule that can be allowed by the court. Collateral contract can be argue as one of the exception to the parol evidence rule. This is an argument of a separate contract. The purpose of this essay is to explain about the legal rule which is parol evidence rule and the exception to the rule. Body Description of Parol Evidence Rule Parol evidence rule exist because is to prevent fraud and uncertainty of the contract. The written contract can never be add in or change the terms in it unless it is not clear. This rule only can be allowed when the written contract is incomplete, ambiguous, writing is not a true statement of the agreement of the parties, accident or mistake, and when the existence, subsequent modification or illegally of the contract is hanging. When the written contract is obviously incomplete or the parties themselves admit it is incomplete, therefore the court can allow evidence like oral as what has been agreed to along with the written contract earlier. In this case, there are exceptions of the rules that court must allowed. First Exception to Parol Evidence Rule and Relevant Case The first exception is the contract is partly written partly oral. This exception can only comes when the written agreement does not clear to both parties which the express terms were not complete. In Van Den Esschert v......

Words: 2286 - Pages: 10

Premium Essay

Employment-at-Will Doctrine

...judicial exceptions to the rule seek to prevent wrongful termination. There are three exceptions to the doctrine that are recognized across the 50 states. These exceptions address employment terminations that are in line with the doctrine requirements but are probably not justified [Muhl, 2001]. Public-policy exception Under the public-policy exception to employment at will, an employee is wrongfully discharged when the termination is against an explicit, well-established public policy of the State. For example, in most States, an employer cannot terminate an employee for filing a workers’ compensation claim after being injured on the job, or for refusing to break the law at the request of the employer. The public-policy exception is the most widely accepted exception, recognized in 43 of the 50 States [Muhl, 2001]. Implied-contract exception The second major exception to the employment-at-will doctrine is applied when an implied contract is formed between an employer and employee, even though no express, written instrument regarding the employment relationship exists. Although employment is typically not governed by a contract, an employer may make oral or written representations to employees regarding job security or procedures that will be followed when adverse employment actions are taken. If so, these representations may create a contract for employment. This exception is recognized in 38 of the 50 States [Muhl, 2001]. Covenant-of-good-faith......

Words: 1109 - Pages: 5

Premium Essay

Business Ethics

...they are likely to seek compensation. If a person hasn't signed a contract or is fired, with exception to a few points in the employment at will doctrine, there is not much they can do about it. The law is on the side of the businesses in most cases of at-will employment. In the case of Elaine, she was fired without notice or reason for termination. Elaine had been promised career opportunities and given a salary, but no contract was signed. Elaine's employer hired a new person for Elaine's position who had less education and experience. Elaine believes she was fired unfairly and is suing to get her job back. I believe Elaine may have a strong case because of the person who was hired for her position. Elaine was fired without good reason or notice. The employer then replaced Elaine with a male employee with less job experience and less education. Elaine has a good chance of getting her job back by suing her employer for sex descrimination. Her successor was inferior to Elaine in a few key areas and that may prove the employer fired her due to descrimination. There are some exceptions where employees cannot be fired even if they are at-will employees. One exception is a statutory exception. A statutory exception says an employer can't fire an employee that is a member of a labor union if their firing is in violation of labor laws or collective bargaining agreements. Another exception is an implied-in-fact contract. An implied-in-fact says that if the company states......

Words: 353 - Pages: 2

Premium Essay

Is3350

...several exceptions to the warrant requirement. Those exceptions are: searches with consent, frisks, plain feel/plain view, incident to arrest, automobile exceptions, exigent circumstances and open fields, abandoned property and public place exceptions. Under the searches with consent exception, individuals, "with the authority to do so," can consent to be searched without a warrant and, likewise, can revoke that right at any time. In order for an individual to be searched, he or she must give consent. "Consent to search any property must be given by the actual owner or, by a person in charge of that property". If, for instance, more than one person owns a property, only one of those individuals must give consent. Because automobiles are mobile, it is reasonable to assume that they would qualify as an exception to the warrant clause of the Fourth Amendment. Under this particular exception, an automobile may be search "if a government agent has probable cause to believe the vehicle contains contraband or evidence of a crime without a warrant" because "in the time it would take to get a warrant, the car, driver and contraband or evidence could be long gone". Under the exigent circumstances exception, officers "who have established probable cause that evidence is likely to be at a certain place and who do not have time to get a search warrant" may conduct a search without having previously obtained a warrant. In addition to the exceptions present are the frisk exception,......

Words: 370 - Pages: 2

Premium Essay

Employment-at-Will

...bad cause, or cause morally wrong without fear of legal recourse (Halbert, Ingulli, 2012). Every state in the country operates under this law but with exceptions and that’s where the waters get murky. The multitude of exceptions found state by state produce a variety of interpretations and applications of how the employment at will should be applied (Gibson, Lindley, 2010). The first exception to the employment at will law came when the United States Supreme Court ruled employers could not punish or fire employees for organizing into unions(Halbert, Ingulli, 2012). The unions use collective barging agreements to regulate working conditions for employees. These conditions include that union workers cannot be terminated without just cause (Gibson, Lindley, 2010). The Supreme Court, also included other types of formal employment contracts in this exception ruling as long as the contract does not include an at will clause (Muhl, 2001). The onset of Title VII of the 1964 Civil Rights Act made it illegal to terminate an employee on the basis of their race, sex, religion, or national origin (Halbert, Ingulli, 2012). Not until the 1980’s did the bulk of the exceptions take place. The following exceptions are considered to be the main exceptions to the employment at will law as viewed by 50 states. The Public Policy This exception prevents dismissal for reasons that violate a State’s Public Policy. The type of reason will vary between jurisdictions but the grounds remain the same...

Words: 1405 - Pages: 6

Free Essay

Good Cause Exception

...Before the Board looks at the application, it must receive a complete application package. Failure to submit a complete application package will delay the process and may cause the application to be denied. A complete application must include at least the following. 1. Application form (completed, signed, and notarized). Applicants should not fail to answer any of the questions. The application form also requires a personal statement that explains, from the applicant's perspective, every arrest that may be on your criminal history record. Applicants should make sure to address every arrest, even if it did not appear on the letter from DPS, and even if the arrest did not lead to a conviction. Applicants also may want to describe the positive lifestyle changes they have made. (For more information on personal statements, please see the "Resources" section of our Forms & Resources page.) 2. Two letters of reference (completed on the forms provided by the Board). Both letters must be completed by someone who has known the applicant for at least one year. One form must be completed either by the applicant's current or former employer or by someone who has known the applicant for at least three years. Applicants may submit more reference letters, if they like. However, they must submit at least two, and the references must use Board-prescribed form. 3. Evidence that the applicant has met all sentencing requirements. For every conviction on an applicant's record,......

Words: 550 - Pages: 3

Premium Essay

Employment at Will

...Employment-at-Will Exceptions Paper University of Phoenix HRM 546 Introduction This paper will explain how employment-at-will is utilized by my employer (xxx); how the exceptions to the employment-at-will doctrine are used to protect URS; and, will identify how and why xxx employs employees and independent contractors and how that strategy contributes to the economic health of the company. How is Employment-at-Will applied in my Organization? The general employment engagement at xxx is employment-at-will. As described by xxx Code and Business Conduct and Ethics, “Nothing in the Code alters the employment at-will policy of xxx applicable to all U.S. employees.” xxx is a publicly traded company, and because it contracts with the Federal Government it is governed by regulations unfamiliar to private companies. According to California labor law, Section 2922, “An employment, having no specified term, may be terminated at the will of either party on notice to the other. Employment for a specified term means an employment for a period greater than one month.” Unlike most employees at xxx, however, senior management (senior vice-president level and above) work at URS on a contractual basis. The employment contract is created by Human Resources, reviewed and approved by the CEO and Board of Directors, and then presented to the manager. How do Exceptions to Employment-at-Will Limit its......

Words: 700 - Pages: 3

Free Essay

Se433Hw5

... purchaseCost:  60,  destination:  MI   ExpectedOutput:  25  +  60  =  85     4. WRT001:   Negative  purchase  cost  input  for  standard  shipping  to  IL.   Input:  shippingType:  standardShipping,  purchaseCost:  -­‐20,  destination:  IL   ExpectedOutput:  exception  in  purchaseCost     WRT002:   NaN  purchase  cost  input  for  next-­‐day  shipping  to  IN.   Input:  shippingType:  nextDayShipping,  purchaseCost:  a,  destination:  IN     ExpectedOutput:  exception  in  purchaseCost     WRT003:   A  $25  order  for  standard  shipping  to  UK.   Input:  shippingType:  standardShipping,  purchaseCost:  25,  destination:  UK   ExpectedOutput:  exception  in  destination     WRT004:   A  $25  order  for  unkown  shipping  to  IL.   Input:  shippingType:  unkownShipping,  purchaseCost:  25,  destination:  IL   ExpectedOutput:  exception  in  shippingType       5. SNT001:   A  $25  order  using  standard  shipping  to  IL.  (Tax  added,  SC  not  waived)   Input:  shippingType:  standardShipping,  purchaseCost:  25,  destination:  IL   ExpectedOutput:  10  +  25  * ......

Words: 1085 - Pages: 5

Free Essay

Organizational Behavior

...Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void label12_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { try { sc.Open(); cmd = new SqlCommand("Insert into Donor (D_ID,D_FirstName,D_LastName,D_Age,D_Gender,D_telephone,D_Address,Recep_ID) values('" + id.Text + "','" + Dfirst.Text + "','" + Dlast.Text + "','" + Dage.Text + "','" + Dgender.Text + "','" + Dtele.Text + "','" + Dadd.Text + "','" + recepid.Text + "')", sc); cmd.ExecuteNonQuery(); MessageBox.Show("Insertion Successful to the Database! :) "); sc.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void textBox4_TextChanged(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { try { sc.Open(); cmd = new SqlCommand("delete from Donor where D_ID='" + this.id.Text + "'", sc); cmd.ExecuteNonQuery(); MessageBox.Show("Deleted! :) "); sc.Close(); } catch (Exception ex) { ......

Words: 960 - Pages: 4

Premium Essay

Bridging Information Systems in Business, Credit Exception Tracking System

...Abstract This report aims to identify the business value of information system in an organization. The organization that has been focused is HSBC Bangladesh. The CRM department of HSBC Bangladesh had recently incorporated a new software, namely “Credit Exception Tracking System”. This report primarily focuses on the situation of the bank prior to the incorporation of this information system in the CRM department, and it expands with a qualitative and quantitative analysis of benefits being received from the new IS . The major emphasis of these analysis has been the users of the IS, and both the analysis are subject to their response. The report also contains a brief description of the technical aspects of the IS. The hardware setup and the software support that are needed to operate the IS are described briefly. The cost of implementing the project, including the purchase of additional hardware, software and training is also mentioned. Although it is always critical to assess the amount of value addition that a particular IS brings into effect, CETS has had very lucid and prominent impact in improving the operation and efficiency of the organization. These impacts are pointed out clearly throughout this report. Introduction The pace of globalization has influenced all businesses to undergo sufficient changes in their operational procedures. Often businesses need to automate their existing operations in order to cope up with the rest of the business......

Words: 2683 - Pages: 11

Premium Essay

Research

...Edition Chapter Fifteen Exception Handling In this chapter, you will: • • • • • • Learn about exceptions Try code and catch Exceptions Use the Exception getMessage() method Throw and catch multiple Exceptions Use the finally block Understand the limitations of traditional error handling • • • • Specify the Exceptions a method can throw Handle Exceptions uniquely with each catch Trace Exceptions through the call stack Create your own Exceptions Learning about Exceptions • Exception- An unexpected or error condition – For example: • You issue a command to read a file from a disk, but the file does not exist • You write data to a disk but the disk is full or unformatted • The program attempts to divide by zero Learning about Exceptions • Exception Handling- The object-oriented techniques to manage such errors comprise the group of methods know as exception handling – There are two basic classes of errors • Error and Exception – Both classes descend from the Throwable class – You must expect the unexpected Learning about Exceptions • Error class- Represents more serious errors from which your program usually cannot recover – For example, spelling a class name incorrectly or storing a required class in the wrong folder Learning about Exceptions • Exception class- Comprise less serious errors that represent unusual conditions that arise while a program is running, and from which the program can recover – Examples of Exception class errors......

Words: 2413 - Pages: 10

Free Essay

Exceptions

...April 17, 2012 Dear Exceptions Committee, I would like to be accepted into the Communications Program at Wichita State University. I took the G.E.D. test in 1995 and one of my scores did not meet the admissions requirements. I am currently working in the television field. I have worked at two local television stations. I am seeking to expand my knowledge of the television industry in order to further my career. The Communications Program at WSU offers me the best chance of succeeding in a field that I am passionate about. The Broadcast Journalism Program excites me to no avail. I will be able to learn the ins and outs of journalism which includes reporting the news, advanced feature writing, and live television news. The Electronic Media Program will teach me how to edit audio, do studio production, and write for electronic media. This opportunity will allow me to gain valuable hands on experience. The experience and knowledge that I will gain by obtaining a degree in communications will allow me more opportunities to advance in my career field. I also became a father for the first time to identical twin boys four months ago. I would like to have a career that will make them proud of me. I also want to be a good role model for them by inspiring them to pursue their dreams. I write this letter asking the Exceptions Committee to please allow me the opportunity to better myself by accepting me into the Communications Program at Wichita State University. ......

Words: 274 - Pages: 2

Free Essay

What Are Policies, Standards, Specifications, Procedures and Exception

...What are policies, standards, specifications, procedures and exceptions Policy An Information Technology Policy is the highest level of the Information Technology (IT) Governance Standards documents. An IT Policy sets the direction, tone and limits for the enterprise and IT, and the IT Standards which are developed under the authority of the Policy. A Policy should seldom change. IT Policies require compliance; failure to comply may result in disciplinary action. Exceptions can only be approved by the CIO. A Policy focuses on desired results, not on the means of implementation. Accountabilities: Oversight of IT Policies is the responsibility of IT Governance. Policies must be approved by the Chief Information Officer and the Enterprise Policy Council. Standard Information Technology Standard Information Technology Standards are the most often used documents in the IT Policies and Standards Library serving as a reference for employees, contractors, consultants, and other persons. An IT Standard: • Defines requirements around a topic. The requirements may range from very specific (i.e., only 3DES and AES encryption algorithms may be used.) to broad (i.e., Web applications must check for common vulnerabilities). • Provides requirements without stating dynamic details. When dynamic details are important, an IT Standard may identify a requirement for the existence of a Specification or Procedure to contain those details. • Reviewed annually. The frequency of...

Words: 666 - Pages: 3