1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tcecarenko [31]
2 years ago
6

Define a class named Money that stores a monetary amount. The class should have two private integer variables, one to store the

number of dollars and another to store the number of cents. Add accessor and mutator functions to read and set both member variables. Add another function that returns the monetary amount as a double. Write a program that tests all of your functions with at least two different Money objects.
Computers and Technology
1 answer:
WINSTONCH [101]2 years ago
6 0

Answer:

#include<iostream>

using namespace std;

class Money{

    private:

        int dollars;  

       int cents;

   public:

       Money(int d=0, int c=0){

          setDollar(d);

          setCent(c);

       }

       void setDollar(int d){

           dollars = d;

       }

       void setCent(int c){

           cents = c

       }

       int getDollar() {

           return dollars;

       }

       int getCent() {

           return cents;

       }

       double getMoney(){

          return (dollars + (cents/100));

       }

};

// testing the program.

int main(){

  Money Acc1(3,50);

  cout << M.getMoney() << endl;

  Money Acc2;

  Acc2.setDollars(20);

  Acc2.setCents(30);

  cout <<"$" << Acc2.getDollars() << "." << Acc2.getCents() << endl;

  return 0;

}

Explanation:

The C++ source code defines the Money class and its methods, the class is used in the main function as a test to create the instances of the money class Acc1 and Acc2.

The object Acc2 is mutated and displayed with the "setDollar and setCent" and "getDollar and getCent" methods respectively.

You might be interested in
The first character of the VIN designates which of the following? 
Dennis_Churaev [7]

country or origin is usually the first character of a vin #

7 0
3 years ago
Read 2 more answers
Which might be included in both your speaking outline and your preparation outline? A. Detailed descriptions of each main point
expeople1 [14]

Answer:

D. Attention getters

Explanation:

Based on the answers provided within the question it can be said that in both a speaking outline and a preparation outline you should include attention getters. These are important to include in both because it needs to be practiced and perfected in order to catch the audiences attention and hook them on to what you are saying.

4 0
3 years ago
10 points + brainliest to first correect answer :) incorrect answers/ answers with no effort will be deleted this is easy im jus
Gala2k [10]

Answer:

The first option is incorrect

Explanation:

With the Control+C method, you copy the text. With the Control+V method, you paste it. You do not remove any of the text and instead create a duplicate

6 0
2 years ago
Valerie regularly generates sales reports from her organization's data warehouse. She uses these reports to create presentations
Luda [366]

Answer:

the answer is C

Explanation:

reporting tool because she has to report it before doing anything else.

5 0
3 years ago
An early attempt to force users to use less predictable passwords involved computer-supplied passwords. The passwords were eight
Sedaia [141]

Answer:

Recently, with the new and advanced hacking algorithms and affordable high-performance computers available to adversaries, the 36 character computer suggested passwords can easily be insecure.

Explanation:

The 8 length passwords generated pseudo-randomly by computers are not secure as there are new algorithms like the brute force algorithm that can dynamically obtain the passwords by looping through the password length and comparing all 36 characters to get the right one.

And also, the use of high-performance computers makes these algorithms effective

7 0
3 years ago
Other questions:
  • 2. What is the purpose of an outline? (1 point)
    8·1 answer
  • Your friends know that you understand a lot about computers, both the technical details of how they operate as well as informati
    12·1 answer
  • Which of the following statements is true of ASCII code?
    12·1 answer
  • The U.S. economy is a free enterprise system.<br><br> True<br> False<br><br> PLEASE DONT GUESS
    8·2 answers
  • True or False?
    8·1 answer
  • \What will the weather most likely be like the day after a warm front? (4 points) The temperature will be cool or cold, and ther
    7·2 answers
  • What connector has 4 pins, is used for older IDE drives and some SATA drives, and can provide +5 V and +12 V power outputs?
    11·1 answer
  • Which route of entry could chemicals use to enter through the body’s airways?
    8·1 answer
  • An image that has been saved in Tagged Image File Format (or .TIF) is A. readable only by Windows personal computers. B. a recto
    6·1 answer
  • Private sharing model on Opportunities. Leadership has asked the Administrator to create a new custom object that will track cus
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!