[dsalaita0@gryffindor main.cpp: In function main.cpp:5:69: error: cannot call member function 'float creditCardType::getCreditLimit() const' without object 5 | std::cout << "Credit Limit: $" << credit CardType::getCreditLimit() << std::endl; credit Card Type]$ g++ -std=c++20 -Wall creditCardType.cpp main.cpp 'int main()': ~~~~~~~N main.cpp:6:60: error: cannot call member function 'float creditCard Type::getBalance() const' without object 6 | std::cout << "Balance: $" << credit Card Type::getBalance() << std::endl; ~~~~~ [dsalaita0@gryffindor credit Card Type]$ || INNNNNAN

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! My code isn't compiling and I was wondering if you could provide a solution on how to fix it

Thank you

[[dsalaita0@gryffindor
credit Card Type]$ g++ -std=c++20 -Wall credit CardType.cpp main.cpp
'int main()':
main.cpp: In function
main.cpp:5:69: error: cannot call member function 'float credit CardType::getCreditLimit() const' without object
5 | std::cout << "Credit Limit: $" << credit Card Type::getCreditLimit() << std::endl;
|
UNAN
main.cpp:6:60: error: cannot call member function 'float credit Card Type::getBalance() const' without object
6 | std::cout << "Balance: $" << credit Card Type::getBalance() << std::endl;
|
~~~~~~~~
[dsalaita0@gryffindor
credit Card Type]$
~~~~~~~~~~~
Transcribed Image Text:[[dsalaita0@gryffindor credit Card Type]$ g++ -std=c++20 -Wall credit CardType.cpp main.cpp 'int main()': main.cpp: In function main.cpp:5:69: error: cannot call member function 'float credit CardType::getCreditLimit() const' without object 5 | std::cout << "Credit Limit: $" << credit Card Type::getCreditLimit() << std::endl; | UNAN main.cpp:6:60: error: cannot call member function 'float credit Card Type::getBalance() const' without object 6 | std::cout << "Balance: $" << credit Card Type::getBalance() << std::endl; | ~~~~~~~~ [dsalaita0@gryffindor credit Card Type]$ ~~~~~~~~~~~
1 include "credit CardType.h"
2 #include <iostream>
3 using namespace std;
4 int main() {
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 }
32
std::cout << "Credit Limit: $" << credit CardType::getCreditLimit() << std::endl;
std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl;
std::cout << "Count: " << credit Card Type::getCount() << std::endl;
credit CardType card1("1234 5678 1234 5678", "Professor Rich Pockets", "12/22");
std::cout << "Count: " << creditCard Type::getCount() << std::endl;
credit Card Type card2("5678 1234 5678 1234", "Dr. Jane Moneybags", "06/23");
std::cout << "Count: " << creditCardType::getCount() << std::endl;
credit Card Type card3("2468 1357 2468 1357", "Mr. John Doe", "11/24");
std::cout << "Count: " << credit Card Type::getCount() << std::endl;
std::cout << std::endl;
card1.purchase (500.0);
card1.print();
std::cout << "Balance: $" << card1.getBalance() << std::endl;
card2.purchase (5000.0);
card2.print();
std::cout << "Balance: $" << card2.getBalance() << std::endl;
card3.purchase (20000.0);
card3.print();
std::cout << "Balance: $" << card3.getBalance() << std::endl;
return 0;
Transcribed Image Text:1 include "credit CardType.h" 2 #include <iostream> 3 using namespace std; 4 int main() { 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 } 32 std::cout << "Credit Limit: $" << credit CardType::getCreditLimit() << std::endl; std::cout << "Balance: $" << creditCard Type::getBalance() << std::endl; std::cout << "Count: " << credit Card Type::getCount() << std::endl; credit CardType card1("1234 5678 1234 5678", "Professor Rich Pockets", "12/22"); std::cout << "Count: " << creditCard Type::getCount() << std::endl; credit Card Type card2("5678 1234 5678 1234", "Dr. Jane Moneybags", "06/23"); std::cout << "Count: " << creditCardType::getCount() << std::endl; credit Card Type card3("2468 1357 2468 1357", "Mr. John Doe", "11/24"); std::cout << "Count: " << credit Card Type::getCount() << std::endl; std::cout << std::endl; card1.purchase (500.0); card1.print(); std::cout << "Balance: $" << card1.getBalance() << std::endl; card2.purchase (5000.0); card2.print(); std::cout << "Balance: $" << card2.getBalance() << std::endl; card3.purchase (20000.0); card3.print(); std::cout << "Balance: $" << card3.getBalance() << std::endl; return 0;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
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.
Similar questions
  • SEE MORE QUESTIONS
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