UESTION PROVIDED IN ATTACHED IMAGE KINDLY SEE. PROVIDE OUTPUT AS IT IS SHOWN IN QUESTION. AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , donor.cpp , address.cpp ) ----------------- TEMPLATES BELOW FOR SOLUTI
UESTION PROVIDED IN ATTACHED IMAGE KINDLY SEE. PROVIDE OUTPUT AS IT IS SHOWN IN QUESTION. AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , donor.cpp , address.cpp ) ----------------- TEMPLATES BELOW FOR SOLUTI
UESTION PROVIDED IN ATTACHED IMAGE KINDLY SEE. PROVIDE OUTPUT AS IT IS SHOWN IN QUESTION. AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , donor.cpp , address.cpp ) ----------------- TEMPLATES BELOW FOR SOLUTI
QUESTION PROVIDED IN ATTACHED IMAGE KINDLY SEE. PROVIDE OUTPUT AS IT IS SHOWN IN QUESTION.
AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , donor.cpp , address.cpp )
----------------- TEMPLATES BELOW FOR SOLUTION -----------------------
main.cpp
#include<iostream> #include<string.h> #include<iomanip> #include<stdio.h> #include<cstdio> #include "Address.cpp" using namespace std; int main() { int n; cout<<"Number of details\n"; cin>>n;
//Fill your code here
return 0; }
Address.cpp
#include<string.h> #include<iostream> #include <stdio.h> using namespace std; class Address { private: string addressLine1; string addressLine2; string city; string state; int pincode;
public:
//Fill your code here
void display(Address obj[], int n){ //Fill your code here } };
Transcribed Image Text:Chandler's company completed its 25 years of service successfully. To celebrate this grand occasion
they want to throw a party and invite all the employees as well as the alumni of the company. So
Chandler has been assigned the duty to make a list of the current address of all the people to be invited
to the party in a perfect manner so that it is easy to send the invitations. He is confused about how to
sort the addresses just when his good friend Joey comes up with an idea to print addresses in a
particular order using the 'printf method and display them in ascending order.
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 get the address details of the companies from the user and to display the
address details in ascending order based on the company name. Use the given specified format to
display the details.
Create a class called Address With the following private member variables
Data type
string
string
string
string
int
Variable
addressLine1
addressLine2
city
state
pincode
Include appropriate default and parameterized constructors with parameters passed in the same order
as declared in the class.
Include following member function and constructor in Address class
Member Function
Description
This method is used to display the Address details in ascending order.
Use printf("%-25s%-25s%-25s%-25s%-25d\n",addressLine1, addressLine2,city,state,pincode)
to display the address details as the specified format.
void display(Address obj[], int n)
In the main method, obtain input from the user in the console and create an array of an object for
Address and assign the values to the object's members.
Display the details by calling the display method.
Print the string "Address details:" and use "%-25s%-25s%-25s%-25s%-25s\n" to print the table header in the
specified format in the main method itself.
Input and Output format:
The input consists of address details of the companies.
Display the address details in ascending order based on the company name.
Refer sample Input and Output for formatting specifications.
Sample Input and Output :
[All text in bold corresponds to input and the rest corresponds to output]
Number of details
2
Enter Address Details 1:
Enter Line1
Cisive
Enter Line2
Corporate Court
Enter City
Holtsville
Enter State
NewYork
Enter Pincode
501
Enter Address Details 2:
Enter Line1
Amphisoft Technologies
Enter Line2
Gandhipuram
Enter City
Coimbatore
Enter State
TamilNadu
Enter Pincode
641037
Address Details:
AddressLine1
AddressLine2
City
State
Pincode
Amphisoft Technologies Gandhipuram
Cisive
Coimbatore TamilNadu 641037
Corporate Court Holtsville
NewYork 501
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
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.