Related questions
MAKE CODE ACCORDING TO THE TEMPLATE PROVIDE AT THE END OF THE QUESTION. MATCH INPUT AND OUTPUT AS IT IS.
------------------------start---------------------------------
Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.
Write a C++ program to the donor and address details and display it.
The class Address has the following public data members.
The class Donor has the following public data members.
Include the following method in the Donor class.
In the main() method, obtain address and donor details from the user in the console and display it by calling displayDetails() method in Donor class.
[All text in bold corresponds to input and rest corresponds to output]
Sample Input and Output 1 :
Enter the name :
Riya
Enter the age :
22
Enter the height :
155.5
Enter the weight :
47
Enter the street :
2b,NWStreet
Enter the city :
Provo
Enter the state :
Utah
Enter the country :
America
Name :Riya
Age :22
Height :155.5
Weight :47
Street :2b,NWStreet
City :Provo
State :Utah
Country :America
-------------------------------End--------------
IN ATTACH IMAGE TEMPLATE IS PROVIDED FOR THE MAIN.CPP , DONOR.CPP AND ADDRESS.cpp . KINDLY CHECK BEFORE MAKING CODE
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- Object-Oriented Programming (Please do not use AI) Create a Java program that has the following: Inheritance - Create a superclass and one or more subclasses that inherit properties and methods from the superclass. Polymorphism - Show polymorphism by using method overriding and method overloading. Provide an example of runtime polymorphism by creating objects of the subclasses and calling overridden methods. Encapsulation - Demonstrate the concept of encapsulation by applying access modifiers (private, protected, public) appropriately in your program. Abstraction - Utilize abstract classes and methods in your program to illustrate abstraction. Show examples of the following words: super, this, static, finalarrow_forwardThere must be classes and objects.Attributes are of type publicUse one or two constructors.Write a program in Object Oriented Java language that adds and subtracts two polynomials of the form ax2 +bx+carrow_forwardJAVA:arrow_forward
- In object oriented programming which of the following concepts ensures that sensitive data is hidden from the end user? A) Polymorphism B) Encapsulation C) Inheritance D) Abstractionarrow_forwardThe non-static class level variables and non-static methods of a class are known as a. instance members b. object behaviors c. object attributes O d. object referencesarrow_forwardQuestion 52 Python is not great at Information Hiding because it doesn't allow creating data attributes for an instance from outside class definition allows access to data from outside class definition it doesn't allows access to data from outside class definition it doesn't allow write to data from outside class definitionarrow_forward
- Design, implement and test a class that can be used to hold information about a musical note. Test it with an appropriate driver program. DESIGN REQUIREMENTS A programmer MUST be able to set and retrieve the length of the note and the value of the note. The length of a note may be a sixteenth note, eight note, quarter note, half note, or a whole note. The note’s value is an integer. it is specified by counting how far the note lies above or below the A note that orchestras use in tuning ( https://en.wikipedia.org/wiki/A440_(pitch_standard) if needed to check ) . In counting "how far", you should count every key, both the white and black notes on a piano. So the A note above Middle C would have a value of 0. The A note one octave above that would have a value of 12. The default constructor should set a note to a A440 (an A note of frequency 440Hz) quarter note. Include methods to set a note to a specified length and value. Write methods to retrieve information about a note,...arrow_forward1. Which of the following is a mechanism in which one object acquires all the properties and behaviors of a parent object. It is an important part of OOPs (Object Oriented programming system)? Select one: a. Linear Data Structures b. Inheritance c. Encapsulation d. Polymorphismarrow_forward1. An unreachable object ___. a. Group of answer choices b. has an object reference count of -1 c. is marked for deallocation when a programmer calls freeMemory( ) d. is marked for deallocation e. is immediately deallocated by the Java virtual machinearrow_forward
- java code Problem : Bank Account Details Super Class : Account Attributes : customerid , customerame , balance , account Methods : 1-Read the account details 2-Display the Account details Sub class : Bank Attributes : deposit amount , withdraw the amount Methods : 1-Set the deposit amount and return the deposit amount 2-Set the withdraw amount and return the withdraw the amount 4- Display the Bank detailsarrow_forwardDevelop a Shipping Calculator Java application, which contains the concepts of a Java object and class. This Java Program must include the declaration and definition of object and class. The steps for the program are outlined below: Create a Java class named Package that contains the following: Package should have three privateinstance variables of type double named length, width, and height. Package should have one privateinstance variable of the type Scanner named input, initialized to in. No-args(explicit default) public constructor, which initializes all three double instance variables to 1.0. Initial(parameterized) public constructor, which defines three parameters of type double, named length, width, and height, which are used to initialize the instance variables of same name. Public copyconstructor, with a parameter of type Package, used to duplicate an existing Package object. Three public void methods named inputLength,inputWidth, and inputHeight. Each method will...arrow_forwardComputational thinking for a software developer/computer programmer is a critical skill that is consistently applied. This lab requires you to develop a solution using Java object-oriented programming that simulates creating and managing a collection of songs. The system manages information about a collection of songs. The system stores the following information (for each attribute, choose any type that you think is appropriate--you must be able to justify the decisions you make): Collection Name: the name for the collections of songs Collection list of songs: the system allows you to create a collection with unlimited songs. You can add the same song multiple times to any given collection. Hence, the collection allows songs to be duplicated Note: other system functionalities can be inferred from the given JUnit test. o NoSystem.out.printlnstatementsshouldappearinit.o NoScanneroperations(e.g.,input.nextInt())shouldappearinit. Instead, declare the method's input parameters as indicated...arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education