Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML
 
 
Hot Web Programming Job

 

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

[an error occurred while processing this directive]

Java Notes

Programming: Numeric Conversion

Name ________________________________

Description

Write a program which converts a measurement from one system of units to another. Read a number (or numbers) in one system and output the equivalent number (or numbers) in the other system. Instead of thinking of it as a conversion, it could also be a calculation, eg, to calculate the air pressure from the altitude.

Model program and iterative programming

Start with Kilometers to Miles as an example of how a conversion program might be written.

Iterative programming is the process of writing some of the program, compiling and testing it, then writing more, compiling and testing that, etc. Keep going in this cycle until the program is done. The iterative style generally has a much higher success rate than writing the entire program, then compiling and testing it. You may also have to make greater changes to it, eg to read two values, one for feet and one for inches.

Change names. You're welcome to start with the Kilometers to Miles program, but be sure you change all names and comments to reflect the problem you are solving.

Examples of other possible conversions/calculations

  • Fahrenheit - Celsius
  • Pounds - kilograms
  • Feet and inches - meters
  • Inches - lightyears
  • Seconds - Days, hours, minutes, seconds
  • Cubic meters - acre feet
  • Miles per hour - Mach
  • Room length, width, and height to gallons of paint.
  • Anything else! I would prefer that you choose something that you would really like to see converted, but avoid conversions that aren't fixed, eg, dollars to Euros.
Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

0 comments so far (post your own) View All Comments Latest 10 Comments:

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.