Problem

(For students familiar with XML)   Suppose a class A's purpose in life is to convert a...

(For students familiar with XML)   Suppose a class A's purpose in life is to convert an object of another class B into textual form for storage to a file.   Suppose there are 3 parts to objects of class B that we will call "var", "const", and "virtual".   Class A will convert these parts into Strings and enclose them in tags of the form and where the kind indicates the type of part, which for our purposes we will suppose are var, const, and virtual.   These parts might also be nested.   A well-designed class A will have a method to convert each kind of part of B into a String, and then it will append those strings to finish the conversion.   Each method might look like the following:

public String convertVar() {		String result = " ";		 / /...convert rest of var part of B...		result += " ";		return result;	}	public String convertConst() {		String result = " ";		//...convert rest of const part of B...		result += " ";		return result;	}	public String convertVirtual() {		String result = " ";		//...convert rest of virtual part of B...		result += " ";		return result;	}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT