Question

In: Computer Science

In Object Oriented Programming, classes represent abstractionsof real things in our programs. We must quickly...

In Object Oriented Programming, classes represent abstractions of real things in our programs. We must quickly learn how to define classes and develop skills in identifying appropriate properties and behaviors for our class. To this end, pick an item that you work with daily and turn it into a class definition. The class must have at least three properties/data fields and three functions/behaviors (constructors and get/set functions don’t count). Do not pick examples from the textbook and do not redefine a class already defined by a classmate. Use proper C++ syntax to present your class.

Solutions

Expert Solution

#include
using namespace std;

class Computer
{
   private:
   string name;
   int RAM;
   double processor_speed;
  
   public:

  Computer() // default constructor
   {
       this->name = "";
       this->RAM = "";
       this->processor_speed = "";
   }
   Computer(string name,int RAM,double processor_speed) // argument constructor
   {
       this->name = name;
       this->RAM = RAM;
       this->processor_speed = processor_speed;
   }
  
   void print()
   {
       cout<<"Computer Name : "<        cout<<"\nRAM : "<        cout<<"\nProcessor Speed : "<    }
  
};
int main() {
  
   Computer c("Intel Core",4,2.93);
   c.print();
   return 0;
}

Output:

Computer Name : Intel Core
RAM : 4 GB
Processor Speed : 2.93 Ghz

Related Solutions

C++In Object Oriented Programming, classes represent abstractionsof real things in our programs. We must...
C++In Object Oriented Programming, classes represent abstractions of real things in our programs. We must quickly learn how to define classes and develop skills in identifying appropriate properties and behaviors for our class. To this end, pick an item that you work with daily and turn it into a class definition. The class must have at least three properties/data fields and three functions/behaviors (constructors and get/set functions don’t count). Do not pick examples from the textbook and do not redefine...
Explain what classes and objects are in object - oriented programming. Give an example of each...
Explain what classes and objects are in object - oriented programming. Give an example of each and explain how they work together in a computer program.
*OBJECT ORIENTED PROGRAMMING* GOAL: will be able to throw and catch exceptions and create multi-threaded programs....
*OBJECT ORIENTED PROGRAMMING* GOAL: will be able to throw and catch exceptions and create multi-threaded programs. Part I Create a class called Animal that implements the Runnable interface. In the main method create 2 instances of the Animal class, one called rabbit and one called turtle. Make them "user" threads, as opposed to daemon threads. Some detail about the Animal class. It has instance variables, name, position, speed, and restMax. It has a static boolean winner. It starts a false....
-What is object-oriented programming? -What is a class? -What is an object? -A contractor uses a...
-What is object-oriented programming? -What is a class? -What is an object? -A contractor uses a blueprint to build a set of identical houses. Are classes analogous to the blueprint or the houses? Explain. -What is a class diagram? How is it used in object-oriented programming? -What is an attribute in OOP? What is a data member? -What is a method in OOP? What is a member function? -What is the difference between private members and public members of a...
We now begin learningconcept in modern programming - Object Orientation Programming (OOP). Let's write our first...
We now begin learningconcept in modern programming - Object Orientation Programming (OOP). Let's write our first Class definition, and then instantiate an object of this Class to run in a test application to test our objects behaviors. Employee.java - Make an Employee Class, code to the design of the UML diagram -name: String -employeeId: int -Shift: Boolean -HourlyPay: double +Employee() +setName(n: String) +setemployeeId(i:int) +setShift(s:Boolean) +setHourlyPay(p:double) +getname() : String +getemployeeId() : int +getShift() : Boolean +getHourlyPay() : double +calculateOvertimePay( hours :...
1. In Object Oriented Programming The private object fields can be directly manipulated by outside entities....
1. In Object Oriented Programming The private object fields can be directly manipulated by outside entities. Group of answer choices A. True B. False 2. __________ programming is centered on the procedures or actions that take place in a program. Group of answer choices A. Class B. Object-oriented C. Menu-driven D. Procedural/ Structural 3. __________ programming encapsulates data and functions in an object. Group of answer choices A. Object-oriented B. Class C. Menu-driven D. Procedural 4. The data in an...
Why is it more feasible to use Objects and object oriented programming as compared to using...
Why is it more feasible to use Objects and object oriented programming as compared to using method based programs? What are the disadvantages of using only methods in your programs.
This week, you will create and implement an object-oriented programming design for your project. You will...
This week, you will create and implement an object-oriented programming design for your project. You will learn to identify and describe the classes, their attributes and operations, as well as the relations between the classes. Create class diagrams using Visual Studio. Review the How to: Add class diagrams to projects (Links to an external site.) page from Microsoft’s website; it will tell you how to install it. Submit a screen shot from Visual Studio with your explanation into a Word...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will use the concept of object aggregation (i.e., has-a relationship between objects). You will implement a Java application, called MovieApplication that could be used in the movie industry. You are asked to implement three classes: Movie, Distributor, and MovieDriver. Each of these classes is described below. The Movie class represents a movie and has the following attributes: name (of type String), directorsName (of type String),...
Research and explain in your words what is known as Object Oriented Programming. Then, identify two...
Research and explain in your words what is known as Object Oriented Programming. Then, identify two advantages of OOP for application development. In peer replies, choose from one of the following and define the concept as part of your response. Abstraction. Encapsulation. Inheritance. Polymorphism.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT