0_00
0_00
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
currentaccountNumber and currentPIN1 are the user input
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
Im trying to make the login right now and when I do
if(currentaccountNumber.Contains(accountNumber) && currentPIN1.Contains(accountPIN));
if(currentaccountNumber.Contains(accountNumber) && currentPIN1.Contains(accountPIN));
it tells me that accountNumber and accountPIN dont exist in the current context
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
okok that makes sense
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
foreach(Account account in accountList){
Console.WriteLine(account);
}
foreach(Account account in accountList){
Console.WriteLine(account);
}
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
so I'm in the process of doing that right now but whenever I try to access my objects I get the output of
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
ohh ok nice ill fix that in a few
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
so basically what im trying to check is if the accountnumber that the user inputs contains a matching pin in one of the objects I have made
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
class Account{
private string first_name, last_name, accountType, accountNumber;
private int accountPIN, totalDeposits, totalWithdrawals;

private float accountBalance;


public Account (string accountNumber, int accountPIN, string first_name, string last_name, float accountBalance, int totalDeposits, int totalWithdrawals, string accountType){
this.accountNumber = accountNumber;
this.accountPIN = accountPIN;
this.first_name = first_name;
this.last_name = last_name;
this.accountBalance = accountBalance;
this.totalDeposits = totalDeposits;
this.totalWithdrawals = totalWithdrawals;
this.accountType = accountType;
}
///Get and set for class
public string getaccountNumber(){
return this.accountNumber;
}
public void setaccountNumber(string newaccountNumber){
this.accountNumber = newaccountNumber;
}
public int getaccountPIN(){
return this.accountPIN;
}
public void setaccountPIN(int newaccountPIN){
this.accountPIN= newaccountPIN;
}
public string getfirst_name(){
return this.first_name;
}
public void setfirst_name(string newfirst_name){
this.first_name = newfirst_name;
}
public string getlast_name(){
return this.last_name;
}
public void setlast_name(string newlast_name){
this.last_name = newlast_name;
}
public float getaccountBalance(){
return this.accountBalance;
}
public void setaccountBalance(float newaccountBalance){
this.accountBalance = newaccountBalance;
}
public int gettotalDeposits(){
return this.totalDeposits;
}
public void settotalDeposits(int newTotalDeposits){
this.totalDeposits = newTotalDeposits;
}
public int gettotalWithdrawals(){
return this.totalWithdrawals;
}
public void settotalWithdrwals(int newTotalWithdrawals){
this.totalWithdrawals = newTotalWithdrawals;
}
public string getaccountType(){
return this.accountType;
}
public void setaccountType(string newaccountType){
this.accountType = newaccountType;
}
///get and set ended
///methods begin now

}
class Account{
private string first_name, last_name, accountType, accountNumber;
private int accountPIN, totalDeposits, totalWithdrawals;

private float accountBalance;


public Account (string accountNumber, int accountPIN, string first_name, string last_name, float accountBalance, int totalDeposits, int totalWithdrawals, string accountType){
this.accountNumber = accountNumber;
this.accountPIN = accountPIN;
this.first_name = first_name;
this.last_name = last_name;
this.accountBalance = accountBalance;
this.totalDeposits = totalDeposits;
this.totalWithdrawals = totalWithdrawals;
this.accountType = accountType;
}
///Get and set for class
public string getaccountNumber(){
return this.accountNumber;
}
public void setaccountNumber(string newaccountNumber){
this.accountNumber = newaccountNumber;
}
public int getaccountPIN(){
return this.accountPIN;
}
public void setaccountPIN(int newaccountPIN){
this.accountPIN= newaccountPIN;
}
public string getfirst_name(){
return this.first_name;
}
public void setfirst_name(string newfirst_name){
this.first_name = newfirst_name;
}
public string getlast_name(){
return this.last_name;
}
public void setlast_name(string newlast_name){
this.last_name = newlast_name;
}
public float getaccountBalance(){
return this.accountBalance;
}
public void setaccountBalance(float newaccountBalance){
this.accountBalance = newaccountBalance;
}
public int gettotalDeposits(){
return this.totalDeposits;
}
public void settotalDeposits(int newTotalDeposits){
this.totalDeposits = newTotalDeposits;
}
public int gettotalWithdrawals(){
return this.totalWithdrawals;
}
public void settotalWithdrwals(int newTotalWithdrawals){
this.totalWithdrawals = newTotalWithdrawals;
}
public string getaccountType(){
return this.accountType;
}
public void setaccountType(string newaccountType){
this.accountType = newaccountType;
}
///get and set ended
///methods begin now

}
is how my class is set up
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
my bad,
while(!fileReader.EndOfStream){
string lineOfData = fileReader.ReadLine()!;
string[] accountData = lineOfData.Split(",");
string accountNumber = accountData[0];
int accountPIN = int.Parse(accountData[1]);
string first_name = accountData[2];
string last_name = accountData[3];
float accountBalance = float.Parse(accountData[4]);
int totalDeposits = int.Parse(accountData[5]);
int totalWithdrawals = int.Parse(accountData[6]);
string accountType = (accountData[7]);
accountList.Add(new Account(accountNumber,accountPIN, first_name, last_name, accountBalance, totalDeposits, totalWithdrawals, accountType));
while(!fileReader.EndOfStream){
string lineOfData = fileReader.ReadLine()!;
string[] accountData = lineOfData.Split(",");
string accountNumber = accountData[0];
int accountPIN = int.Parse(accountData[1]);
string first_name = accountData[2];
string last_name = accountData[3];
float accountBalance = float.Parse(accountData[4]);
int totalDeposits = int.Parse(accountData[5]);
int totalWithdrawals = int.Parse(accountData[6]);
string accountType = (accountData[7]);
accountList.Add(new Account(accountNumber,accountPIN, first_name, last_name, accountBalance, totalDeposits, totalWithdrawals, accountType));
is how im making my objects
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
made from my class so the object would include their username and password
26 replies
CC#
Created by 0_00 on 5/6/2023 in #help
How to check if two values are in the same child of a class?
my bad i meant like the object
26 replies
CC#
Created by 0_00 on 3/24/2023 in #help
What does this error code mean
turns out it was a caps error on my end nvm lol
3 replies
CC#
Created by 0_00 on 3/24/2023 in #help
how to set enum type based on what child class is used
alright so I think you definitely answered my question on how to set the class based on what child class its in. but I am like really new to this so I think I'm going to need to watch some videos on interface in c# because a quick glance over microsofts website isn't working for me rn. if i close this ticket will it still be accessible or archived somewhere
27 replies
CC#
Created by 0_00 on 3/24/2023 in #help
how to set enum type based on what child class is used
ok wait Im probably confused then
27 replies
CC#
Created by 0_00 on 3/24/2023 in #help
how to set enum type based on what child class is used
I think I understand now, I'm going to try inheriting WorkerType to all three of my classes and then create a different set method for each class. Thank you for the example
27 replies
CC#
Created by 0_00 on 3/13/2023 in #help
❔ working with classes and they arent working
autoType is a public enum
12 replies
CC#
Created by 0_00 on 3/13/2023 in #help
Classes question in c#
oh ok thanks
4 replies