Search results for query: *

  • Users: WB1975
  • Content: Threads
  • Order by date
  1. W

    Answered Should getters and setters be used for everything?

    Should getters and setters be used for every bit of data you get from a user? If I have a questionnaire getting data from a user should getters and setters always be used to get/set information like a name address age etc etc i understand what they are? just dont know their relevance and how...
  2. W

    Why do i have to press y twice?

    I have a questionnaire that gets info from the user it asks a question like name etc then asks if hes satisfied with the name then after all the questions it gives a summary of data supplied and then asks if its ok to proceed if the user presses y it exits that part of the program if n it hits...
  3. W

    Exercises for beginners

    Does anybody know where there are any good exercises for beginners im not talking about quick exercises but more word problem ones that are more like mini projects something like an address book or something similar, cant seem to find any. Cant someone suggest some, and then us beginners can...
  4. W

    Resolved Are arraylists generally used instead of arrays?

    Are arraylists generally used instead of arrays? I know arraylists are more flexible, but is there any time you would use a standard array instead?
  5. W

    Creating objects from a class within that same class

    Hi guys If I have a Program class with main and i have a Team class And in the Team class I have fields teamName teamValue then in Team i want methods CreateTeam DeleteTeam AddTeamValue ViewTeams now I know in the constructor in my Program class I can go Team liverpool = new Team(4.5); -...
  6. W

    Does main is a pain also apply to c#

    I have a little bit of a java background Does main is a pain also apply to c# how do you launch your console applications? what is standard practice?
  7. W

    Question about bool

    this works very well, is it true to say if a bool is false, but then gets a value that it becomes true? Somebody answered me something similar in another thread, but i just wanted to make sure. bool hasName = false; while (!hasName) {...
  8. W

    Question menu - non static or static method?

    If im going to make a menu for my utility should i have a non static method to print the menu and a static method to handle the logic? or would you just put it all in one method, or does it not really matter?
  9. W

    Answered Please critique my method

    This method asks for a string between min and max characters and then asks for confirmation on entering a valid string please let me know if it can be done more efficiently etc etc public static string GetLimitedStringWithConfirmation(string prompt, int min, int max) { do {...
  10. W

    Returning in methods

    in this method public static string GetLimitedString(string prompt, int min, int max) { string userString; bool hasAString = false; do { Console.WriteLine(prompt); userString = Console.ReadLine(); if (userString.Length >= min && userString.Length <= max)...
  11. W

    Answered SystemSounds error

    this line SystemSounds.Beep.Play(); - SystemSounds gives an error tried adding using System.Media; but didnt help what do i need to do?
  12. W

    Help with KeyboardUtility class

    I thought it might be a good idea to have a class that handles all the keyboard stuff so i dont have to keep writing input code over and over i mean thats one of the pros i read about OOP, reusable code. I have created a Class called KeyboardUtility and I have it returning number only input...
  13. W

    Resolved How can I exit my program from a function in another class?

    How can I exit my loop in the main program when the user enters q? whats the best way to set this up? i have this class using System; namespace HourlyMeetingScheduler { class Program { static void Main(string[] args) { bool programRunning = true...
  14. W

    Answered Why cant i use a char in a switch?

    in this method, why cant i use a char in my switch? public void MainMenuLogic() { string userChoice = Console.ReadLine(); char firstLetter = userChoice[0]; switch (firstLetter) { case "a": {...
  15. W

    Answered Adding numbers to an Array and sorting them

    Just doing an exercise, Adding numbers to an array and then sorting the list. im trying to determine if input from a user is a number or a letter for my options, but i think im over complicating it. Am i on the right track here or is there an easy way to do this? The problem im having is...
  16. W

    Answered Why is my field not working?

    Hello guys, cant remember if really newb questions go here. anyway, i am writing a basic times table program asks the user for number between 1 and 12 then spits out that numbers times table, but im having a problem, why cant number be carried through the do while loop? i would have thought...
  17. W

    Resolved Getting a mobile number from a user

    if i wanted a user to enter a mobile number in a console application so the user can only input 011 086 087 to start and then 7 digits after that so as in 0142223434 would it be best done with regular expressions? or is there a better way?
  18. W

    Resolved c# back end

    sorry guys didnt know where to post this.. what do i need to know to create a back end for web apps made with html css javascript. is there a free solution? it will be basically for study, nothing too elaborate but something that can scale with time. Basically what companies are using. any...
  19. W

    Cant work out why my program is behaving differently

    Hi guys, I just cant work out why my program is behaving differently to the tutorial im following, i have checked the code again and again (Though i bet you its something stupid i missed, usually is) the problem im having, where his program is different is that after he creates a new car...
  20. W

    why that method was made static?

    Hello all, im new here. Is this where beginners can ask stupid c# questions? or is there another section somewhere? i will post now and im sure it can get moved to the relevant location if this isnt it. anyway following a app tutorial on youtube, loving it. but in the code: to take this...
Back
Top Bottom