Question: 1182 Exercise 2 Abstraction Mechanics For this assignment, you can just open Word or NotePad. There is no code in this mechanics assignment.Remember that abstraction

 1182 Exercise 2 Abstraction Mechanics For this assignment, you can just

1182 Exercise 2

Abstraction Mechanics

For this assignment, you can just open Word or NotePad. There is no code in this mechanics assignment.Remember that abstraction is the process of hiding the implementation from the end user. To start this processed you really need to start thinking about what classes you will need and what makes up your classes. This becomes a difficult but critical part of program design.

Normally when you are trying to find classes you will write and their parts, it helps to remember the following comparisons:

  • Nouns are most likely your classes (or future objects).
  • Adjectives that describe the noun are going to be your properties/class-level variables.
  • If there is an action (verbs) that the noun will perform, these will likely be your methods.

Noun

=

Class/Object

Adjective

=

Attribute/Field/Property/Class-Level Variable

Verb

=

Method

Using this comparison, find the Classes, Attributes, or Methods that can be seen in each of these scenarios: (This first set is pretty straight forward and is just to get your brain working in the right way.)

  1. A person has a name, address, and phone number.

Class = Person; Properties = Name, Address, PhoneNumber

  1. A shape has a number of sides and color.

  1. An animal has a fur color, eye color, and leg count.
  2. A vehicle as a count of doors, count of wheels, max speed, color, whether or not it has an engine.

  1. A house has an address, square footage, number of bathrooms, number of bedrooms, it might have a garage, number of levels, and appraised value.

  1. A product has a cost, quantity, and gets the total inventory cost from the cost and quantity

Class = Product; Properties=Cost, Quantity; Methods= GetInventoryCost

  1. A circle has a radius and color; it can also be told to change its color.

  1. An employee has an employee number, hours worked, a pay rate, and can get the current pay based on hours worked and the pay rate.

  1. An airplane has a number of passengers, year purchased, and can turn left or right; it can also increase altitude and decrease altitude.

For these next set of problems, I will give you some short statements and you will need to first figure out all of the classes you will need, then figure out the attributes and methods needed. Not all of the exercises will have all three.

  1. You need to write a program that tracks the books that are in a library. Books have a title, call number, and count of pages.

Classes: Book; Attributes: title, CallNumber, CountOfPages

(You do not need a class for the program because you are writing that, it will not have its own class. Nor do you need one for the library, because it has no attributes to capture)

  1. Write an app that keeps a record of how much soda is left in the machine. Make sure to keep track of the number of ounces of syrup, the name, and whether the soda is diet or regular.

  1. Mary has an ice cream parlor. She sells shakes or ice cream cones. Both shakes and cones have a flavor. Shakes are measured in ounces, while cones are measured in the number of scoops. Cones can also be regular or waffle.

  1. You will write a calendar application. The applications needs to keep track of events. Each event has a start and end date. Events also have a name and color on the calendar. Events will need to be able to tell you how many hours or days are left before the event starts.

  1. Hamad wants to have a digital clocking system. Each employee has a id number and clocks in at a given time each work day and leaves each work day. There are two plants which need to use this application. Each plant has an address and a number of employees. At any time the plant should be able to tell how many employees are currently on the clock. Each plant will also turn on a sign when the manager lets the plant know it is close to the end of the shift.

  1. The biology department wants an application that will help them record all of the insects identified by classes. Students are enrolled in a class section that meets in a given room and has a list of current students as well as the maximum number of students allowed in the class. For each insect identified, the common name, scientific name, length, color, and sex will be kept. Additionally the location of the bug will be recorded.

  1. Arnold loves his comic book collection. He wants an app that can help him keep track of his collections because he likes to visit collectors shows and wants to know what he is missing in his collection or what he has available for barter or trade. The year, issue, and month are important factors. He also needs to know which heroes appear in that issue. Another critical component is the condition of each copy he owns is important.

  1. Kiras music collection has been growing. She now wants an application to keep track of her collection. Her collection contains albums on LPs, CDs, and Cassettes. Each album has a title and year published. Each track on each album has an artist, genre, and length. You can get the length of an album by adding all of the tracks on the album together. Artists are identified by their name.

1182 Exercise 2 Abstraction Mechanics 10. You need to write a program that tracks the books that are in a library. Books have a title, call number, and count of pages. Classes Book, Allributes: title, CallNumber, CountOfPages (You do not need a class for the program because you are wriling thal, it will not have its own class. Nor do you need one for the library, because it has no attributes to cap- ture) 11. Write an app that keeps a record of how much soda is left in the machine. Make sure to keep track of the number of ounces of syrup, the name, and whether the soda is diet or regular. For this assignment, you can just open Word or NotePad. There is no code in this mechanics assign- ment. Remember that abstraction is the process of hiding the implementation from the end user. To start this processed you really need to start thinking about what classes you will need and what makes up your classes. This becomes a difficult but critical part of program design. Normally when you are trying to find classes you will write and their parts, it helps to remember the following comparisons: . Nouns are most likely your classes (or future objects). Adjectives that describe the noun are going to be your properties/class-level variables. If there is an action (verbs) that the noun will perform, these will likely be your methods. Noun - Class Object Adjective - Attributed Properly Cl evel Variable Verb - Method 12. Mary has an ice cream parlor. She sells shakes or ice cream cones. Both shakes and cones have a flavor. Shakes are measured in ounces, while cones are measured in the number of scoops. Concs can also he regular or walle. 13. You will write a calendar application. The applications needs to keep track of events. Each event has a start and end date. Events also have a name and color on the calendar Events will need to be able to tell you how many hours or days are lell before the event starts. Using this comparison, find the Classes, Attributes, or Methods that can be seen in each of these sce- narios: (This first set is pretty straight forward and is just to get your brain working in the right way.) 1. A person has a name, address, and phone number. Class - Person; Properties - Name, Address, Phone Number 2. A shape has a number of sides and color. 14. Hamad wants to have a digital clocking system. Each employee has a id number and clocks in at a given time each work day and leaves each work day. There are two plants which need to use this application. Each plant has an address and a number of employees. At any time the plant should be able to tell how many employees are currently on the clock. Each plant will also turn on a sign when the manager lets the plant know it is close to the end of the shift. 3. An animal has a fur color, eye color, and leg count. 4. A vehicle as a count of doors, count of wheels, max speed, color, whether or not it has an engine. 15. The biology department wants an application that will help them record all of the insects identi- fied by classes. Students are enrolled in a class section that meets in a given room and has a list of current students as well as the maximum number of students allowed in the class. For each insect identified, the common name, scientific name, length, color, and sex will be kept. Addi- tionally the location of the bug will be recorded. 5. A house has an address, square footage, number of bathrooms, number of bedrooms, it might have a garage, number of levels, and appraised value. 6. A product has a cost, quantity, and gets the total inventory cost from the cost and quantity Class - Product; Properties-Cost, Quantity, Methods-GetInventoryCost 16. Amold loves his comic book collection. IIe wants an app that can help him keep track of his collections because he likes to visit collectors shows and wants to know what he is missing in his collection or what he has available for barter or trade. The year, issue, and month are im- portant factors. He also needs to know which heroes appear in that issue. Another critical com- ponent is the condition of each copy he owns is important. 7. A circle has a radius and color; it can also be told to change its color 8. An employee has an employee number, hours worked, a pay rate, and can get the current pay based on hours worked and the pay rate. 17. Kira's music collection has been growing. She now wants an application to keep track of her collection. Her collection contains albums on LPs, CDs, and Cassettes. Each album has a title and year published. Each track on each album has an artist, genre, and length. You can get the length of an album by adding all of the tracks on the album together. Artists are identified by their name. 9. An airplane has a number of passengers, year purchased, and can turn left or right; it can also in- crease altitude and decrease altitude. For these next set of problems, I will give you some short statements and you will need to first figure out all of the classes you will need, then figure out the attributes and methods needed. Not all of the exercises will have all three. Endament 1182 Exercise 2 Abstraction Mechanics 10. You need to write a program that tracks the books that are in a library. Books have a title, call number, and count of pages. Classes Book, Allributes: title, CallNumber, CountOfPages (You do not need a class for the program because you are wriling thal, it will not have its own class. Nor do you need one for the library, because it has no attributes to cap- ture) 11. Write an app that keeps a record of how much soda is left in the machine. Make sure to keep track of the number of ounces of syrup, the name, and whether the soda is diet or regular. For this assignment, you can just open Word or NotePad. There is no code in this mechanics assign- ment. Remember that abstraction is the process of hiding the implementation from the end user. To start this processed you really need to start thinking about what classes you will need and what makes up your classes. This becomes a difficult but critical part of program design. Normally when you are trying to find classes you will write and their parts, it helps to remember the following comparisons: . Nouns are most likely your classes (or future objects). Adjectives that describe the noun are going to be your properties/class-level variables. If there is an action (verbs) that the noun will perform, these will likely be your methods. Noun - Class Object Adjective - Attributed Properly Cl evel Variable Verb - Method 12. Mary has an ice cream parlor. She sells shakes or ice cream cones. Both shakes and cones have a flavor. Shakes are measured in ounces, while cones are measured in the number of scoops. Concs can also he regular or walle. 13. You will write a calendar application. The applications needs to keep track of events. Each event has a start and end date. Events also have a name and color on the calendar Events will need to be able to tell you how many hours or days are lell before the event starts. Using this comparison, find the Classes, Attributes, or Methods that can be seen in each of these sce- narios: (This first set is pretty straight forward and is just to get your brain working in the right way.) 1. A person has a name, address, and phone number. Class - Person; Properties - Name, Address, Phone Number 2. A shape has a number of sides and color. 14. Hamad wants to have a digital clocking system. Each employee has a id number and clocks in at a given time each work day and leaves each work day. There are two plants which need to use this application. Each plant has an address and a number of employees. At any time the plant should be able to tell how many employees are currently on the clock. Each plant will also turn on a sign when the manager lets the plant know it is close to the end of the shift. 3. An animal has a fur color, eye color, and leg count. 4. A vehicle as a count of doors, count of wheels, max speed, color, whether or not it has an engine. 15. The biology department wants an application that will help them record all of the insects identi- fied by classes. Students are enrolled in a class section that meets in a given room and has a list of current students as well as the maximum number of students allowed in the class. For each insect identified, the common name, scientific name, length, color, and sex will be kept. Addi- tionally the location of the bug will be recorded. 5. A house has an address, square footage, number of bathrooms, number of bedrooms, it might have a garage, number of levels, and appraised value. 6. A product has a cost, quantity, and gets the total inventory cost from the cost and quantity Class - Product; Properties-Cost, Quantity, Methods-GetInventoryCost 16. Amold loves his comic book collection. IIe wants an app that can help him keep track of his collections because he likes to visit collectors shows and wants to know what he is missing in his collection or what he has available for barter or trade. The year, issue, and month are im- portant factors. He also needs to know which heroes appear in that issue. Another critical com- ponent is the condition of each copy he owns is important. 7. A circle has a radius and color; it can also be told to change its color 8. An employee has an employee number, hours worked, a pay rate, and can get the current pay based on hours worked and the pay rate. 17. Kira's music collection has been growing. She now wants an application to keep track of her collection. Her collection contains albums on LPs, CDs, and Cassettes. Each album has a title and year published. Each track on each album has an artist, genre, and length. You can get the length of an album by adding all of the tracks on the album together. Artists are identified by their name. 9. An airplane has a number of passengers, year purchased, and can turn left or right; it can also in- crease altitude and decrease altitude. For these next set of problems, I will give you some short statements and you will need to first figure out all of the classes you will need, then figure out the attributes and methods needed. Not all of the exercises will have all three. Endament

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!