Question

In: Computer Science

C++ Bank Account Error Fix, full code. I am using Dev-C++ to Compile and Execute. The...

C++ Bank Account Error Fix, full code. I am using Dev-C++ to Compile and Execute.

The project is below, I have supplied the code and I'm getting an error in SavingsAccount.h file.

17   5   C:\Users\adam.brunell\Documents\Classes\C++\Week4\SavingsAccount.h   [Error] 'SavingsAccount::SavingsAccount(std::string, double, double)' is protected

A.Assume

i.SavingsAccount: Assume an Interest Rate of 0.03

ii.HighInterestSavings: Assume an Interest Rate of 0.05, Minimum Balance = $2500

iii.NoServiceChargeChecking: Assume an Interest Rate = 0.02, Minimum of Balance = $1000

iv.ServiceChargeChecking – Assume account service charge = $10, Maximum number of checks = 5, Service Charge if customer exceeds the maximum number of checks = $5.

v.NoServicechargeChecking: Assume an interest rate = 0.02, Minimum Balance = $1000

vi.HighInterestChecking: Assume an interest rate = 0.05, Minimum Balance = $5000

vii.CertificateOfDepsit: Assume an interest rate = 0.05, Initial Number of Maturity Months = 6

    

B.Capitalize the first letter of the derived class names.

C.Use the following driver to validate your program:

#include

#include

#include

#include "bankAccount.h"

#include "SavingsAccount.h"

#include "HighInterestSavings.h"

#include "NoServiceChargeChecking.h"

#include "ServiceChargeChecking.h"

#include "HighInterestChecking.h"

#include "CertificateOfDeposit.h"

#include "checkingAccount.h"

using namespace std;

int main()

{

    vector accountsList;

       //SavingsAccount( Name, Account number, Balance ) - Assume an interest rate = 0.03

    accountsList.push_back(new SavingsAccount("Bill", 10200, 2500));

       //HighInterestSavings(Name, Account Number, Balance) -- Assume an interest rate = 0.05, Minimum balance = $2500

    accountsList.push_back(new HighInterestSavings("Susan", 10210, 2000));

       //NoServiceChargeChecking(Name, Account Number, Balance) -- Assume an interest rate = 0.02, Minimum balance = $1000

    accountsList.push_back(new NoServiceChargeChecking("John", 20100,

                                                    3500));

       //ServiceChargeChecking(Name, Account Number, Balance) -- Assume account service charge = $10, Maximum number of checks = 5, Service Charee Excess Number of Checks = $5

    accountsList.push_back(new ServiceChargeChecking("Ravi", 30100, 1800));

       //HighIntererestChecking(Name, Account Number, Balance) - Assume an inerest rate = 0.05, Minimum balance = $5000

    accountsList.push_back(new HighInterestChecking("Sheila", 20200, 6000));

       //Certificate(name, Account Number, Balance, Interest Rate, Number of Months) - Assume an initial interest rate = 0.05, Initial Number of Maturity Months = 6

    accountsList.push_back(new CertificateOfDeposit("Hamid", 51001, 18000,

                                                0.075, 18));

    cout << "January:\n-------------" << endl;

    for (int i = 0; i < accountsList.size(); i++)

    {

        accountsList[i]->createMonthlyStatement();

        accountsList[i]->print();

        cout << endl;

    }

    cout << "\nFebruary:\n-------------" << endl;

    for (int i = 0; i < accountsList.size(); i++)

    {

        accountsList[i]->createMonthlyStatement();

        accountsList[i]->print();

        cout << endl;

    }

    for (int i = 0; i < accountsList.size(); i++)

    {

         accountsList[i]->withdraw(500);

    }

    cout << "\nMarch:\n-------------" << endl;

    for (int i = 0; i < accountsList.size(); i++)

    {

        accountsList[i]->createMonthlyStatement();

        accountsList[i]->print();

        cout << endl;

    }

    System(“pause”);

    return 0;

}

The Expected Output is:

January:

-------------

Savings account: Bill    ACCT# 10200    Balance: $2575.00

High Interest Savings: Susan     ACCT# 10210    Balance: $2100.00

No Service Charge Check. John    ACCT# 20100    Balance: $3500.00

Service Charge Checking: Ravi    ACCT# 30100    Balance: $1790.00

Higher Interest Checking: Sheila         ACCT# 20200    Balance: $6300.00

Certificate of Deposit: Hamid    ACCT# 51001    Balance: $19350.00

February:

-------------

Savings account: Bill    ACCT# 10200    Balance: $2652.25

High Interest Savings: Susan     ACCT# 10210    Balance: $2205.00

No Service Charge Check. John    ACCT# 20100    Balance: $3500.00

Service Charge Checking: Ravi    ACCT# 30100    Balance: $1780.00

Higher Interest Checking: Sheila         ACCT# 20200    Balance: $6615.00

Certificate of Deposit: Hamid    ACCT# 51001    Balance: $20801.25

March:

-------------

Savings account: Bill    ACCT# 10200    Balance: $2216.82

High Interest Savings: Susan     ACCT# 10210    Balance: $2315.25

No Service Charge Check. John    ACCT# 20100    Balance: $3000.00

Service Charge Checking: Ravi    ACCT# 30100    Balance: $1270.00

Higher Interest Checking: Sheila         ACCT# 20200    Balance: $6420.75

Certificate of Deposit: Hamid    ACCT# 51001    Balance: $22361.34

Press any key to continue . . .

//testdriver.cpp

#include
#include
#include

#include "bankAccount.h"
#include "SavingsAccount.h"
#include "HighInterestSavings.h"
#include "NoServiceChargeChecking.h"
#include "ServiceChargeChecking.h"
#include "HighInterestChecking.h"
#include "CertificateOfDeposit.h"
#include "checkingAccount.h"

using namespace std;
  
int main()
{
vector accountsList;

   //SavingsAccount( Name, Account number, Balance ) - Assume an interest rate = 0.03
accountsList.push_back(new SavingsAccount("Bill", 10200, 2500));

   //HighInterestSavings(Name, Account Number, Balance) -- Assume an interest rate = 0.05, Minimum balance = $2500
accountsList.push_back(new HighInterestSavings("Susan", 10210, 2000));

   //NoServiceChargeChecking(Name, Account Number, Balance) -- Assume an interest rate = 0.02, Minimum balance = $1000
accountsList.push_back(new NoServiceChargeChecking("John", 20100,
3500));

   //ServiceChargeChecking(Name, Account Number, Balance) -- Assume account service charge = $10, Maximum number of checks = 5, Service Charee Excess Number of Checks = $5
accountsList.push_back(new ServiceChargeChecking("Ravi", 30100, 1800));

   //HighIntererestChecking(Name, Account Number, Balance) - Assume an inerest rate = 0.05, Minimum balance = $5000
accountsList.push_back(new HighInterestChecking("Sheila", 20200, 6000));

   //Certificate(name, Account Number, Balance, Interest Rate, Number of Months) - Assume an initial interest rate = 0.05, Initial Number of Maturity Months = 6
accountsList.push_back(new CertificateOfDeposit("Hamid", 51001, 18000,
0.075, 18));

cout << "January:\n-------------" << endl;
for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->createMonthlyStatement();
accountsList[i]->print();
cout << endl;
}

cout << "\nFebruary:\n-------------" << endl;
for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->createMonthlyStatement();
accountsList[i]->print();
cout << endl;
}

for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->withdraw(500);
}

cout << "\nMarch:\n-------------" << endl;
for (int i = 0; i < accountsList.size(); i++)
{
accountsList[i]->createMonthlyStatement();
accountsList[i]->print();
cout << endl;
}
System("pause");
return 0;
}

bankAccount.h

#ifndef BANKACCOUNT_H
#define BANKACCOUNT_H

#include

using namespace std;

class bankAccount {
public:
bankAccount(string name, double initialBalance);
string getName();
unsigned int getAccountNumber();
double getBalance();
double getInterestRate();
string getStatementString();
void deposit(double amount);
void deposit(double amount, string statement);
void withdraw(double amount);
void withdraw(double amount, string statement);
virtual void printStatement() = 0;
protected:
void addStatementLine(string statement, double amount);
private:
string name;
unsigned int accountNumber;
double balance;
static unsigned int nextAccountNumber;
string statementString;
};

#endif /* BANKACCOUNT_H */

//bankAccount.cpp

#include "bankAccount.h"
#include
#include
#include

using namespace std;

unsigned int BankAccount::nextAccountNumber = 1;


BankAccount::BankAccount(string name, double initialBalance)
{
stringstream output;

this->name = name;
balance = initialBalance;
accountNumber = nextAccountNumber++;
output << setw(60) << left << "Transaction" << setw(10) << "Amount" << " " << "Balance" << endl;
statementString = output.str();
addStatementLine("Initial Deposit", initialBalance);
}

string BankAccount::getName()
{
return name;
}

unsigned int BankAccount::getAccountNumber()
{
return accountNumber;
}

double BankAccount::getBalance()
{
return balance;
}

void BankAccount::addStatementLine(string statement, double amount)
{
stringstream output;
  
output << setw(60) << left << statement << setw(10) << amount << " " << getBalance() << endl;
//.append(statement);
statementString.append(output.str());
}

void BankAccount::deposit(double amount)
{
deposit(amount, "Deposit");
}

void BankAccount::deposit(double amount, string statement)
{
balance += amount;
addStatementLine(statement, amount);
}

void BankAccount::withdraw(double amount)
{
withdraw(amount, "Withdrawal");
}

void BankAccount::withdraw(double amount, string statement)
{
if (balance >= amount)
{
balance -= amount;
addStatementLine(statement, amount);
}
else
{
addStatementLine(statement.append(" Overdraft"), amount);
}
}

string BankAccount::getStatementString()
{
return statementString;
}

//CertificateOfDeposit.h

#ifndef CERTIFICATEOFDEPOSIT_H
#define CERTIFICATEOFDEPOSIT_H

#include "bankAccount.h"
#include

using namespace std;

class CertificateOfDeposit : public bankAccount{
public:
CertificateOfDeposit(string name, double initialBalance, int maturityMonths);
CertificateOfDeposit(string name, double initialBalance);
int getMaturityMonths();
double getInterestRate();
int getCurrentCDMonth();
int getWithdrawalPenaltyMonths();
void withdraw();
void incrementMonth();
void printStatement();
private:
int maturityMonths;
double interestRate;
int currentCDMonth;
int withdrawalPenaltyMonths;
void withdraw(double amount);
void withdraw(double amount, string statement);
void deposit(double amount);
};

#endif /* CERTIFICATEOFDEPOSIT_H */

//CertificateOfDeposit.cpp

#include "CertificateOfDeposit.h"

CertificateOfDeposit::CertificateOfDeposit(string name, double initialBalance, int maturityMonths) : bankAccount(name, initialBalance)
{
this->maturityMonths = maturityMonths;
interestRate = 0.05;
currentCDMonth = 0;
withdrawalPenaltyMonths = 3;
}

CertificateOfDeposit::CertificateOfDeposit(string name, double initialBalance) : bankAccount(name, initialBalance)
{
maturityMonths = 6;
interestRate = 0.05;
currentCDMonth = 0;
withdrawalPenaltyMonths = 3;
}

int CertificateOfDeposit::getCurrentCDMonth()
{
return currentCDMonth;
}

double CertificateOfDeposit::getInterestRate()
{
return interestRate;
}

int CertificateOfDeposit::getWithdrawalPenaltyMonths()
{
return withdrawalPenaltyMonths;
}

int CertificateOfDeposit::getMaturityMonths()
{
return maturityMonths;
}

void CertificateOfDeposit::withdraw()
{
if (getCurrentCDMonth() < getMaturityMonths())
bankAccount::withdraw(getBalance()*getInterestRate()*getWithdrawalPenaltyMonths(), "Early Withdrawal Penalty");
bankAccount::withdraw(getBalance(), "Close Account");
}

void CertificateOfDeposit::incrementMonth()
{
bankAccount::deposit(getBalance()*getInterestRate(), "Monthly Interest");
if (getCurrentCDMonth() < getMaturityMonths())
{
currentCDMonth++;
}
else
withdraw();
}

void CertificateOfDeposit::printStatement()
{
cout << "Certificate of Deposit Statement" << endl;
cout << "Name: " << getName() << endl;
cout << "Account Number: " << getAccountNumber() << endl;
cout << "Interest Rate: " << getInterestRate() * 100 << "%" << endl;
cout << "Maturity Month: " << getMaturityMonths() << ", Current Month: " << getCurrentCDMonth() << endl;
cout << "Early Withdrawal Penalty: " << getWithdrawalPenaltyMonths() << " (months)" << endl << endl;
cout << getStatementString() << endl;
cout << "Final Balance: " << getBalance() << endl << endl;
}

//HighInterestChecking.h

#ifndef HIGHINTERESTCHECKING_H
#define HIGHINTERESTCHECKING_H

#include "NoServiceChargeChecking.h"

#include

using namespace std;

class HighInterestChecking : public NoServiceChargeChecking {
public:
HighInterestChecking(string name, double initialBalance);
void printStatement();
private:
};

#endif /* HIGHINTERESTCHECKING_H */

//HighInterestChecking.cpp

#include "HighInterestChecking.h"

HighInterestChecking::HighInterestChecking(string name, double initialBalance) : NoServiceChargeChecking(name, initialBalance, 5000, 0.05)
{

}

void HighInterestChecking::printStatement()
{
bankAccount::deposit(getBalance() * getInterestRate(), "Interest");
cout << "High Interest Checking Statement" << endl;
cout << "Name: " << getName() << endl;
cout << "Account Number: " << getAccountNumber() << endl;
cout << "Interest Rate: " << getInterestRate() * 100 << "%" << endl;
cout << "Minimum Balance: " << getMinimumBalance() << endl << endl;
cout << getStatementString() << endl;
cout << "Final Balance: " << getBalance() << endl << endl;
}

//HighInterestSavings.h

#ifndef HIGHINTERESTSAVINGS_H
#define HIGHINTERESTSAVINGS_H

#include "SavingsAccount.h"
#include

using namespace std;

class HighInterestSavings : public SavingsAccount{
public:
HighInterestSavings(string name, double initialBalance);
int getMinimumBalance();
void printStatement();
void withdraw(double amount, string statement);
void withdraw(double amount);
private:
int minimumBalance;
};

#endif /* HIGHINTERESTSAVINGS_H */

//HighInterestSavings.cpp

#include "HighInterestSavings.h"


HighInterestSavings::HighInterestSavings(string name, double initialBalance) : SavingsAccount(name, initialBalance, 0.05)
{
minimumBalance = 2500;
}

int HighInterestSavings::getMinimumBalance()
{
return minimumBalance;
}

void HighInterestSavings::withdraw(double amount, string statement)
{
if (amount + getMinimumBalance() <= getBalance())
{
bankAccount::withdraw(amount, statement);
}
else
{
addStatementLine(statement.append(" Overdraft. Below Minimum Balance."), amount);
}
}

void HighInterestSavings::withdraw(double amount)
{
withdraw(amount, "Withdrawal");
}

void HighInterestSavings::printStatement()
{
bankAccount::deposit(getBalance() * getInterestRate(), "Interest");
cout << "High Interest Savings Account Statement" << endl;
cout << "Name: " << getName() << endl;
cout << "Account Number: " << getAccountNumber() << endl;
cout << "Minimum Balance: " << getMinimumBalance() << endl;
cout << "Interest Rate: " << getInterestRate() * 100 << "%" << endl << endl;
cout << getStatementString() << endl;
cout << "Final Balance: " << getBalance() << endl << endl;
}

//NoServiceChargeChecking.h

#ifndef NOSERVICECHARGECHECKING_H
#define NOSERVICECHARGECHECKING_H

#include "checkingAccount.h"

#include

using namespace std;

class NoServiceChargeChecking : public CheckingAccount {
public:
NoServiceChargeChecking(string name, double initialBalance);
void writeCheck(double amount, int checkNumber);
void printStatement();
void withdraw(double amount, string statement);
void withdraw(double amount);
double getInterestRate();
int getMinimumBalance();
protected:
NoServiceChargeChecking(string name, double initialBalance, int minBalance, double interestRate);
private:
double interestRate;
int minimumBalance;
};

#endif /* NOSERVICECHARGECHECKING_H */

//NoServiceChargeChecking.cpp

#include "NoServiceChargeChecking.h"
#include
#include

NoServiceChargeChecking::NoServiceChargeChecking(string name, double initialBalance) : checkingAccount(name, initialBalance)
{
minimumBalance = 1000;
this->interestRate = 0.02;
}

NoServiceChargeChecking::NoServiceChargeChecking(string name, double initialBalance, int minBalance, double interestRate) : checkingAccount(name, initialBalance)
{
minimumBalance = minBalance;
this->interestRate = interestRate;
}

void NoServiceChargeChecking::writeCheck(double amount, int checkNumber)
{
stringstream output;
output << "Check #" << checkNumber;
withdraw(amount, output.str());
}

void NoServiceChargeChecking::withdraw(double amount, string statement)
{
if (amount + getMinimumBalance() <= getBalance())
{
bankAccount::withdraw(amount, statement);
}
else
{
addStatementLine(statement.append(" Overdraft. Below Minimum Balance."), amount);
}
}

void NoServiceChargeChecking::withdraw(double amount)
{
withdraw(amount, "Withdrawal");
}

void NoServiceChargeChecking::printStatement()
{
bankAccount::deposit(getBalance() * getInterestRate(), "Interest");
cout << "No Service Charge Checking Statement" << endl;
cout << "Name: " << getName() << endl;
cout << "Account Number: " << getAccountNumber() << endl;
cout << "Interest Rate: " << getInterestRate() * 100 << "%" << endl;
cout << "Minimum Balance: " << getMinimumBalance() << endl << endl;
cout << getStatementString() << endl;
cout << "Final Balance: " << getBalance() << endl << endl;
}

int NoServiceChargeChecking::getMinimumBalance()
{
return minimumBalance;
}

double NoServiceChargeChecking::getInterestRate()
{
return interestRate;
}

//checkingAccount.h

#ifndef CHECKINGACCOUNT_H
#define CHECKINGACCOUNT_H

#include "bankAccount.h"

class CheckingAccount : public bankAccount {
public:
CheckingAccount(string name, double initialBalance);
virtual void writeCheck(double amount, int checkNumber) = 0;
private:

};

#endif /* CHECKINGACCOUNT_H */

//checkingAccount.cpp

#include "checkingAccount.h"

CheckingAccount::CheckingAccount(string name, double initialBalance) : bankAccount(name, initialBalance)
{

}

//SavingsAccount.h

#ifndef SAVINGSACCOUNT_H
#define SAVINGSACCOUNT_H

#include "bankAccount.h"
#include
#include

using namespace std;

class SavingsAccount : public bankAccount
{
public:
SavingsAccount(string name, double initialBalance);
double getInterestRate();
void printStatement();
protected:
SavingsAccount(string name, double initialBalance, double interestRate);
private:
double interestRate;
};

#endif /* SAVINGSACCOUNT_H */

//SavingsAccount.cpp

#include "SavingsAccount.h"

SavingsAccount::SavingsAccount(string name, double initialBalance) : bankAccount(name, initialBalance)
{
interestRate = 0.03;
}

SavingsAccount::SavingsAccount(string name, double initialBalance, double interestRate) : bankAccount(name, initialBalance)
{
this->interestRate = interestRate;
}

double SavingsAccount::getInterestRate()
{
return interestRate;
}

void SavingsAccount::printStatement()
{
bankAccount::deposit(getBalance() * getInterestRate(), "Interest");
cout << "Savings Account Statement" << endl;
cout << "Name: " << getName() << endl;
cout << "Account Number: " << getAccountNumber() << endl;
cout << "Interest Rate: " << getInterestRate() * 100 << "%" << endl << endl;
cout << getStatementString() << endl;
cout << "Final Balance: " << getBalance() << endl << endl;
}

//ServiceChargeChecking.h

#ifndef SERVICECHARGECHECKING_H
#define SERVICECHARGECHECKING_H

#include "checkingAccount.h"
#include

using namespace std;

class ServiceChargeChecking : public CheckingAccount {
public:
ServiceChargeChecking(string name, double initialBalance);
void writeCheck(double amount, int checkNumber);
void printStatement();
private:
int checksWritten;
static const int CHECK_LIMIT = 5;
static const int SERVICE_CHARGE = 10;
};

#endif /* SERVICECHARGECHECKING_H */

//ServiceChargeChecking.cpp

#include "ServiceChargeChecking.h"
#include
#include

using namespace std;

ServiceChargeChecking::ServiceChargeChecking(string name, double initialBalance) : CheckingAccount(name, initialBalance)
{
bankAccount::withdraw(SERVICE_CHARGE, "Service Charge");
checksWritten = 0;
}

void ServiceChargeChecking::writeCheck(double amount, int checkNumber)
{
stringstream output;
if (++checksWritten <= CHECK_LIMIT)
{
output << "Check #" << checkNumber;
bankAccount::withdraw(amount, output.str());

}
else
{
output << "Maximum Limit of Checks Reached. Check # " << checkNumber << " bounced";
addStatementLine(output.str(), amount);
}
}

void ServiceChargeChecking::printStatement()
{
cout << "Service Charge Checking Statement" << endl;
cout << "Name: " << getName() << endl;
cout << "Account Number: " << getAccountNumber() << endl << endl;
cout << getStatementString() << endl;
cout << "Final Balance: " << getBalance() << endl << endl;
}

Receiving Error in SavingsAccount.h

17   5   C:\Users\adam.brunell\Documents\Classes\C++\Week4\SavingsAccount.h   [Error] 'SavingsAccount::SavingsAccount(std::string, double, double)' is protected

Solutions

Expert Solution

Ok so here we go..

I have gone through every file given in this code. That's a pretty big and a good modular code.

Let me solve your query. You wrote that you are getting error

'SavingsAccount::SavingsAccount(std::string, double, double)' is protected

Here, in testDeriver.cpp , you have created a SavingsAccount object as

new SavingsAccount("Bill", 10200, 2500). That means it will call the parametrized constructor of it.

Let's look at SavingsAccount.h. Here, this constructor is declared as protected. Protected constructor is used when we want the derived class and not the original base class to instanciate the object. So, if there was a class that derives SavingsAccount, it can call this constructor but the class SavingsAccount itself can not because of it is protected constructor.

So, to solve this error, you can simply just remove "protected:" word from SavingsAccount.h and the error will be gone. Becaus, when you remove this protected access specifier, "public" is written before that. So, this constructor will be treated as public and can be called then.

So, just by removing "protected" you can achieve the solution.

Do comment if there is any query. Thank you. :)


Related Solutions

Using dev c++ I'm having trouble with classes. I think the part that I am not...
Using dev c++ I'm having trouble with classes. I think the part that I am not understanding is sending data between files and also using bool data. I've been working on this program for a long time with many errors but now I've thrown in my hat to ask for outside help. Here is the homework that has given me so many issues: The [REDACTED] Phone Store needs a program to compute phone charges for some phones sold in the...
Hello I have this error in the code, I do not know how to fix it....
Hello I have this error in the code, I do not know how to fix it. It is written in C++ using a Eclipse IDE Error: libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: basic_string bus.h =========== #pragma once #include using namespace std; class Bus { private:    string BusId; // bus ID    string Manufacturer; // manufacturer of the bus    int BusCapacity; // bus capacity    int Mileage; // mileage of bus    char Status; // current status...
My code does not compile, I am using vim on terminal and got several compiling errors...
My code does not compile, I am using vim on terminal and got several compiling errors this is C++ language I need help fixing my code below is the example expected run and my code. Example run (User inputs are highlighted): Enter your monthly salary: 5000 Enter number of months you worked in the past year: 10 Enter the cost of the car: 36000 Enter number of cars you’ve sold in the past year: 30 Enter number of misconducts observed...
Find and fix the compile time bugs in the code at the end of this section....
Find and fix the compile time bugs in the code at the end of this section. Compile time bugs show as errors when you compile, but the Visual Studio IDE also gives you visual clues in the form of red squiggly underlines, as shown here. This assignment is meant to test your attention to detail and strengthen your debugging skills. Here is the code. // Week 4 Assignment-1 // Description: Compile time errors //---------------------------------- //**begin #include files************ #include <iostream> //...
I am getting an error at linen 57 and can't figure out how to fix it....
I am getting an error at linen 57 and can't figure out how to fix it. // Java program to read a CSV file and display the min, max, and average of numbers in it. import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Scanner; public class Main {     // method to determine and return the minimum number from the array     public static int minimum(int numbers[])     {         int minIdx = 0;         for(int i=1;i<numbers.length;i++)         {             if((minIdx...
I'm getting an error message with this code and I don't know how to fix it...
I'm getting an error message with this code and I don't know how to fix it The ones highlighted give me error message both having to deal Scanner input string being converted to an int. I tried changing the input variable to inputText because the user will input a number and not a character or any words. So what can I do to deal with this import java.util.Scanner; public class Project4 { /** * @param args the command line arguments...
I am creating SAS code, but am receiving an errors " ERROR: Value is out of...
I am creating SAS code, but am receiving an errors " ERROR: Value is out of range or inappropriate. ERROR: No body file. HTML5(WEB) output will not be created." This is the code: option ls=65 ps=65; data one; input IQ; cards; 145 139 122 ; title 'Normal Quantile - Quantile Plot for IQ'; ods graphics on; proc univariate data=one; qqplot IQ / normal (mu=est sigma=est); run;
Please provide assistance to fix the segmentation fault error I am receiving and solve the following...
Please provide assistance to fix the segmentation fault error I am receiving and solve the following problem I am working on: My goal is to build a Trie data structure in C++ that can do the following: - Capable to insert any given dictionary .txt file filled with a single word per line (i.e. file includes ant, bat, car, desk, etc.) into the Trie. A sample dictionary file that I'm working with can be found at http://txt.do/1pht5 - Prompts the...
please correct the error and fix this code: (i need this work and present 3 graphs):...
please correct the error and fix this code: (i need this work and present 3 graphs): Sampling_Rate = 0.00004; % which means one data point every 0.001 sec Total_Time = 0:Sampling_Rate:1; % An array for time from 0 to 1 sec with 0.01 sec increment Omega = 49.11; % in [rad/s] zeta=0.0542; %unitless Omega_d=49.03; % in [rad/s] Displacement_Amplitude = 6.009; % in [mm] Phase_Angle = 1.52; % in [rad] Total_No_of_Points = length(Total_Time); % equal to the number of points in...
Syntax error in C. I am not familiar with C at all and I keep getting...
Syntax error in C. I am not familiar with C at all and I keep getting this one error "c error expected identifier or '(' before } token" Please show me where I made the error. The error is said to be on the very last line, so the very last bracket #include #include #include #include   int main(int argc, char*_argv[]) {     int input;     if (argc < 2)     {         input = promptUserInput();     }     else     {         input = (int)strtol(_argv[1],NULL, 10);     }     printResult(input);...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT