CSC203 Week 2 Odd or Even Assignment

 

Program that determines if a number is odd or even. Post your code here with a screen shot showing your program’s execution.

 Date Posted: 05 Apr 2009 @ 09 28 PM
Last Modified: 05 Apr 2009 @ 09 28 PM
Posted By: Ryan Bridglal
E-mail | Permalink
 

Responses to this post » (3 Total)

 
  1. Ryan Bridglal said...
    9:58 pm - April 5th, 2009

    Originally Posted: 8 Mar 09 12:22 PM MST

    Hello, this is my code for odd or even numbers.

    /**@author RyanJB, Ryan Bridglal, http://www.RyanJB.com
    *University of Advancing Technology
    *CSC203-D09FEB05
    *Professor Estabrook-Fishinghawk
    *Week 2 Even or Odd Assignment, 03-06-09
    */
    import java.util.Scanner;

    public class Main {

    public static void main(String[] args) {
    //declares input and integers
    Scanner input = new Scanner(System.in);

    int getNumber;

    //begins the program and accepts input
    System.out.print(”Hello, this program determines\nif the number you enter is even or odd!\n\nEnter your number:”);
    getNumber = input.nextInt();

    //does the calculation and outputs result
    if ( getNumber % 2 == 0 ) {
    System.out.print(”Your # is Even!”);
    }
    else {
    System.out.print(”Your # is Odd!”);
    }
    }
    }

  2. Ryan Bridglal said...
    10:01 pm - April 5th, 2009

    Originally Posted: 8 Mar 09 12:22 PM MST

  3. Ryan Bridglal said...
    10:03 pm - April 5th, 2009

    Originally Posted: 8 Mar 09 12:22 PM MST

 

Leave A Comment ...

 


You must be logged in to post a comment.


 XHTML:
You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
\/ More Options ...
Change Theme...
  • Role »
  • Posts »
  • Comments »
Change Theme...
  • VoidVoid (Default)
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LiteLightweight
  • No Child Pages...
  • No Child Pages...
  • No Child Pages...
  • No Child Pages...
  • No Child Pages...
  • No Child Pages...
  • No Child Pages...
  • No Child Pages...