#include <iostream>
#include "customer.h"
//writer 5396952 Hyeonmin LEE , helped by sascha
using std::cin;
using std::cout;
using std::endl;
int main(int argc, char** argv) {
int num = 0; //to get decimal input, will calculate it in member funtion in integer
double bal = 0;
double chrg = 0;
double credit = 0;
double creditLimit = 0;
while (1){
Customer customer;
std::cout << "Enter customer number. (or -1 to end)" << std::endl;
std::cin >> num;
if(std::cin.fail()){
return 0; //while's condtion is 1, this return 0 ends while loop
}
if(num == -1){
return 0; //end main funtion
}
customer.setNum(num);
std::cout << "Enter beginning balance." << std::endl;
std::cin >> bal;
customer.setBal(bal);
std::cout << "Enter total charge." << endl;
std::cin >> chrg;
customer.setChrg(chrg);
std::cout << "Enter total credits." << endl;
std::cin >> credit;
customer.setCredit(credit);
std::cout << "Enter credit limit." << endl;
std::cin >> creditLimit;
customer.setCreditLimit(creditLimit);
customer.getNewBalance();
customer.getExceed();
std::cout <<"\n";
}
return 0;
}
//so stressed!
#include "customer.h"
//writer 5396952 Hyeonmin LEE , helped by sascha
using std::cin;
using std::cout;
using std::endl;
int main(int argc, char** argv) {
int num = 0; //to get decimal input, will calculate it in member funtion in integer
double bal = 0;
double chrg = 0;
double credit = 0;
double creditLimit = 0;
while (1){
Customer customer;
std::cout << "Enter customer number. (or -1 to end)" << std::endl;
std::cin >> num;
if(std::cin.fail()){
return 0; //while's condtion is 1, this return 0 ends while loop
}
if(num == -1){
return 0; //end main funtion
}
customer.setNum(num);
std::cout << "Enter beginning balance." << std::endl;
std::cin >> bal;
customer.setBal(bal);
std::cout << "Enter total charge." << endl;
std::cin >> chrg;
customer.setChrg(chrg);
std::cout << "Enter total credits." << endl;
std::cin >> credit;
customer.setCredit(credit);
std::cout << "Enter credit limit." << endl;
std::cin >> creditLimit;
customer.setCreditLimit(creditLimit);
customer.getNewBalance();
customer.getExceed();
std::cout <<"\n";
}
return 0;
}
//so stressed!
댓글
댓글 쓰기