C++ How to Program (Early Objects Version)
10th Edition
ISBN: 9780134448824
Author: Paul Deitel; Harvey M. Deitel
Publisher: Pearson Education (US)
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Bank Accounts (Use Python)
Write a program that accepts bank transactions and prints out the balance of an account afterwards.
PROGRAM DESIGN
Create a class named bankAccount. A bank account should have the following attributes: accNumber, balance, and dateOpened. This class should also have the option to do the following transactions: deposit, withdraw and drop. Initially there is only one bankAccount active in the program, with a balance amount of 1515, and was opened back in 10/01/1987.
Depositing adds to a current bankAccount’s balance, while withdrawing – does otherwise. Dropping would equate the current balance to zero. Refer to the following class diagram for more details about the current bankAccount:
bankAccountaccNumber = 1balance = 1515dateOpened = "10/27/1987"
deposit(dep)withdraw(wd)drop(accNumber)
INPUTThe input would be a string that contains the following data: the transaction to be done (dep – for deposit, wd – for withdraw and drop – for drop), the accNumber, and…
Java Assignment
Outcomes:
Student will demonstrate the ability to utilize inheritance in a Java program.
Student will demonstrate the ability to apply the IS A and HAS A relationships.
Program Specifications:
Start by watching Video Segment 16 from Dr. Colin Archibald's video series (found in the module overview). Key in the program shown in the video and make sure it works.
Then, add the following:
Animals have a Weight.
Animals have a Height.
Dog is an Animal.
Dogs have a Name.
Dogs have a Breed.
Dogs have a DOB.
Cat is an Animal
Cats have a Name.
Cats have 9 lives, so you need to keep track of the remaining lives once a cat dies.
Bird is an Animal
Birds have a wing span
Birds have a canFly which is true or false (some birds cannot fly)
Create a test class that creates one of each type of animal and displays the animal’s toString method.
Submission Requirements:
You must follow the rules from the prior assignments. UMLs and Design Tools are not required for this one.
YOU MAY…
Define the following terms with the help of examples:
Encapsulation
Constructor.
Chapter 11 Solutions
C++ How to Program (Early Objects Version)
Ch. 11 - Exercises11.3 (Composition as an Alternative to...Ch. 11 - (Inheritance Advantage) Discuss the ways in which...Ch. 11 - (Protected vs. Private Base Classes) Some...Ch. 11 - Prob. 11.6ECh. 11 - Prob. 11.7ECh. 11 - (Quadrilateral Inheritance Hierarchy) Draw an...Ch. 11 - Package Inheritance Hierarchy} Package-delivery...Ch. 11 - (Account Inheritance Hierarchy) Create an...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- (The Time class) Design a class named Time. The class contains: - The data fields hour, minute, and second that represent a time. - A no-arg constructor that creates a Time object for the current time. (The values of the data fields will represent the current time.) -A constructor that constructs a Time object with a specified elapsed time since midnight, January 1, 1970, in milliseconds. (The values of the data fields will represent this time.) -A constructor that constructs a Time object with the specified hour, minute, and second. - Three getter methods for the data fields hour, minute, and second, respectively. -A method named setTime (long elapseTime) that sets a new time for the object using the elapsed time. For example, if the elapsed time is 555550000 milliseconds, the hour is 10, the minute is 19, and the second is 10. Draw the UML diagram for the class and then implement the class. Write a test program that creates two Time objects (using new Time (), new Time(555550000),…arrow_forwardc++ questionarrow_forward(Quadrilateral Inheritance Hierarchy) Draw an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the base class ofthe hierarchy. Make the hierarchy as deep as possible.arrow_forward
- Number Guessing Program using java: The player has to guess a number given in between a range. If the guessed number is right, the player wins else, loses. It also has the concept of limited attempts where the player has to guess the number within the limited attempts given. Note: It must incorporates the following OOP components: - Classes - Objects - Constructors - Class Variable - Object Methodarrow_forwardTask 3: Properties (Assignment)You have to write a program for an estate agency. The program must manage renting of properties. Your solution must implement the concepts of encapsulation and inheritance.Information required on all the properties listed to be rented: Type of property (residential (R) or business (B)), name of the owner, contact number of owner, duration of the contract (in months).Residential: Type of property (Flat, Townhouse or House), number of bedrooms, number of bathrooms, number of garages, rent per month.Business: Size in square meters, insurance per month, rent per month.Two separate reports must be displayed for the two types of properties. The output for residential properties must be displayed as follows:Owner Contact number Months Type BedR BathR Rent(pm)Joe Bloom 0879678223 24 T 4 3 R19000The rent for residential properties depend on the type of property and the number of bedrooms.Flat – R8000pm + R 500pm per bedroomTownhouse – R…arrow_forward(Kotlin/Android Studio) When an Intent is created with a Context and Class object, it is considered an ______ intent. Multiple Choice generic activity implicit expliciyarrow_forward
- C# question using inheritance: Write a program that creates a ‘shape calculator’. There must be: Shape, Circle, Rectangle, and Triangle classes. There should also be a Point class. Set up proper protection. You need to set up the inheritance. Each class must be in a separate file. Circle, Rectangle and Triangle must have methods that calculate area and perimeter. There should be at least one constructor that fills all the Point (and radius) attributes for Circle (1 Point), Rectangle (2 Points) and Triangle (3 Points). Overload the add operator to add areas of like objects (2 circles, 2 rectangles, 2 triangles) for each child class. If the circle or rectangle or triangle does not exist, an error should be thrown and caught and a message should be made to your output screen. A looping menu should be made to offer the user to create the shapes, get the area and perimeter and enter a point for the circle/rectangle/triangle. All shapes should have double attributes. Circle should have a…arrow_forwardConstructor (default vs user defined)arrow_forward(Java) The Abstract Art Class Write an abstract class as follows: The class is named Art It inherits from the Comparable interface It has a private String member variable named name It has a private String member variable named artist It has a private int member variable called year It has a default constructor that assigns the values "No name" to name, "No artist" to artist and -1 to the year. This default constructor calls the three argument constructor. It has a three-argument constructor to assign values to the name, artist and year variables. It has a copy constructor that makes a copy of another non-null Art object It has getters and setters for the name, artist and year variables It has a toString() method that creates a string of artist, with name and year tabbed once on subsequent lines (see sample output) It has an equals method that compares this Art to another Object It has a compareTo method that compares in this order: 1) artist, 2) name, 3) year This class contains no…arrow_forward
- Please help with this PYTHON program: Implement inheritance and polymorphism to complete this program: Design a Python class for a complex object (car, house, computer, being, container structure) Create a simple program with a menu (user input and output, text in a console) to interact with one of the components that: Instantiates an object from a class that has attributes and behaviors reflecting your design, gets basic input from a user that fills in the attributes of your object, displays basic info about your object and its behaviors, A menu item that allows the user to quit the program; saying goodbye when selected, Note: Be sure to use a loop to get back to the menu after finishing an item (other than quitting) to ask the user what to do next. Include a comment near the top of your driver's source file that describes a few tests that would show the program working correctly if you did them Thank you!arrow_forwardNEED HELP IN JAVA "INHERITANCE" MUST BE IMPLEMENTED"INHERITANCE" Instructions1. Create a java program that will simulate a simple calculator which utilizes inheritance. Thecalculator must include the four mathematical operations (Addition, Subtraction,Multiplication, Division) and will be an individual class. a) Ask the user to enter 1 st number and 2 nd number.b) It is also the users option on what mathematical operation to be used.c) Display the result in whole, for example 2 + 3 = 5.arrow_forwardClasses: Write a Person class that has these attributes: person_ID, first and last names, and age Default and overloaded constructors Accessors and mutators equals method toString method (make this virtual if C++, don't forget to prep the class for polymorphism) Inheritance: Create a child class to Person called Student: Attributes: GPA and status (freshman, sophomore, junior, senior, graduate, graduated). Make sure you have appropriate accessor/mutator methods Create another child class to represent Faculty. This class will have faculty rank and length of service as attributes along with an office location. Again, add methods as needed. Application Create an application that displays a menu that allows users to add students or faculty, or print either one or exit. Must use an array and add comments on your code. C++arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
.2: Function Parameters and Arguments - p5.js Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=zkc417YapfE;License: Standard Youtube License