Free Essay

Exception

In:

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

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

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. Thank...

Words: 274 - Pages: 2

Free Essay

Quantum of Reservations

...Introduction Article 15(4) was inserted into the Constitution by way of amendment and wasn’t a clause which was present in the Constitution, since it came into being. This amendment gave the executive powers to make any special provisions for the advancement of any socially and educationally backward classes of citizens or for the Schedule Castes and Schedule Tribes. This provision was considered necessary by the legislature as India gained independence and a democratic form of Government came into being, the need to uplift the down-trodden was felt. Reservation were to be implemented initially for only 10 years but have being continuing till now. Over the years the extent to which reservations should be allowed has been a matter of great controversy and has been discussed in various cases. The present condition is that reservations in general should not exceed 50%. But this was not always the position. Since Article 15(4) permits discrimination in reverse by reserving seats in educational institutions, the extent of such reservation assumes great importance for the citizen, for the public generally and for the State. An instructive illustration of such appointments to unreserved and reserved posts is furnished by the facts of T. Devadasan v. Union of India and Anr. Out of 45 appointments to be made, 16 were made from unreserved seats and 29 from candidates belonging to the Schedule Castes and Tribes. The petitioner complained that although he had obtained 61 per cent marks...

Words: 1443 - Pages: 6

Premium Essay

Programming

...about a person are: • name - the name of a person (character string). • age - the age of a person (integer value). You should write the MyList class, which is a linked list data structure to store person information. The following functions should be included in the MyList class: • void addLast(String xName, int xAge) - check if the first letter of xName is not 'B' (i.e. xName.charAt(0) != 'B') then add new person with name=xName, age=xAge to the end of the list. • void addFirst(String xName, int xAge) - check if the first letter of xName is not 'B' then add new person with name=xName, age=xAge to the begining of the list. • void addMany(String [] a, int [] b) - this function is given. • void ftraverse(RandomAccessFile f) throws Exception - display all nodes in the file f in format: (name, age). This function is given. • void f1() – Test addLast function. You do not need to edit this function. Your task is to complete the function addLast(String xName, int xAge) function only. With the given data, the content of f1.txt must be the following: (A0,9) (A7,13) (A5,7) (A3,11) (A4,9) (A2,12) (A6,5) (A1,6) • void f2() – Test addFirst function. You do not need to edit this function. Your task is to complete the function addFirst(String xName, int xAge) function only. With the given data, the content of f2.txt must be the following: (A1,6) (A6,5) (A2,12) (A4,9) (A3,11) (A5,7) (A7,13) (A0,9) • void f3() – create MyList object t and using addLast method to add to...

Words: 349 - Pages: 2

Free Essay

The Power Line Poles

...how would you deal with the bid exceptions requested? If I was Mr. Yarrow, I would request Henry Nelson Co. that several pre-award meetings are held to discuss the exceptions made with the goal of setting final agreements on these exceptions prior contracting the services. I would also make sure that these discussions are recorded as minutes of the meetings so that the document(s) can become an integral part of Henry Nelson’s quote and eventually included in the contract agreement. With regards to each of the exceptions requested (Exhibit 2), my comments are: • Exception 1: To handle this exception, Moren should request Henry Nelson and for that matter all bidders, to include in their quote a Jobsite delivery. Although most of the companies in the US are more familiar with the UCC transportation terms, Moren should request that the latest version of Incoterms (developed by the ICC) should be used as the applicable transportation terms of the contract. By enforcing the use of Incoterms, Moren may even specify that the quoted terms should be DDP-Jobsite which would indicate Henry Nelson and all other bidders that the supplier “must” carry the responsibility and risk of delivering the equipment to the jobsite by the requested date. With this in mind, Henry Nelson and other bidders should include as part of their cost estimate the costs for using DDP-Jobsite delivery terms. This way, the sales price to Moren is inclusive of this cost. • Exception 2: From experience, depending...

Words: 913 - Pages: 4

Free Essay

Read from Url

...LAB EXERCISE 1: READ FROM URL URLReader.java import java.net.*; import java.io.*; public class URLReader { public static void main(String[] args) throws Exception { URL yahoo = new URL("http://www.lelong.com/"); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream())); String inputLine; for ( int i =0;(inputLine = in.readLine()) != null; i++){ System.out.println(inputLine);} in.close(); } } LAB EXERCISE 2: Echo Client EchoClient .java import java.io.*; import java.net.*; public class EchoClient { public static void main(String[] args) { try { Socket s = new Socket("127.0.0.1", 9999); BufferedReader r = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter w = new PrintWriter(s.getOutputStream(), true); BufferedReader con = new BufferedReader(new InputStreamReader(System.in)); String line; do { line = r.readLine(); if ( line != null ) System.out.println(line); line = con.readLine(); w.println(line); } while ( !line.trim().equals("bye") ); } catch (Exception err) { System.err.println(err); } } } LAB EXERCISE 3:MULTI THREADS SimpleThreads.java public class SimpleThreads { //Display a message, preceded by the name of the current thread static void threadMessage(String message) { String threadName = Thread.currentThread().getName(); System...

Words: 1219 - Pages: 5

Free Essay

Something

...MIPS Reference Data Card (“Green Card”) 1. Pull along perforation to separate card 2. Fold bottom side (columns 3 and 4) together M I P S Reference Data Add Immediate Add Unsigned And And Immediate Branch On Equal addi 1 CORE INSTRUCTION SET FORNAME, MNEMONIC MAT OPERATION (in Verilog) add Add R R[rd] = R[rs] + R[rt] I I R[rt] = R[rs] + SignExtImm R[rt] = R[rs] + SignExtImm Add Imm. Unsigned addiu addu and andi beq OPCODE / FUNCT (Hex) (1) 0 / 20hex (1,2) (2) 8hex 9hex 0 / 21hex 0 / 24hex (3) (4) (4) (5) (5) chex 4hex 5hex 2hex 3hex 0 / 08hex (2) (2) (2,7) (2) 24hex 25hex 30hex fhex 23hex 0 / 27hex 0 / 25hex (3) dhex 0 / 2ahex R R[rd] = R[rs] + R[rt] R R[rd] = R[rs] & R[rt] I I I J J R[rt] = R[rs] & ZeroExtImm if(R[rs]==R[rt]) PC=PC+4+BranchAddr if(R[rs]!=R[rt]) PC=PC+4+BranchAddr PC=JumpAddr R[31]=PC+8;PC=JumpAddr Branch On Not Equal bne Jump Jump And Link Jump Register j jal jr Load Byte Unsigned lbu Load Halfword Unsigned Load Linked Load Upper Imm. Load Word Nor Or Or Immediate Set Less Than lhu ll lui lw nor or ori slt R PC=R[rs] R[rt]={24’b0,M[R[rs] I +SignExtImm](7:0)} R[rt]={16’b0,M[R[rs] I +SignExtImm](15:0)} I R[rt] = M[R[rs]+SignExtImm] I I R[rt] = {imm, 16’b0} R[rt] = M[R[rs]+SignExtImm] R R[rd] = ~ (R[rs] | R[rt]) R R[rd] = R[rs] | R[rt] I I R[rt] = R[rs] | ZeroExtImm R R[rd] = (R[rs] < R[rt]) ? 1 : 0 OPCODE / FMT /FT FOR/ FUNCT NAME, MNEMONIC MAT OPERATION (Hex) bc1t FI if(FPcond)PC=PC+4+BranchAddr (4) 11/8/1/-Branch On FP True...

Words: 2042 - Pages: 9

Free Essay

Java

...public abstract class Animal extends Organism { boolean ateThisTurn; boolean wantsToMove; public void wasIJustFed(boolean ateOrNot) { if (ateOrNot == true) { ateThisTurn = true; } else { ateThisTurn = false; } } public void resetHunger() { ateThisTurn = false; } public void wasIJustMoved(boolean movedOrNot) { if (movedOrNot) { wantsToMove = false; } else { wantsToMove = true; } } public String toString() { String deadOrAlive = new String(); if (isAlive) { deadOrAlive = "A Living "; } else { deadOrAlive = "A Dead "; } return "[" + deadOrAlive + organismType + ": " + currentHP + "/" + maxHP + " | " + lastReproduced + "/" + reproduceEvery + " - ateThisTurn = " + ateThisTurn + "\n"; } public boolean justAte() { return ateThisTurn; } public boolean moveThisTurn() { return wantsToMove && isAlive; } public boolean isReadyToReproduce() { return super.isReadyToReproduce() && maxHP == currentHP && ateThisTurn && isAlive; } public boolean isBurning() { return false; } } import java.awt.*; import java.util.ArrayList; public class Breeder { public Breeder() { } public static void breed(Organism breedingOrganism, WorldWorker environment, Point pointHolder)...

Words: 2671 - Pages: 11

Premium Essay

Research

...Java Programming, Second Edition Chapter Thirteen Understanding Swing Components In this chapter, you will: • • • • • Use the JFrame class Extend the JFrame class Use the JPanel class Understand Swing event listeners Use the JCheckBox class • Use the ButtonGroup class • Use the JComboBox class • Create JScrollPanes Using the JFrame Class GUI Components • Insert the import statement import javax.swing.*; to take advantage of the Swing GUI components and their methods • Also called widgets, which stands for windows gadgets • Within the awt package, components are defined in the Component class • When you use components in a Java program, you usually place them in containers Using the JFrame Class • Container- Type of component that holds other components so that you can treat a group of several components as a single entity – Usually takes the form of a window – Defined in the Container class Using the JFrame • The JFrame class is a subclass of the awt Component class • The JFrame is the best container option for hosting Java applications • The setSize() method allows you to set the physical size of a JFrame • The setVisible() method makes the JFrame component visible or invisible • Create a JFrame so that you can place other objects within it for display using a JPanel Using the JFrame • The JFrame class has four constructors – JFrame() constructs a new frame that is initially invisible – JFrame(GraphicsConfiguration gc) creates a JFrame in the specified...

Words: 2413 - Pages: 10

Free Essay

Errors in Programming

...Larquetta Permenter IT110-1402A-01 April 23, 2014 As a programmer, we’re always trying to prepare our software to be perfect. This means no errors! Since we’re human, we can only do our best. It’s when these errors occur, how they are dealt with, error or exception handling. Understanding each type will go a long way when client acceptance testing begins. Errors are problems in program operations usually caused because the code isn’t written correctly or a problem occurred that wasn’t addressed during the design process. According to the Board, the term exception is a reclassification of errors into a category of errors that can occur in a program but can be handled in a way that allows the program to continue operation.(Editorial Board, 2014) Dealing with errors in a well-defined way allows programmers to write code to handle errors. This is exception handling. There are pros and cons for using error and exception handling. Exception handling enables normal code to be written and to deal with the exceptional cases code elsewhere. It also provides the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program. A second advantage of exceptions is the ability to propagate error reporting up the call stack of methods which allows grouping and differentiating error type objects. In traditional programming, error detection, reporting, and handling often leads to confusing code. This presents disadvantages...

Words: 401 - Pages: 2

Free Essay

Global Demand Generation

...Standard Operating Procedure Global Demand Generation |Document Identification Number (For this Document) : BIRLASOFT/SOP TPL/SoP Template | |Document Identification Number : BIRLASOFT/SOP/ | |Activity |Dept/Group |Name |Signature | |Prepared By |< XXXXXXXXXXXXXXXX> | | | |Reviewed BY |< XXXXXXXXXXXXXXXX> | | | |Approver 1 |< XXXXXXXXXXXXXXXX> | | | Version Control History |Version No. |Description Of Change (include the sections # that are modified) |Date of Release | | | |( dd-mon-yy) | |V 1.0 |First Version Release | | |V1.1 | | ...

Words: 1446 - Pages: 6

Free Essay

Buffer Writer

...//Example reads in employee data from user //data is not stored in an Employee object but is written into files using //Formatter //PrintWriter //BufferedWriter import java.io.FileWriter; import java.io.BufferedWriter; import java.io.PrintWriter; import java.io.File; import java.util.Formatter; import java.util.Scanner; class FileWriterDemo { public void buffEmployeeFileWriter() throws Exception { String fName; String lName; int id; boolean quit = false; boolean response = true; Scanner console = new Scanner(System.in); Scanner input = new Scanner(System.in); Formatter output = new Formatter("EmployeeFormatter.txt"); //opens the file for editing FileWriter file = new FileWriter("EmployeePrintWriter.txt"); PrintWriter print = new PrintWriter(file); //turn on append flag for EmployeeBufferedFileWriter.txt FileWriter fwriter2 = new FileWriter(new File("EmployeeBufferedFileWriter.txt"), true); BufferedWriter bfw = new BufferedWriter(fwriter2); try { while (quit != response) { System.out.print("Enter Employee First Name:\n"); fName = input.next(); System.out.print("Enter Employee Last Name:\n"); lName = input.next(); System.out.print("Enter Employee id:\n"); id = input.nextInt(); //Example using Formatter ...

Words: 334 - Pages: 2

Free Essay

Team Charter

...• Everyone should contribute to the assignment on daily basis and inform of any issue if there is any exception. • Participate in decisions about group planning, assignments, etc. • If one cannot contribute for whatever reason, please notify in a timely manner. • Participate is must at least three times weekly if discussion is required. Assignment Submission: • Meet assignment deadlines agreed to by the team to allow for final submission on time. • Due date for individual contributions should be set as Friday by noon for each team assignment- giving team lead ample time to compile and submit the project by Sunday. • We should be able to target the submission timeline a day before so that we have enough time to react to any contingency. Team work: • We should work together as a team to deliver the assignment and utilize the strengths of each other. • Make sure that we are unified in the final product. • Be open and willing to do one’s part Weekly Meetings: • A weekly meeting should be held so that the defining of roles for each assignment can be done. • We should meet weekly once in the begging of assignment no later than Wednesday to define roles, assigning a team lead and assignment delivery structure. • Stay in contact with team members via forum or email at least 3 times weekly. • Communicate fairness issues openly and professionally Exceptions: • Team lead and team member should be notified immediately if there is any expectation in attendance...

Words: 381 - Pages: 2

Premium Essay

It 110

...IT110-1302A-06 Introduction to Programming Hockey Performance 5/6/2013 TABLE OF CONTENTS Contents TITLE PAGE 1 TABLE OF CONTENTS 2 Week 1: Project Outline 3 Week 1: Project Outline 4 Week 1: Use Case Diagrams 5 Week 1: Class Diagram 6 Week 2: Java Fundamental 7 Week 2: Java Fundamental 8 Week 3: Java Control Structures 9 Week 3: Java Control Structures 10 Week 4: Error Handling and File Input/Output 11 Week 4: Error Handling and File Input/Output 13 Week 4: Error Handling and File Input/Output 14 Week 4: Error Handling and File Input/Output 15 Week 4: Error Handling and File Input/Output 16 Week 4: Error Handling and File Input/Output 17 Week 4: Error Handling and File Input/Output 18 Week 4: Error Handling and File Input/Output 19 Week 4: Error Handling and File Input/Output 20 Week 5: Final Application Design & Screenshots 21 Week 5: Final Application Design & Screenshots 22 Week 5: Final Application Design & Screenshots 23 Week 5: Final Application Design & Screenshots 24 Week 5: Final Application Design & Screenshots 25 Week 5: Final Application Design & Screenshots 26 Week 5: Final Application Design & Screenshots 27 Week 5: Final Application Design & Screenshots 28 Week 5: Final Application Design & Screenshots 29 REFERENCE: An Introduction to Java Programming and Object-Oriented Application Development 29 ISBN-13: 9780619217464 29 Author(s): Johnson 29 Week 1: Project Outline ...

Words: 773 - Pages: 4

Free Essay

Nedjd

...|FRONT SHEET FOR ASSESSMENT fORM & FEEDBACK TO LEARNER(HND) | |ورقة الغلاف لنموذج ورقة العمل ونتائج المتدرب | |BTEC High National Diploma in { } | |Diploma in Programming Technology دبلوم تقنيه البرمجة | |HND Computing (software development) | | | |Student Name | |اسم المتدرب | | | | ...

Words: 1682 - Pages: 7