Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 1, Problem 2RQ
When using an analogy involving a blueprint and a tree house, the ____________ is the class, and the ____________ is an object created from it.
- a. blueprint, tree house
- b. tree house, blueprint
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
class Widget: """A class representing a simple Widget
=== Instance Attributes (the attributes of this class and their types) === name: the name of this Widget (str) cost: the cost of this Widget (int); cost >= 0
=== Sample Usage (to help you understand how this class would be used) === >>> my_widget = Widget('Puzzle', 15) >>> my_widget.name 'Puzzle' >>> my_widget.cost 15 >>> my_widget.is_cheap() False >>> your_widget = Widget("Rubik's Cube", 6) >>> your_widget.name "Rubik's Cube" >>> your_widget.cost 6 >>> your_widget.is_cheap() True """
# Add your methods here
if __name__ == '__main__': import doctest # Uncomment the line below if you prefer to test your examples with doctest # doctest.testmod()
An n-sided regular polygon’s sides all have the same length and all of its angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon thatcontains:■ A private int data field named n that defines the number of sides in the polygon.■ A private float data field named side that stores the length of the side.■ A private float data field named x that defines the x-coordinate of the center of the polygon with default value 0.
■ A private float data field named y that defines the y-coordinate of the center of the polygon with default value 0.■ A constructor that creates a regular polygon with the specified n (default 3),side (default 1), x (default 0), and y (default 0).■ The accessor and mutator methods for all data fields.■ The method getPerimeter() that returns the perimeter of the polygon.■ The method getArea() that returns the area of the polygon. The formula for computing the area of a regular polygon is Area = (n * s2) / (4 *…
Using Visual Studio
C# Language
Note: not a User Input
Chapter 1 Solutions
Programming with Microsoft Visual Basic 2017
Ch. 1 - What is a computer program?Ch. 1 - What is a GUI?
Ch. 1 - What is the process of translating a solution into...Ch. 1 - In object-oriented programming, what is a class?Ch. 1 - Which window in the IDE lists the tools you can...Ch. 1 - While designing an interface, which window in the...Ch. 1 - Prob. 3MQ2Ch. 1 - Prob. 1MQ3Ch. 1 - Prob. 2MQ3Ch. 1 - What filename extension indicates that the file is...
Ch. 1 - Prob. 1MQ4Ch. 1 - Prob. 2MQ4Ch. 1 - Prob. 3MQ4Ch. 1 - Prob. 4MQ4Ch. 1 - Prob. 1MQ5Ch. 1 - What is the three-character ID used when naming...Ch. 1 - What is the purpose of an access key?
Ch. 1 - What character is used to designate an access...Ch. 1 - Prob. 1MQ6Ch. 1 - Prob. 2MQ6Ch. 1 - Prob. 3MQ6Ch. 1 - Prob. 4MQ6Ch. 1 - Prob. 1MQ7Ch. 1 - Prob. 2MQ7Ch. 1 - Prob. 3MQ7Ch. 1 - Prob. 4MQ7Ch. 1 - In the Code Editor window, what character...Ch. 1 - A(n)._____ is an environment that contains all of...Ch. 1 - When using an analogy involving a blueprint and a...Ch. 1 - You create your application’s user interface in...Ch. 1 - Each tool in the toolbox represents a class from...Ch. 1 - Which window is used to set the characteristics...Ch. 1 - Prob. 6RQCh. 1 - Prob. 7RQCh. 1 - Prob. 8RQCh. 1 - Which property is used to give a form file a more...Ch. 1 - Which property determines the initial position of...Ch. 1 - Prob. 11RQCh. 1 - Prob. 12RQCh. 1 - Prob. 13RQCh. 1 - Prob. 14RQCh. 1 - Prob. 15RQCh. 1 - What is the three-character extension appended to...Ch. 1 - Prob. 17RQCh. 1 - Prob. 18RQCh. 1 - Which statement terminates an application that...Ch. 1 - Prob. 20RQCh. 1 - Prob. 21RQCh. 1 - Prob. 22RQCh. 1 - Prob. 23RQCh. 1 - Prob. 24RQCh. 1 - Prob. 25RQCh. 1 - Prob. 1ECh. 1 - Prob. 8E
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certain business associates. Your program should be able to handle a maximum of 500 entries. Define a class addressType that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables. Define a class extPersonType using the class personType (as defined in Example 10-10, Chapter 10), the class dateType (as designed in this chapters Programming Exercise 2), and the class addressType. Add a member variable to this class to classify the person as a family member, friend, or business associate. Also, add a member variable to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the member variables. Define the class addressBookType using the previously defined classes. An object of the type addressBookType should be able to process a maximum of 500 entries. The program should perform the following operations: Load the data into the address book from a disk. Sort the address book by last name. Search for a person by last name. Print the address, phone number, and date of birth (if it exists) of a given person. Print the names of the people whose birthdays are in a given month. Print the names of all the people between two last names. Depending on the users request, print the names of all family members, friends, or business associates.arrow_forwardIn Inheritance, super class can also be called as ____________________________________ parent class child class sub class derived class ................. is description of the solution in object oriented design. ............role is responsible for issues management and risk management in team projects.arrow_forwardAssignment 2 A Student class has the following attributes: String name; String streetAddress; int age; String phonNumber; String mobileNumber; Requirements: . Create the setters and getters . Create one default constructor • create one paramertized constructor • Create an object of the class using the default constructor . ● . Create another object of the class using the paramertized constructor Make sure to suply the values from the keyboard Print the information about each employee . Make sure to add comments to you code and that your code is indented corectly . Use the camelCase naming convension. . Use try and catch block. After you are doneo a samle run and tak a screenshot of it. zip the screenshot and the sourc code file and upload the zipped file to the Blackboard.arrow_forward
- The Point2D should store an x and y coordinate pair, and will be used to build a new class via class composition. A Point2D has a x and a y, while a LineSegment has a start point and an end point (both of which are represented as Point2Ds). class Invariants The start and end points of a line segment should never be null Initialize these to the origin instead. Data A LineSegment has a start point This is a Point2D object All data will be private A LineSegment also has an end point. Also a Point2D object Methods Create getters and setters for your start and end points public Point2D getStartPoint() { public void setStartPoint(Point2D start) { Create a toString() function to build a string composed of the startPoint’s toString() and endPoint’s toString() Should look like “Line start(0,0) and end(1,1)” Create an equals method that determines if two LineSegments are equal public boolean equals(Object other) { if(other == null || !(other instanceof LineSegment)) return…arrow_forwardThe main advantage of the encapsulation is that, it provides abstraction between an object and its clients. Select one: O True OFalse Encapsulation is the process of grouping the attributes and method of an object together in a single data structure known as a class Select one: O True O False A constructor is a member variable that is called automatically when an object is created. Select one: O True O False We cannot declare more than one constructor per class. Select one: O True O False onarrow_forwardCreate an Employee Class with the ff: attributes: = String name = double salary = String birthday = __init__(self, name, salary, birthday) = String getDetails() -- returns a String value that represents all the information of the Employee object Create a Manager class that inherits Employee, a Manager will also have the ff: = String department = __init__(self, name, salary, birthday, department) = String getDetails() -- returns a String value that represents all the information of the Manager object Create a Director class that inherits Manager, a Director will also have the ff: = double carAllowance = __init__(self, name, salary, birthday, department, carAllowance) = def playGolf() -- will print a string value '{name of director} plays golf' = String getDetails() -- returns a String value that represents all the information of the Director object Create 2 objects of each class and call their respective getDetails() method. Do not write WET codes, be sure there's no…arrow_forward
- Class: Square Create a class called "Square", which is inherited from“TwoDimensionShape” class. The "Square" class is used to calculate theArea and the Perimeter of square shapes when their side-length is given, or in contrast,finding the side-length of the square when the Area or the Perimeter of the square is given.The specifications of this class are below. Data Members (Attributes): All are private. sideLength: the sidelight (L) of the square. Methods/Operations/Getters/Setters: Default Constructor: when creating an object this constructor must set the side-length of the square by calling the method setSideLength(). Also, this constructor willcall the findArea() and the findPerimeter() in addition to summaryPrint() to calculateand print all needed information. User-Defined Constructor: when creating an object this constructor shouldfind the side-length of the square by calling the method findSquareSideLength()and pass the Area or the…arrow_forwardJava - Constructors Create a class named Person that has the attributes: First name - String Last name - String Gender - String Age - Integer Address - String Create two constructors: one that accepts the first name and last name only and one that accepts all attributes. Accept inputs for all attributes and create two objects that use each constructor. Print their attributes. Inputs 1. Enter first name 2. Enter last name 3. Enter gender 4. Enter age 5. Enter address Marceus Azalithen Male 20 Azalithzith Sample Output Enter first name: John Enter last name: Doe Enter gender: Male Enter age: 19 Enter address: JDoe Object 1 First name: John Last name: Doe Gender: Age: Address: Object 2 First name: John Last name: Doe Gender: Male Age: 19 Address: JDoearrow_forwardA(n) _______________class is based on another class, and inherits characteristicsfrom it.arrow_forward
- A class called Author is designed to model a book's author. It contains:• Three private instance variables: name (String), email (String), and gender (char of either'm' or 'f');• An __init__() to initialize the name, email and gender with the given values• Getters/Setters: getName(), getEmail(), setEmail(), and getGender()(There are no setters for name and gender, as these attributes cannot be changed.)• A __str__() method that returns printable string of that object with the following format:"Author[name=?,email=?,gender=?]"e.g., "Author[name=Tan Ah Teck,email=ahTeck@somewhere.com,gender=m]".Write the Author class. Also write a test driver code to test all the public functions, e.g.,ahTeck = Author("Tan Ah Teck", "ahteck@nowhere.com", 'm') # Test the constructorprint(ahTeck) # Test __str__()ahTeck.setEmail("paulTan@nowhere.com") # Test setterprint("Name is: ", ahTeck.getName()) # Test getterprint("Email is: ", ahTeck.getEmail()) # Test getterprint("Gender is: ", ahTeck.getGender()) #…arrow_forwardDesign a class named Rectangle to represent a rectangle. The class must have the following: • double data fields named width and height. The default values are 1 for both width and height A no-argument constructor that creates a default bag. A constructor that creates a rectangle with the specified width and height A getParameter() method to return the perimeter. • A getArear() method to return the area of the Rectangle. Create two Rectangle objects. One with width 4.0 and height 10.0. The other object has width 6.3 and height 10.5.arrow_forwardJava please svalb mearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY