Question

Question 22 10 pts (CO 3) Demonstrate composition. Create a HardDrive class with the following attributes brand string . sizelnTB:float Create a Computer class with the following attributes brand string . drive: HardDrive HTML Editor Paragr

0 0
Add a comment Improve this question Transcribed image text
Answer #1
class HardDrive {
private:
    string brand;
    float sizeInTB;
};

class Computer {
private:
    string brand;
    HardDrive drive;
};

Add a comment
Know the answer?
Add Answer to:
Question 22 10 pts (CO 3) Demonstrate composition. Create a HardDrive class with the following attributes...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 33 10 pts (CO 1) Demonstrate a try-catch block for error handling. In the main...

    Question 33 10 pts (CO 1) Demonstrate a try-catch block for error handling. In the main method, get the number of kids for the person. If the person enters text (e.g., three), catch the exception, and tell the person about the error. Remember to reset the console input stream! HTML Editor U A Paragraph 0 words

  • this for my class SQL language Question 3 10 pts What errors are in the following...

    this for my class SQL language Question 3 10 pts What errors are in the following create statement? CREATE AUTHORS (AUTHOR NUM CHAR(10) PRIMARY KEY, 1ST NAME CHAR(20), LAST NAME CHAR(20), ADDRESS CHAR(100) NOT EMPTY.CITY CHAR(20), STATE CHAR(10), ZIP CHAR(6) HTML Editora B I VA -A I ET 1 1 1 XX, SE - E o N V PRVO T 12pt Question 4 10 pts Write the SQL to add the following customer to the Colonial Adventure Tours The customer...

  • Question 1 10 pts Explain how you would use DNA sequence data from two related organisms...

    Question 1 10 pts Explain how you would use DNA sequence data from two related organisms (like a mouse and human) to find a functional gene (10 points): HTML Editor Paragr

  • Create an abstract class Employee. Your Employee class should include the following attributes: First name (string)...

    Create an abstract class Employee. Your Employee class should include the following attributes: First name (string) Last name (string) Employee id (string) Employee home street address (string) Employee home city (string) Employee home state (string) Write a constructor to initialize the above Employee attributes. Create an abstract method called earnings.      Create another class HourlyEmployee that inherits from the abstract Employee class.   HourEmployee must use the inherited parent class variables and add in attributes HourlyRate and HoursWorked. Your HourEmployee class should...

  • Create an abstract class Employee. Your Employee class should include the following attributes: First name (string)...

    Create an abstract class Employee. Your Employee class should include the following attributes: First name (string) Last name (string) Employee id (string) Employee home street address (string) Employee home city (string) Employee home state (string) Write a constructor to initialize the above Employee attributes. Create an abstract method called earnings.      Create another class HourlyEmployee that inherits from the abstract Employee class.   HourEmployee must use the inherited parent class variables and add in attributes HourlyRate and HoursWorked. Your HourEmployee class should...

  • 0 words D Question 22 25 pts As World War I developed into a total war,...

    0 words D Question 22 25 pts As World War I developed into a total war, it affected the civilian populations of the combatants differently. How did the initial mobilization work in England, Germany, and the United States, and as the war dragged on, what were the social changes resulting in these countries? HTML Editor Paragr 囲▼ ЕЕ 潔囚阪@ 0 ν D-T TT-12pt

  • Create a java project and create Student class. This class should have the following attributes, name...

    Create a java project and create Student class. This class should have the following attributes, name : String age : int id : String gender : String gpa : double and toString() method that returns the Student's detail. Your project should contain a TestStudent class where you get the student's info from user , create student's objects and save them in an arralist. You should save at least 10 student objects in this arraylist using loop statement. Then iterate through...

  • In Java Create a class Worker. Your Worker class should include the following attributes as String...

    In Java Create a class Worker. Your Worker class should include the following attributes as String variables: Name, Worker ID, Worker Address, Worker City, Worker State Create the constructor that initializes the above worker attributes. Then make another class name HourlyWorker that inherits from the Worker class.   HourlyWOrker has to use the inherited parent class variables and add in hourlySalary and billableHours. Your HourlyWorker class should contain a constructor that calls the constructor from the Worker class to initialize the...

  • (1) Build the ItemToPurchase class with the following specifications: Attributes (6 pts) item_name (string) item_price (float)...

    (1) Build the ItemToPurchase class with the following specifications: Attributes (6 pts) item_name (string) item_price (float) item_quantity (int) Default constructor (2 pt) Initializes item's name = "none", item's price = 0, item's quantity = 0 Method print_item_cost() Ex. of print_item_cost() output: Bottled Water 10 @ $1 = $10 (2) In the main section of your code, prompt the user for two items and create two objects of the ItemToPurchase class. (4 pts) Ex: Item 1 Enter the item name: Chocolate...

  • Create a Python file (book.py) that has a class named Book. Book class has four attributes,...

    Create a Python file (book.py) that has a class named Book. Book class has four attributes, title (string), author(string), isbn(string), and year(int). Title - the name of the book. Author - the name of the persons who wrote the book. ISBN - is a unique 13 digit commercial book identifier. Year - the year the title was printed. Your class should have the following methods: (1) __init__(self, title, author, isbn, year): This method called when an object (book) is created...

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
ADVERTISEMENT
ADVERTISEMENT