Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2008, 04:19 PM
Zebra's Avatar
Member
 
Join Date: Apr 2008
Location: Louisville, Indiana/Kentucky
Posts: 64
Zebra is on a distinguished road
Quotients/Remainders (Loops *Need Help*)
Write a program that finds the quotients and remainders of all the numbers
between 200 and 225 when they are divided by x, where x= 11 if the number
is even and x is 14 if the number is odd. Here's what the output should
look like.

OUTPUT:
Attached Images
File Type: jpg output copy.jpg (76.2 KB, 7 views)
__________________
I am a Java n00b.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-17-2008, 04:25 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
You know what?!! if you don't try to do it yourself first, you will never realize how lovable java programming is....

An ideal forum was designed to help/discuss other members about there problem or new ideas, sharing it with them while learning....

And not to feed them ( Posting the complete code )....

don't be on a hurry,
sukatoa
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 05:08 PM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 251
sanjeevtarar is on a distinguished road
Hello Zebra,

I think your problem is not much hard...just think about the logic and do some paper work, it will help you lot.

First try it at your self...OK

however i have done this.

Code:
public class FindQuotientsRemainders { public static void main(String[] args){ getNumber(); } public static void getNumber(){ int evenX = 11; int oddX = 14; for (int i=200;i<=225;i++ ){ int quoti = 0,rema = 0; if(i%2==0){ quoti = i/evenX; rema = i%evenX; System.out.println("When "+i+" is divided by "+evenX+", the quotients is "+quoti+" and remainders is "+rema); }else{ quoti = i/oddX; rema = i%oddX; System.out.println("When "+i+" is divided by "+oddX+", the quotients is "+quoti+" and remainders is "+rema); } } } }

sanjeev
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about loops BHCluster New To Java 4 04-16-2008 07:40 PM
[SOLVED] Integers (averages and remainders)...need help Zebra New To Java 4 04-16-2008 03:26 PM
[SOLVED] Need help with Loops...please! Zebra New To Java 5 04-10-2008 03:44 PM
Loops (while do etc) manupr New To Java 1 01-15-2008 05:59 AM
Help me: loops in java silvia New To Java 3 07-19-2007 08:47 PM


All times are GMT +3. The time now is 06:53 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org