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

We revisit the topic of algorithms .... but this time you are on your own. I hav

ID: 3535328 • Letter: W

Question

We revisit the topic of algorithms .... but this time you are on your own. I have provided a discussion board where you can talk this over your ideas and develop a strategy. You do not need to write the code. Quite often we have to deal with strings that contain multiple pieces of information and really need to deal with them as individual units. One of those would be people's home addresses. Suppose the user enters their address into a single string called address. You need to take it apart into street address ( house number and street ) along with city, state and zip code. Explain your algorithm for doing this. Assume we may need to group things together, and sort things different ways. Your algorithm should be specific enough for one of your classmates to write the code based on your instructions. Here is an example address: 133 North Main Street, Canton OH 44701 We revisit the topic of algorithms .... but this time you are on your own. I have provided a discussion board where you can talk this over your ideas and develop a strategy. You do not need to write the code. Quite often we have to deal with strings that contain multiple pieces of information and really need to deal with them as individual units. One of those would be people's home addresses. Suppose the user enters their address into a single string called address. You need to take it apart into street address ( house number and street ) along with city, state and zip code. Explain your algorithm for doing this. Assume we may need to group things together, and sort things different ways. Your algorithm should be specific enough for one of your classmates to write the code based on your instructions. Here is an example address: 133 North Main Street, Canton OH 44701

Explanation / Answer

string address = Â 133 North Main Street, Canton ,OHÂ 44701;

char temp = stringtoCharArray(address);

count = String.length(address);

string subAddress[3];

string c;

int j =0;

for i=0 to count

{ if(temp[i]== ',')

{ subAddress[j] = c;j++;// whenver comma is encountered it is treated as next part of address

} else{ c= c+temp[i]; }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote