Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class which represents a Real Estate Transaction. The class will have the following state: O O O O Purchase Price in text
Create a class which represents a Real Estate Transaction. The class will have the following state: O O O O Purchase Price in text notation (type:String) The class will have the following constructor(s): O Default constructor O A constructor that takes 4 arguments. The class will have the following behaviour: Appropriate setters/getters A method which will return the four fields of the object as one string in which the front "half of the string is lowercase. letters and the back "half of the string is uppercase letters. O Street Number in text notation (type:String) Street Name City Amethod which returns.a.substring to the caller of the full state of the obiect.concatenated into one string in which one. portion (length to be determined by a random number) of the string is lowercase letters and a second portion ((length to be determined by a second different random numberllof the string is uppercase letters based upon two valid random numbers. The two substrings can be any size or portion but they cannot overlap and both portions together do not have to comprise the full string. The method must do internal checking to ensure that the two random numbers are valid.i, They cannot overlap and cannot go beyond the length of the String. O A method which takes two ints. The purpose of the method is to return an encrypted version of the state of the object as a single encrypted string to the caller. The method will concatenate the state of the object into one String. The first int will represent the index of the "key character" of the String. The second int will represent the index value of the first character to be encrypted; the key character will replace the first character of the string to be encrypted, and every third character thereafter. (For example: assume the concatenated String is ABCDEFGHIJ and the ints passed in are 2,3, this means that character 2 (C) replaces D, G and J.) The method must ensure that the first int is less than the second int passed in and that the neither int is greater than the length of the single concatenated String. If any of the info passed into the method is invalid return to the caller a "1" to represent an error. Create a test harness class which will instantiate a RealEstate Transaction object with 4 pieces of data you make up. Test method 1 Test method 2. Ask the user for two ints to test method three. If the ints are invalid ask the user for two more etc. until the user provide valid ints.
Step by Step Solution
★★★★★
3.41 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
import javautilRandom class RealEstateTransaction private String streetNumber private String streetName private String city private String purchasePrice Default constructor public RealEstateTransactio...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