Q.4.3 Consider the following pseudocode, then write the pseudocode for mainlinelogic that contains the elements required in Q.4.3.1 to Q.4.3.3.
class Weapon
Declarations
string make
string model
string serialNumber
string countryOfOrigin
void setMake (string manufacturer)
set make = manufacturer
return
string getMake()
return make
endClass
Q.4.3.1 Declare each of the instance variables and include an object for the class in the mainline logic.Q.4.3.2 Assign the value “Glock” to the instance variable make.Q.4.3.3 Use the appropriate method to display the contents of the instance variable make on the screen.Q.4.4 Create an object diagram for the object created in Q.4.3.1. Your diagramonly has to include the details for the make instance variable.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here