Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help please PRACTICE PROBLEMS Use the following class definition to answer the next set of questions. Elass House Private String address Private Real price Public

help please image text in transcribed
image text in transcribed
image text in transcribed
PRACTICE PROBLEMS Use the following class definition to answer the next set of questions. Elass House Private String address Private Real price Public Module House () Set address - Set price - 0.0 End Module Public Module House (string newAddress, Real newPrice) Set address = newAddress Set price = new Price End Module Public Module setAddress (String newAddress) Set address - newAddress End Module Public Function string getAddress Return address End Function Public Module setPrice (Real newPrice) [ CSI 111 Gaddis Chapter 14 - Part 2 - Practice Problems Week 5-1 Set price - new Price End Module Public Function Real getPrice () Return price End Function End Class 1. What is the name of this class? 2. Is this an application or a class? How can you tell? 3. How many attributes (data members) does this class contain? 4. What are the names and data types of the attributes (data members)? Click here to see the answers. 5. Complete the following table for the methods that are in the House class. Method Name Access Return Indicate Number of List of data modifier type whether the parameters type/parameter method is a pairs constructor, accessor, or mutator. Public Module House) Public Module House (String newAddress, Real newPrice) Public Module setAddress (String newAddress) Public Module setPrice (Real newPrice) Public Function String getAddress() Public Function Real getPrice () 6. Circle the default constructor 7. Put a box around the constructor that initializes each attribute (data member) to the value of a matching parameter 8. What is the return type for the following method? CSI 117 Gaddis Chapter 14 - Part 2 - Practice Problems Week 5 - 2 Why? Public function string getAddress ( ) Return address End Function 9. What is the return type for the following method? Why? Public Function Real get Price () Return price End Function 10. What is the return type for the following method? Why? Public Module setAddress (String newAddress) Set address - newAddress End Module

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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions