void show( const Address address[], unsigned addressElements, const unsigned des
ID: 3648821 • Letter: V
Question
void show( const Address address[], unsigned addressElements,const unsigned desiredZip[], unsigned desiredZipElements );
Output all the addresses in address whose zip code matches any of the zip codes in desiredZip. Call the previous show function to do the output for each zip code. For instance, if desiredZip contained the two elements 91971 and 91975, then this show function might output
6401 Wetka Avenue
City0 CA 91071
-------------------------------------------
4792 Vura Boulevard
City1 CA 91971
-------------------------------------------
2001 Ranch Road
City2 Park CA 91971
-------------------------------------------
1234 Vory Boulevard
City3 CA 91975
-------------------------------------------
992 Sup Avenue
City4 CA 91975
-------------------------------------------
Please please write a function definition for: void show( const Address address[], unsigned addressElements, const unsigned desiredZip[], unsigned desiredZipElements ); & include what goes in main. Thanks!
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
struct Address{
unsigned number;
string street;
string suffix;
string city;
string state;
unsigned zip;
};
void show( const Address & address ){
cout<<"void show( const Address & address ); ";
cout<<address.number<<" "<<address.street<<" "<<address.suffix<<endl;
cout<<address.city<<" "<<address.state<<" "<<address.zip<<endl;
}
int main(){
Address add = { 18451, "Hatteras", "Street", "Tarzana", "CA", 91314 };
show( add );
}
Explanation / Answer
#include #include using namespace std; class person { public: string name; int age; }; int main() { person a, b; a.name = "Calvin"; b.name = "Hobbes"; a.age = 30; b.age = 20; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.