Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

cmh623

@cmh623
About
Posts
9
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • General C# question
    C cmh623

    What are some advantages of using Forms over MessageBoxes? And, is a return statement required in a method that returns the type void?

    C# question csharp lounge

  • Beginner programming question
    C cmh623

    I need to write a C# method that will double the values of 2 variables A and B in the calling program by passing these parameters by reference. I'm not really sure where to begin on this, any help would be greatly appreciated!

    C# csharp help question learning

  • Beginner array program, need help!!!
    C cmh623

    Thanks alot F16I ! I think I see what I was doing wrong now. Much obliged !

    C# data-structures help learning

  • Beginner array program, need help!!!
    C cmh623

    Here is what I have so far: using System; namespace ZipArray { class Program { public class ZipSort { string[] zipCodes = new string[10] { "33701", "33702", "33703", "33704", "33705", "33706", "33707", "33708", "33709", "33710"}; int x; Console.Write("Please enter a zip-code : "); string zipSearch = Console.ReadLine(); bool found = false; foreach(string zip in zipCodes) { if (zip == zipSearch) { found = true; break; } } Console.WriteLine(); if (found) { Console.WriteLine("The zip-code, {0}, is delivered to", zipSearch); } else { Console.WriteLine("The zip-code, {0}, is not delivered to", zipSearch); Console.WriteLine(); Console.WriteLine("The full list is :"); Console.WriteLine(); Array.Reverse(zipCodes); for(x=0; x Console.WriteLine(zipCodes[x]); } } I have been unable to make this program run correctly thus far, I am trying to make it to where it will allow the user to enter a zip code and if it is on the list it will read "the zip code "0" is delivered to" and after that to sort the zip codes in descending order. Any help would be much appreciated!

    C# data-structures help learning

  • Beginner programming question?
    C cmh623

    Thanks CKnig, that definitely cleared things up for me. I appreciate your help!

    C# question help tutorial learning

  • Beginner programming question?
    C cmh623

    What am I doing wrong in this snippet of code? I can't seem to figure out how to make this work: using System; public class DebugFive2 { public static void Main() { const string pass1 = home; const string pass2 = house; const string pass3 = mouse; string password; Console.Write("Please enter your password "); password = Console.ReadLine(); while(password != pass1 || password != pass2 || password != pass3) Console.WriteLine("Invalid password. Please enter again. "); password = Console.ReadLine(); Console.WriteLine("Valid password"); } } Any help would be greatly appreciated

    C# question help tutorial learning

  • [Message Deleted]
    C cmh623

    [Message Deleted]

    C#

  • What would be the proper way to comment within this code?
    C cmh623

    using System; public class AvgPrime { public static void Main() { double c=0,y=0,p=0; int i,j; bool isPrime; for(i=2; i <= 100; i++) { isPrime = true; for(j=2; j <= i/2; j++) { if(i % j == 0) { isPrime = false; } } if(isPrime) { y = y + 1; c = c + i; } } p = c/y; Console.WriteLine("The avg of all prime numbers from 1 to 100 is {0}",p); } }

    C# question

  • Need help making a basic program in C# [modified]
    C cmh623

    I am trying to make a program in C# that will find the average of all prime numbers 1 to 100 and print the output to the screen. I am very lost in this, as I am new to the whole programming world. I have been unable to come up with any code that works so any help with this would be greatly appreciated. Thanks! here is what I have so far: The general layout of the code will possibly look like: assign a var for isPrime as bool (which is used as a flag that will be changed if the program does a calc that has no remainder. ) assign a var that keeps track of number of primes it gets ex double totalPrimes assign a var that adds up the number when decides if prime of not ex double runningTotal assign number you will check assign number you will use to divide by then while (numberToCheck <=100) { -set isPrime to true again(always start with it as true) -set the divideBy var back to value 2 while (divideBy < numberToCheck) { -then you do if statement to check if the calc has remainder or not -and if it doesn't then change isPrime false (since no remainder means it is not prime) -then increment divideBy number and try the next number -if after all calculations are done and isPrime is still true, then the nubmer is prime -then provide an if statement to check if number is prime or not if so then add the number to the runningTotal and chalk up another for the total of primes, -if not prime then increment that number and run through the first loop -- modified at 21:08 Monday 21st May, 2007

    C# csharp help lounge
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups