UESTION PROVIDED IN ATTACH IMAGE KINDLY SEE. 2) SAMPLE INPUT AND OUTPUT PROVIDED AT END PLEASE SEE. 3) IF THERE IS A DECIMAL IN OUTPUT WHETHER IT'S ZERO OR TWO PLACE DECIMAL YOU MUST MATCH AS IT IS WITH QUESTION OUTPUT NO MISMATCH IN OUTPUT ACCEPTED AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , ADDRESS.cpp ) ----------------- TEMPLATES BELOW FOR SOLUTION -----------------------
UESTION PROVIDED IN ATTACH IMAGE KINDLY SEE. 2) SAMPLE INPUT AND OUTPUT PROVIDED AT END PLEASE SEE. 3) IF THERE IS A DECIMAL IN OUTPUT WHETHER IT'S ZERO OR TWO PLACE DECIMAL YOU MUST MATCH AS IT IS WITH QUESTION OUTPUT NO MISMATCH IN OUTPUT ACCEPTED AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , ADDRESS.cpp ) ----------------- TEMPLATES BELOW FOR SOLUTION -----------------------
UESTION PROVIDED IN ATTACH IMAGE KINDLY SEE. 2) SAMPLE INPUT AND OUTPUT PROVIDED AT END PLEASE SEE. 3) IF THERE IS A DECIMAL IN OUTPUT WHETHER IT'S ZERO OR TWO PLACE DECIMAL YOU MUST MATCH AS IT IS WITH QUESTION OUTPUT NO MISMATCH IN OUTPUT ACCEPTED AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , ADDRESS.cpp ) ----------------- TEMPLATES BELOW FOR SOLUTION -----------------------
2) SAMPLE INPUT AND OUTPUT PROVIDED AT END PLEASE SEE.
3) IF THERE IS A DECIMAL IN OUTPUT WHETHER IT'S ZERO OR TWO PLACE DECIMAL YOU MUST MATCH AS IT IS WITH QUESTION OUTPUT NO MISMATCH IN OUTPUT ACCEPTED
AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.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 } };
------------TEMPLATE END-------------
SAMPLE INPUT AND OUTPUT BELOW
[All text in bold corresponds to input and the rest corresponds to output]
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 objl], 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.
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.