Total members 11894 |It is currently Thu Nov 21, 2024 9:32 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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.




Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time

hey brother,

Try to write some code and come so we help you in it ,!!!

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

1) for(onecounter = 1;onecounter <= 3; onecounter++)
{
System.out.println("Enter Number " + onecounter + " : ");
}

_________________
Environmental enrichment (neural), how the brain is affected by the stimulation of its information processing provided by its surroundings.


Author:
Newbie
User avatar Posts: 6
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.


Author:
Newbie
User avatar Posts: 6
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

        
        
           
for(int onecounter 1;onecounter <= 2onecounter++)
           {
             if(
onecounter == 1)
             {
                
System.out.println("Lowest Number First.");
                
System.out.println("Enter Number " onecounter " : ");
                    
NumOne keyboard.nextInt();
             }
             if(
onecounter == 2)
             {
                
System.out.println("Enter Number " onecounter " : ");
                    
NumTwo keyboard.nextInt();
             }
            }
            
        for(
int twocounter NumOne;twocounter <= NumTwo;twocounter+2;)
        {
                
System.out.println(twocounter);
        }        

 
}
}
 


_________________
Environmental enrichment (neural), how the brain is affected by the stimulation of its information processing provided by its surroundings.


Author:
Newbie
User avatar Posts: 6
Have thanks: 1 time

For this message the author 3nriched has received gratitude : DrRakha
Post new topic Reply to topic  [ 5 posts ] 

  Related Posts  to : Need help with code for a while loop program
 How to link a c++ program with HTML code     -  
 C++ While loop     -  
 While loop     -  
 Do while loop     -  
 do while loop and for loop C++ example help.     -  
 I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER     -  
 Using include() Within a Loop     -  
 Breaking a Loop     -  
 Why will my loop does not work     -  
 PIC Assembly For Loop Example     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com