Static field holds rent due date for an office

Assignment Help C/C++ Programming
Reference no: EM13166192

Please debug this 

 

// Fixed Debug 7-4
// static field holds rent due date for an office -
// rents are due on the 1st
#include<iostream>
#include<string>
using namespace std;
class Office
{
   private:
     int officeNum;
     string tenant;
     int rent;
     int rentDueDate;
   public:
     void setOfficeData(int, string, int);
     static void showRentDueDate();
     void showOffice();
};
int Office::rentDueDate = 1;

void Office::setOfficeData(int num, string occupant, int rent)
{
   officeNum = this->num;
   occupant = occupant;
   this->rent = this->rent;
}
void Office::showOffice()
{
cout << "Office " << officeNum << " is occupied by " <<
     tenant << endl;
cout << "   The rent $" << rent << " is due on day " <<
     rentDueDate << " of the month" << endl;
cout << "   because ALL rents are due on day " << rentDueDate <<
     " of the month" << endl;
}
void Office::showRentDueDate()
{
   cout << "All rents are due on day " << rentDueDate << " of the month" << endl;
}
int main()
{
   Office::showRentDueDate();
   Office myOffice;
   myOffice.setOfficeData(234, "Dr. Albright", 450);
   myOffice.showOffice();
   return 0;
}

 

 

Reference no: EM13166192

Questions Cloud

Convert 6bd3h into its binary and decimal equivalent : Convert 6BD3H into its Binary and Decimal equivalent
State water across the double bond of methylbutan : Explain how you would carry out these two reactions and why you obtain the products you indicate
Day trader wants to invest a sum of money : Day Trader wants to invest a sum of money that would generate an annually yield of at least $10,000. Two stock groups are available: blue chips and high tech, with average an annual yields of 10% and 25%, respectively
Grand inquisitor from his novel : How is Fyodor Dostoevsky’s tale of the “Grand Inquisitor,” from his novel  The Brothers Karamazov, best described?
Static field holds rent due date for an office : // static field holds rent due date for an office - // rents are due on the 1st
Allow the user to input the first and last base values : Write a C# program that produces a multiplication table. Allow the user to input the first and last base values for the multiplication table. Display a column in the table beginning with the first base inputted value
Static field holds total winnings for all horses in stable : static field holds total winnings for all horses in the stable // total winnings are shown after each horse wins,
Give the products you would expect and the mechanism : Give the products you would expect and the mechanism involved for the reaction of 1-bromopropane with:a. Water
Attempt to catch a fleeting impression of light and color : Which of these characteristics best describes Georges Seurat’s Sunday  Afternoon on the Island of La Grande Jatte?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program that compares the number of possible sequences

Write a c++ program that compares the number of possible sequences of the length L that can be generated. The program must output a formatted list comparing the number of possible sequences for L=5,6,7,8,9. given size N=9

  Writing a program that creates a linked list

Writing a program that creates a linked list from 100 randomly generated numbers and sorts the using a heap. One heap in ascending order and one heap in descending order. Then displays the original linked list and both sorted lists.

  Create if-then statement with single alternative decision

Create the If-Then statement (or a flowchart with a single alternative decision structure) which assigns 20 to  variable y and allots 40 to variable z if variable x is greater that 100.

  Model-view-controller

Explain Model-View-Controller paradigm

  Compares the number of possible sequences

A c++ program that compares the number of possible sequences of the length L that can be generated uinder the following assumptions. Given an alphabet of size N=9. The program must output a formatted list comparing the number of possible sequences..

  Implement the guess the word

Implement  the ‘Guess the Word' game in an object-oriented manner

  Write function to find whether number is perfect number

Write down the function perfect which determines whether number is perfect number or not. This function must receive number and return true if number is perfect.

  Main program should instantiate an instance

The main program should instantiate an instance of the class Rectangle and then make calls to the member functions to input the data and output the results

  Make a class employee

Make a class EMPLOYEE with a name and salary. Make a class MANAGER inherit from EMPLOYEE. Add an instance field, named DEPARTMENT

  Algorithm to determine which items to take to max weight

Write an algorithm to determine which items to take to maximize the weight of his loot bag. He cannot take a fraction of an item and each item must be taken, or left behind. Loot bag size is Z and and the input is an array of item wieghts as integers..

  Array of integers declared-initialized to number of tickets

Array of integers named parkingTickets has been declared and initialized to number of parking tickets given out by city police each day as beginning of current year.

  Write a program that will input letters grade(a,b,c,d,f)

Write a program that will input letters grade(A,B,C,D,F), the number of which is input by the user (a maximum of 50 grades). The grades will be read into array. A function will be called five times(once for each letter grade) and will return the tota..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd