Question

In: Computer Science

This is a discussion question for my csc 252 computer programming c++ visual studio so post...

This is a discussion question for my csc 252 computer programming c++ visual studio so post in c++ visual studio so that i can copy and paste thank you.

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

Code -

#include <iostream>

using namespace std;


class Employee{
//three data field /variable
public:
int id;
string name;
double salary;
//constructor
Employee(){
id = 1;
name = "xxx";
salary = 30000;
}
//parameterized constructor
Employee(int empid ,string empname,double empsalary){
id = empid;
name = empname;
salary = empsalary;
}
//three method to display Employee detials , Annual salary, and incremenSalary
void display(){
cout<<"Employee ID "<<id<<" Name "<<name<<" monthy salary "<<salary<<endl;
}
void salaryAnnually(){
cout<<"Annual salary "<<salary*12<<endl;
}
void incremenSalary(int percentageIncrement){
salary = (percentageIncrement *salary/100)+salary;
cout<<"New salary "<<salary<<endl;
}
};

int main()
{
Employee e1 ;
e1.id = 40;
e1.name = "John Nuke";
e1.salary = 45000;
e1.display();
e1.salaryAnnually();
e1.incremenSalary(5);
Employee e2;
e2.display();
e1.incremenSalary(6);
Employee e3(25,"Bryan",50000);
e3.display();
return 0;
}

Screenshots -


Related Solutions

Programming Language: C# CheckingAccount class You will implement the CheckingAccount Class in Visual Studio. This is...
Programming Language: C# CheckingAccount class You will implement the CheckingAccount Class in Visual Studio. This is a sub class is derived from the Account class and implements the ITransaction interface. There are two class variables i.e. variables that are shared but all the objects of this class. A short description of the class members is given below: CheckingAccount Class Fields $- COST_PER_TRANSACTION = 0.05 : double $- INTEREST_RATE = 0.005 : double - hasOverdraft: bool Methods + «Constructor» CheckingAccount(balance =...
ONLY USE VISUAL STUDIO (NO JAVA CODING) VISUAL STUDIO -> C# -> CONSOLE APPLICATION In this...
ONLY USE VISUAL STUDIO (NO JAVA CODING) VISUAL STUDIO -> C# -> CONSOLE APPLICATION In this part of the assignment, you are required to create a C# Console Application project. The project name should be A3<FirstName><LastName>P2. For example, a student with first name John and Last name Smith would name the project A1JohnSmithP2. Write a C# (console) program to calculate the number of shipping labels that can be printed on a sheet of paper. This program will use a menu...
Objectives: 1. To get familiar with C# programming language 2. To get familiar with Visual Studio...
Objectives: 1. To get familiar with C# programming language 2. To get familiar with Visual Studio development environment 3. To practice on writing a C# program Task 1: Create documentation for the following program which includes the following: a. Software Requirement Specification (SRS) b. Use Case Task 2: Write a syntactically and semantically correct C# program that models telephones. Your program has to be a C# Console Application. You will not implement classes in this program other than the class...
I need a answer to my professors question about my discussion post My Post 1) What...
I need a answer to my professors question about my discussion post My Post 1) What types are protected? Under the National Labor Relation Act, an employee's right to strike is a considered as a critical component of the right to organize. But to ensure balance this right is not without limitations. As per Section 7 of NLRA only Certain strikes qualify as protected activity. These recognized strikes are: ·         Unfair labor practice strikes, which protest employers illegal activities. ·        ...
Create a question bank. The language is visual studio c++. Description: Question bank computerizes the MCQ...
Create a question bank. The language is visual studio c++. Description: Question bank computerizes the MCQ based exams.It takes input from a file having questions and their answers and presents randomly before the exam takers. Required skill set: OOP, STL(Vector), Arrays and file handling
my question is in python. My question is how to add post users to post gres...
my question is in python. My question is how to add post users to post gres in python
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your solutions for each problem solved in a Word or Google document which includes (a) the pseudocode, (b) the C# codes and (c) the execution result (screen capture just the answer part using Snipping Tool, avoiding non-related or blank spaces). Notice for readability, that the (a) & (b) are in text mode and the (c) is in image mode. Use proper titles and wording in...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your solutions for each problem solved in a Word or Google document which includes (a) the pseudocode, (b) the C# codes and (c) the execution result (screen capture just the answer part using Snipping Tool, avoiding non-related or blank spaces). Notice for readability, that the (a) & (b) are in text mode and the (c) is in image mode. Use proper titles and wording in...
In visual Studio C++ Create a program that uses a for loop to input the high...
In visual Studio C++ Create a program that uses a for loop to input the high temperature, and low temperature for each day of the week. The high and low will be placed into two elements of the array. For each loop the high and low will be placed into the next set of elements of the array. After the temps for all seven days have been entered into the array, a for loop will be used to pull out...
answer the following using C# Design and program a Visual Studio Console project in C# that...
answer the following using C# Design and program a Visual Studio Console project in C# that allows your user to enter a number. The program will examine the number to see if it is prime. If it is prime, it will print the next higher prime and the next lower primes to the console. If the number entered by the user is not prime, display a message to that effect. All code should be written by you. Do not copy/paste...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT