Austin9675
If statements
this is how it works for me
int textbook;
char cover;
double rprice;
double fprice;
Console.WriteLine("Enter number of books");
textbook = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Do you want hardback? y/n");
cover = Convert.ToChar(Console.ReadLine());
rprice = textbook * 125;
if (cover == 'y' && textbook > 4)
{
double discount = 0.20; // 20% discount
double tax = 0.05; // 5% tax
fprice = rprice - (discount * rprice) + (tax * rprice);
Console.WriteLine(fprice);
}
65 replies
Finding a game file
private void step2Button_Click(object sender, EventArgs e)
{
string userHomePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string palServerRelativePath = Path.Combine("Program Files (x86)", "Steam", "steamapps", "common", "PalServer", "Pal", "Saved", "Config", "WindowsServer");
string palServerConfigPath = Path.Combine(userHomePath, palServerRelativePath);
string fileName = "PalWorldSettings.config";
string filePath = Path.Combine(palServerConfigPath, fileName);
if (!Directory.Exists(palServerConfigPath))
{
Console.WriteLine($"Directory not found: {palServerConfigPath}");
}
if (File.Exists(filePath)) { using (StreamWriter sw = new StreamWriter(palServerConfigPath)) { sw.WriteLine("[/Script/Pal.PalGameWorldSettings]"); sw.WriteLine("OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,BaseCampWorkerMaxNum=15,DropItemAli"); sw.WriteLine(@"veMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,CoopPlayerMaxNum=4,ServerPlayerMaxNum=32,ServerName=""Default Palworld Server"",ServerDescription="""",AdminPassword="""",ServerPassword="""",PublicPort=8211,PublicIP="""",RCONEnabled=False,RCONPort=25575,Region="""",bUseAuth=True,BanListURL=""https://api.palworldgame.com/api/banlist.txt"""); } } else { MessageBox.Show($"{fileName} cannot be found, you must download PalWorld Dedicated Servers on steam!", "File not found"); } }
if (File.Exists(filePath)) { using (StreamWriter sw = new StreamWriter(palServerConfigPath)) { sw.WriteLine("[/Script/Pal.PalGameWorldSettings]"); sw.WriteLine("OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,BaseCampWorkerMaxNum=15,DropItemAli"); sw.WriteLine(@"veMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,CoopPlayerMaxNum=4,ServerPlayerMaxNum=32,ServerName=""Default Palworld Server"",ServerDescription="""",AdminPassword="""",ServerPassword="""",PublicPort=8211,PublicIP="""",RCONEnabled=False,RCONPort=25575,Region="""",bUseAuth=True,BanListURL=""https://api.palworldgame.com/api/banlist.txt"""); } } else { MessageBox.Show($"{fileName} cannot be found, you must download PalWorld Dedicated Servers on steam!", "File not found"); } }
2 replies