<< "Count: " << credit Card Type::getCount() dType card2("5678 1234 5678 1234", "Dr. Jane << "Count: " << credit Card Type::getCount() - dType card3("2468 1357 2468 1357", "Mr. John << "Count: " << credit CardType::getCount() << std::endl; chase (500.0);

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello! would you provide an explanation and a solution as to why my code isn't compiling

(pictures provided below)

credit Card Type]$ g++ -std=c++20 -Wall credit CardType.cpp main.cpp
'int main()':
[[dsalaita0@gryffindor
main.cpp: In function
main.cpp:5:69: error: cannot call member function 'float credit CardType::getCreditLimit() const' without objec
5 | std::cout << "Credit Limit: $" << credit Card Type::getCreditLimit() << std::endl;
|
NAN
main.cpp:6:60: error: cannot call member function 'float credit Card Type::getBalance () const' without object
std::cout << "Balance: $" << credit Card Type::getBalance() << std::endl;
6 |
I
main.cpp:20:60: error: cannot call member function 'float credit CardType::getBalance() const' without object
std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl;
201
|
main.cpp:24:60: error: cannot call member function 'float creditCardType::getBalance() const' without object
24 | std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl;
NNNI
28 |
IN~~~~~AN
~~~~~~~~
IN~~~~~AN
main.cpp:28:60: error: cannot call member function 'float credit CardType::getBalance() const' without object
std::cout << "Balance: $" << creditCardType::getBalance() << std::endl;
|
[dsalaita0@gryffindor credit CardType]$
~~~~~~
~~~~~~~~~
Transcribed Image Text:credit Card Type]$ g++ -std=c++20 -Wall credit CardType.cpp main.cpp 'int main()': [[dsalaita0@gryffindor main.cpp: In function main.cpp:5:69: error: cannot call member function 'float credit CardType::getCreditLimit() const' without objec 5 | std::cout << "Credit Limit: $" << credit Card Type::getCreditLimit() << std::endl; | NAN main.cpp:6:60: error: cannot call member function 'float credit Card Type::getBalance () const' without object std::cout << "Balance: $" << credit Card Type::getBalance() << std::endl; 6 | I main.cpp:20:60: error: cannot call member function 'float credit CardType::getBalance() const' without object std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl; 201 | main.cpp:24:60: error: cannot call member function 'float creditCardType::getBalance() const' without object 24 | std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl; NNNI 28 | IN~~~~~AN ~~~~~~~~ IN~~~~~AN main.cpp:28:60: error: cannot call member function 'float credit CardType::getBalance() const' without object std::cout << "Balance: $" << creditCardType::getBalance() << std::endl; | [dsalaita0@gryffindor credit CardType]$ ~~~~~~ ~~~~~~~~~
include "credit CardType.h"
#include <iostream>
using namespace std;
int main() {
}
std::cout << "Credit Limit: $" << credit Card Type::getCreditLimit() << std::endl;
std::cout << "Balance: $" << creditCardType::getBalance() << std::endl;
std::cout << "Count: " << credit Card Type::getCount() << std::endl;
credit Card Type card1("1234 5678 1234 5678", "Professor Rich Pockets", "12/22");
std::cout << "Count: " << creditCardType::getCount() << std::endl;
credit Card Type card2("5678 1234 5678 1234", "Dr. Jane Moneybags", "06/23");
std::cout << "Count: " << creditCard Type::getCount() << std::endl;
credit Card Type card3("2468 1357 2468 1357", "Mr. John Doe", "11/24");
std::cout << "Count: " << creditCardType::getCount() << std::endl;
std::cout << std::endl;
card1.purchase (500.0);
card1.print();
std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl;
card2.purchase (5000.0);
card2.print();
std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl;
card3.purchase (20000.0);
card3.print();
std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl;
return 0;
Transcribed Image Text:include "credit CardType.h" #include <iostream> using namespace std; int main() { } std::cout << "Credit Limit: $" << credit Card Type::getCreditLimit() << std::endl; std::cout << "Balance: $" << creditCardType::getBalance() << std::endl; std::cout << "Count: " << credit Card Type::getCount() << std::endl; credit Card Type card1("1234 5678 1234 5678", "Professor Rich Pockets", "12/22"); std::cout << "Count: " << creditCardType::getCount() << std::endl; credit Card Type card2("5678 1234 5678 1234", "Dr. Jane Moneybags", "06/23"); std::cout << "Count: " << creditCard Type::getCount() << std::endl; credit Card Type card3("2468 1357 2468 1357", "Mr. John Doe", "11/24"); std::cout << "Count: " << creditCardType::getCount() << std::endl; std::cout << std::endl; card1.purchase (500.0); card1.print(); std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl; card2.purchase (5000.0); card2.print(); std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl; card3.purchase (20000.0); card3.print(); std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl; return 0;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education