Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ program/C++ Graphics: This one is rough. Any help is appreciated! Especially with the displayLetter function! stamp.bmp In the example, 6 ounces was entered for
C++ program/C++ Graphics: This one is rough. Any help is appreciated! Especially with the displayLetter function!
stamp.bmp In the example, 6 ounces was entered for the weight. This results in 6 stamps being displayed as shown. : eric susan 4glin 1 The cost for a single first class stamp is 47 cents A summary box is shown near the bottom of the Ciraphics Window This box should display the weight, the cost of a first class stamp, and the total miling costs. The total mailing costs is the #ounces multiplied by 47 cents. Tatal Paang Cast 10,47 envelope.bmp The weight field is used for computing the mailing cost. The mailing cost is 2. The return address is always for the residence shown: Eric & Susan Johnson 1421 Glisan Ave Portland, OR 97232 47 cents1 ounce The cost for a single lirst class stamp is 47 cents. Your program will display a single first class stamp for each ounce. Use stamp.bmp for displaying the stamp. The following image contains the return address as shown above: + Graphks eric ssan The user is next prompted to run the program again as shown bclow: eri &susan 421 gisan ave portlarid, or 97232 1421 qlisan ave portland,ror 97232 returnAddress.bmp 3. A stamp is displayed for each ounce entered for the weight. The first Examples for 1, 2, 3, 4, and 5 ounces for the weight are shown below: class stamp is given as stamp.bmp illustrated below C++ Graphics NOLINGON 421 glison ove 1421 alisan av portlond, or 97232 PAR AV Joe Sith Conway AR 72035 ericssa pertlord.97232 Coat of FirsE ClSanp: 47 Cents Total Mailing Cost 2.30 Required Functions Rerurn Value: tue if address is valid, false otherwise. Note: This function should be called in main with input parameter contain the 2-charcter state's abbreviation. The output of this function is all upper casc string. The following functions are required when implementing this program You are free to add any extra functions that you like. Validates the city based on its rule can contain only ulphas and the first letter must bc uppercasc Input: ntring ity string containing the city's name. Return Value: true if city is valid, false otherwise. vaiddplaylct.tar tring f, atrimg 1n, ring adir, tring gztHtringtring prompt.); Displays the nostage letter as shown on page 2. The images and fields Prompts the user for a string based on the input parameter prompt. The user-entered strin should be displayed as shown. Lupul: Le..y -" -First Name ufrecipient. Input: elring ln - Last Name of recipient. Input: ting addn- Street Address of recipient. Input: at.ring city - City name of recepient Input: atrirg aate - State abbreviation of recepient g is returned ass string data type Input: at.ring promp: - string infoming user what type of data they should enter. Examples for lhis prumpl are: Validates the state ahbreviation based on its rule ean contain only alphas and has length of exactly 2 letters Input: strine state string containing the state's abbreviation. Return Value: true if state is valid, false otherwise Ener LasL Name EnteStreet Adclres8: Hntar Cty: Enter tate CnLer 2 Code Enter Phone: ool va idatezin(string zip Validales the zip code based un its rule - cun conlain unly digits and hus length of exactly 5 letters. Return Value: string containing the data entered by the user husInput: atring 7ip -Zip code of reccpient Input: int wcight: wight of poago lester This function should perform the following steps: 1. Display envelope.bmp at (0,0). 2. Display returnAddress.bmp. 3. Combine the first name and last name and display on one line as Input: string zip - string containing the zip code. Validates either the first name or last name (both have the same rule can conlain only alphas). Return Vulue: true if zip code is valid, false otherwise. Input: aLi sing containing a name either lirst name or last name. Only residential names are considered. sLring converLToUppe (sLrin ul)i Converts characters stored in input to all uppercase. The converted characters are then reurned by this function Rcturn Valuc: truc if name is valid, falsc otherwisc. shown on page 2. 4. Display the stroet address bencath the name as shown on page 2. . Combine the city, state, and zip code and display on one line as Input: Lring sLring array of characters. Validates the street address based on its rule can contain only alpha, numerics or spaces Input: strina adres string containing the street address the street address consists of a strect number and street namc only Return value atrina - a string containing the uppercase converted shown on pagc 2. charucters 6. Display the appropriate number of stamps based on the weight. Add e stamp for each ounce of weight. 7. Display a summary box containing the weight, cost of a first class stamp, and the total postage costs. A first class stamp is always 47 cents for this program. The postage cost is computed as: cost weight*0.47; Where weight is an integer value measured in ounces. Special Note The example screen capture is provided only as an example of what the results should look like. You will not be deducted points if your results are not identical to the one shown (your results should be neatly done and readable though). stamp.bmp In the example, 6 ounces was entered for the weight. This results in 6 stamps being displayed as shown. : eric susan 4glin 1 The cost for a single first class stamp is 47 cents A summary box is shown near the bottom of the Ciraphics Window This box should display the weight, the cost of a first class stamp, and the total miling costs. The total mailing costs is the #ounces multiplied by 47 cents. Tatal Paang Cast 10,47 envelope.bmp The weight field is used for computing the mailing cost. The mailing cost is 2. The return address is always for the residence shown: Eric & Susan Johnson 1421 Glisan Ave Portland, OR 97232 47 cents1 ounce The cost for a single lirst class stamp is 47 cents. Your program will display a single first class stamp for each ounce. Use stamp.bmp for displaying the stamp. The following image contains the return address as shown above: + Graphks eric ssan The user is next prompted to run the program again as shown bclow: eri &susan 421 gisan ave portlarid, or 97232 1421 qlisan ave portland,ror 97232 returnAddress.bmp 3. A stamp is displayed for each ounce entered for the weight. The first Examples for 1, 2, 3, 4, and 5 ounces for the weight are shown below: class stamp is given as stamp.bmp illustrated below C++ Graphics NOLINGON 421 glison ove 1421 alisan av portlond, or 97232 PAR AV Joe Sith Conway AR 72035 ericssa pertlord.97232 Coat of FirsE ClSanp: 47 Cents Total Mailing Cost 2.30 Required Functions Rerurn Value: tue if address is valid, false otherwise. Note: This function should be called in main with input parameter contain the 2-charcter state's abbreviation. The output of this function is all upper casc string. The following functions are required when implementing this program You are free to add any extra functions that you like. Validates the city based on its rule can contain only ulphas and the first letter must bc uppercasc Input: ntring ity string containing the city's name. Return Value: true if city is valid, false otherwise. vaiddplaylct.tar tring f, atrimg 1n, ring adir, tring gztHtringtring prompt.); Displays the nostage letter as shown on page 2. The images and fields Prompts the user for a string based on the input parameter prompt. The user-entered strin should be displayed as shown. Lupul: Le..y -" -First Name ufrecipient. Input: elring ln - Last Name of recipient. Input: ting addn- Street Address of recipient. Input: at.ring city - City name of recepient Input: atrirg aate - State abbreviation of recepient g is returned ass string data type Input: at.ring promp: - string infoming user what type of data they should enter. Examples for lhis prumpl are: Validates the state ahbreviation based on its rule ean contain only alphas and has length of exactly 2 letters Input: strine state string containing the state's abbreviation. Return Value: true if state is valid, false otherwise Ener LasL Name EnteStreet Adclres8: Hntar Cty: Enter tate CnLer 2 Code Enter Phone: ool va idatezin(string zip Validales the zip code based un its rule - cun conlain unly digits and hus length of exactly 5 letters. Return Value: string containing the data entered by the user husInput: atring 7ip -Zip code of reccpient Input: int wcight: wight of poago lester This function should perform the following steps: 1. Display envelope.bmp at (0,0). 2. Display returnAddress.bmp. 3. Combine the first name and last name and display on one line as Input: string zip - string containing the zip code. Validates either the first name or last name (both have the same rule can conlain only alphas). Return Vulue: true if zip code is valid, false otherwise. Input: aLi sing containing a name either lirst name or last name. Only residential names are considered. sLring converLToUppe (sLrin ul)i Converts characters stored in input to all uppercase. The converted characters are then reurned by this function Rcturn Valuc: truc if name is valid, falsc otherwisc. shown on page 2. 4. Display the stroet address bencath the name as shown on page 2. . Combine the city, state, and zip code and display on one line as Input: Lring sLring array of characters. Validates the street address based on its rule can contain only alpha, numerics or spaces Input: strina adres string containing the street address the street address consists of a strect number and street namc only Return value atrina - a string containing the uppercase converted shown on pagc 2. charucters 6. Display the appropriate number of stamps based on the weight. Add e stamp for each ounce of weight. 7. Display a summary box containing the weight, cost of a first class stamp, and the total postage costs. A first class stamp is always 47 cents for this program. The postage cost is computed as: cost weight*0.47; Where weight is an integer value measured in ounces. Special Note The example screen capture is provided only as an example of what the results should look like. You will not be deducted points if your results are not identical to the one shown (your results should be neatly done and readable though)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started