yummy_bee
yummy_bee
CC#
Created by yummy_bee on 10/2/2024 in #help
✅ SQL code
No description
8 replies
CC#
Created by yummy_bee on 9/29/2024 in #help
SQL code invalid object name
No description
13 replies
CC#
Created by yummy_bee on 9/27/2024 in #help
SQL code
No description
32 replies
CC#
Created by yummy_bee on 9/24/2024 in #help
✅ SQL code
No description
9 replies
CC#
Created by yummy_bee on 9/20/2024 in #help
✅ null reference
How do I fix possible null reference return do I add = null! after the errormessage or why does that come up as a warning? ```cs using System; using System.IO; namespace Calculator.View { public class CalculatorView { public string ErrorMessage { get; set; } public double ResultString { get; set; } public string InputString { get; set; } public string GetRPNString() { Console.WriteLine(); return Console.ReadLine(); } public void DisplayResult(double result) { Console.WriteLine("Result: " + result); } public void DisplayError(string errorMessage) { Console.WriteLine("Error: " + errorMessage); } public string ReadInputFromFile(string filePath) { using (StreamReader reader = new StreamReader(filePath)) { return reader.ReadLine(); } } public void WriteOutputToFile(string filePath, double result) { try { using (StreamWriter writer = new StreamWriter(filePath, false)) { writer.WriteLine("Result: " + result); } Console.WriteLine($"Wrote result to file: {filePath}"); } catch (Exception ex) { Console.WriteLine($"Error writing to file: {ex.Message}"); } } } } ```
37 replies
CC#
Created by yummy_bee on 9/18/2024 in #help
✅ RPN calculator
I am coding a RPN calculator and I am supposed to do the calculator.view part and I just want to make sure I am doing it right. This is the code I have written so far and I attached the instructions. //Calculator.view// using System; using System.IO; namespace Calculator.View { public class Calculator { public string GetRPNString() { Console.WriteLine(); return Console.ReadLine(); } } } namespace Calculator.View { public class UserInput { public void DisplayResult(double ResultString) { Console.WriteLine("Result:" + ResultString); } public void DisplayError(string ErrorMessage) { Console.WriteLine("Error: " + ErrorMessage); } } } namespace Calculator.View { public class FileInput { private string FilePath; public FileInput(string filePath) { FilePath = filePath; } public string ReadInputFromFile() { using (StreamReader reader = new StreamReader(FilePath)) { return reader.ReadLine(); }
} } } namespace Calculator.View { public class FileOutput { private string FilePath; public FileOutput(string filePath) { FilePath = filePath; } public void WriteOutputToFile(double result) { try { using (StreamWriter writer = new StreamWriter(FilePath)) { writer.WriteLine(“Result: “ + result); } } catch (Exception ex) { Console.WriteLine(“Error writing to file: “ + ex.Message); } } } }
12 replies
CC#
Created by yummy_bee on 9/17/2024 in #help
✅ help with assignment
I am coding a RPN calculator and I am supposed to do the calculator.view part and I just want to make sure I am doing it right. This is the code I have written so far and I attached the instructions. //Calculator.view// using System; using System.IO; namespace Calculator.View { public class Calculator { public string GetRPNString() { Console.WriteLine(); return Console.ReadLine(); } } } namespace Calculator.View { public class UserInput { public void DisplayResult(double ResultString) { Console.WriteLine("Result:" + ResultString); } public void DisplayError(string ErrorMessage) { Console.WriteLine("Error: " + ErrorMessage); } } } namespace Calculator.View { public class FileInput { private string FilePath; public FileInput(string filePath) { FilePath = filePath; } public string ReadInputFromFile() { using (StreamReader reader = new StreamReader(FilePath)) { return reader.ReadLine(); }
} } } namespace Calculator.View { public class FileOutput { private string FilePath; public FileOutput(string filePath) { FilePath = filePath; } public void WriteOutputToFile(double result) { Console.WriteLine(FilePath, "Results: " + result); } } }
9 replies
CC#
Created by yummy_bee on 9/14/2024 in #help
✅ help with assignement
No description
11 replies