Quote (carteblanche @ Apr 2 2013 08:42pm)
Post what code you already have and describe your problem
This is 3 parts of a larger problem; my problem here is I'm not sure how I would do these.
Edit: 1.) 2.) 3.) refer to parts C,D,E, respectively.
Here is my full code so far though.. :
//Ben Graham
// Program D
//Page 321 #9/10
import java.util.*;
public class ProgD
{
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
{
int firstNum;
int secondNum;
int sumEven;
int sumSquareOdd;
char chCounter;
int counter;
//A
System.out.println("Enter two integers. The first number must be less than the second number.");
firstNum = console.nextInt();
secondNum = console.nextInt();
//B
if (firstNum % 2 == 0)
counter = firstNum + 1;
else
counter = firstNum;
while (counter <= secondNum)
{
System.out.print(counter + " ");
counter = counter + 2;
}
//Part C
//Part D
//Part E
//Part F
chCounter = 'A';
while (chCounter <= 'Z')
{
System.out.print(chCounter + " ");
chCounter++;
}
System.out.println();
}
}
This post was edited by ben_graham7 on Apr 2 2013 06:48pm