Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Post Office In this project, you will sort envelopes as they arrive at the post

ID: 3841623 • Letter: P

Question

Post Office In this project, you will sort envelopes as they arrive at the post office. Your program should sort the envelopes by Zip code and assign them to one of the four mail carriers. Zip codes are assigned to mail carriers using the following information: Mail Carrier Zip Code Greg 60515 Natalie 60516 60517 Lynne Ed 60512 The data for this program are saved in the file named Lettes.dat below. This file contains the name of the person, to whom the letter is addressed, and the addressee's street address, city, state, and Zip code information. You will create all necessary constructors for the Letter class by using default function arguments, if appropriate. In addition, you should implement the name, street, city, and state dynamically instead of an array of characters, and the zip as integer. Make sure that you write a destructor for this class, as you are now using dynamically allocated memory. You should also overload the comparison operators and so that you can sort the mail by carrier. In addition, you will need to overload the assignment operator Your specification file (i.e., letter.h) should have a copy constructor, the s methods and get methods for name, street, city, state, and zip. Read the data from the file Letters.dat and print the information by mail carrier Use the following prototype for the print function: void print Letter int); You should have the following files: letter.h, letter.cpp, and letter drvr.cpp. Good Luck. Do a good job.

Explanation / Answer

void make_ppm_image(int country_code, int width) {

int stature;

/make sense of the stature by one means or another ???

make_ppm_header(width, stature);

on the off chance that (country_code == 0) {

make_france_flag(width, stature);

}

else if (country_code == 1) {

make_north_rhine_flag(width, stature);

}

/and so forth.

}

void make_france_flag(int width, int stature) {

int i;

for (i = 0; i < stature; i++)

make_france_flag_row(width);

}

void make_france_flag_row(int width) {

int i;

for (i = 0; i < width/3; i++)

make_pixel(0, 0, 255);

for (i = 0; i < width/3; i++)

make_pixel(255, 255, 255);

for (i = 0; i < width/3; i++)

make_pixel(255, 0, 0);

}