Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page 2 of 6 Copyright 2013, Dennis Rainey Hw2b : Part #2 - Passe-strings to functions Write a program that produces the following output OUTPUT:

image text in transcribed
Page 2 of 6 Copyright 2013, Dennis Rainey Hw2b : Part #2 - Passe-strings to functions Write a program that produces the following output OUTPUT: Enter your street address: 127 Main Street Enter your city: Corona Enter your state (2 digits): CA Enter your 5-digit zip code: 92123 Your full address is: getinfo) function displayAddress() function 127 Main Street, Corona, CA 92123 Note: The entire address, including commas and spaces should be held in the c_string named address Do you want to run the program again (Y N2 n Press any key to continue. Include the following in your program: 1.) Declare 5 c_strings, using the names and sizes listed: street -size #30 - city -state . size 3 - zip Il holds the street address Il holds the city II holds the state as 2 characters (like CA) Il holds a 5-character zip code -size = 20 size6 - address -size 60 Ill holds the entire address (street, city, state, and zip) 2.) Use 2 functions: getinfo0 and displayAddress getinfo The function does is a void-returning function. This function prompts the user to enter the street address, city, state, o o and zip code. (see output above) All of the inputs are assigned to c strings, which were passed by reference to the function. o When the function is finished, program execution returns to main). In main) Use c_string library functions to concatenate the values held in street, o city, state, and zip, and assign the whole string to address

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

Students also viewed these Databases questions