Question subject: Need help with code for a while loop program
Posted: Fri Nov 19, 2010 4:49 am
Joined: Sun Oct 31, 2010 8:04 pm Posts: 2 Has thanked: 0 time Have thanks: 0 time
I am not asking anyone to do my assignment for me, I just have no clue what I am suppose to do. I don't know where to start or what exactly the program is looking for. If someone would kindly explain or would help me out with this, I will definitely appreciate all the help I can get.
So my assignment is to write a program that used while loops to perform 6 different things. 1. prompt the users to input two integers: firstNum and secondNum (firstNum must be less than secondNum). 2. output all the odd numbers between firstNum and secondNum inclusive 3. output the sum of all the even numbers between firstNum and secondNum inclusive 4. output all the numbers and their squares between 1 and 10 5. output the sum of the squares of all the odd numbers between firstNum and secondNum inclusive 6. output all the uppercase letter. and lastly there is a hint: if currentNum % 2 = 0, then the currentNum is an even number. Otherwise it is an odd number.
Once again, I am not expecting or asking anyone to do a whole code or my entire assignment for me. I just really need help because I am so confused with the whole program. Thank You.
msi_333
Question subject: Re: Need help with code for a while loop program
Posted: Sun Nov 21, 2010 8:39 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
hey brother,
Try to write some code and come so we help you in it ,!!!
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
3nriched
Question subject: Re: Need help with code for a while loop program
Posted: Sun Nov 28, 2010 2:24 am
Joined: Sat Nov 27, 2010 1:06 am Posts: 6 Has thanked: 2 time Have thanks: 1 time
_________________ Environmental enrichment (neural), how the brain is affected by the stimulation of its information processing provided by its surroundings.
3nriched
Question subject: Re: Need help with code for a while loop program
Posted: Sun Nov 28, 2010 3:25 am
Joined: Sat Nov 27, 2010 1:06 am Posts: 6 Has thanked: 2 time Have thanks: 1 time
hehe
im gonna try this just for funnzies..
_________________ Environmental enrichment (neural), how the brain is affected by the stimulation of its information processing provided by its surroundings.
3nriched
Question subject: Re: Need help with code for a while loop program
Posted: Sun Nov 28, 2010 3:36 am
Joined: Sat Nov 27, 2010 1:06 am Posts: 6 Has thanked: 2 time Have thanks: 1 time
this is wut i got atm,maybe others can input as a grp assignment :p
Code:
import java.util.Scanner; //import scanner class
class loopsforumhelp {
public static void main(String[] args) {
int NumOne = 0; //inputted number one int NumTwo = 0; //inputted number two
Scanner keyboard = new Scanner(System.in); // holds input
_________________ Environmental enrichment (neural), how the brain is affected by the stimulation of its information processing provided by its surroundings.
For this message the author 3nriched has received gratitude : msi_333