This entry was posted on June 4, 2007 at 10:49 am and is filed under Projects . You can follow any responses to this entry through the RSS 2.0 feed
You can leave a response, or trackback from your own site.
public class Trucks
{
public static void main(String[]args)
{
int index, weight, count=0;
String outputStr;
int[] maxWeight={50000,25000,20000,35000,40000,25000,30000};
outputStr= (”This program asks the user for the truck number\n”
+ “and the weigh-in value for each truck in a fleet.\n\n”
+”The weigh-in value is compared to the established\n”
+ ” maximum weight limit. A message is displayed to tell\n”
+ ” the user whether the truck is or is not within weight”
+ “limits.\n\n”);
do
{
index= Integer.parseInt(JOptionPane.showInputDialog( “Please enter the truck”
+” number: “));
if(index maxWeight.length)
{
JOptionPane.showMessageDialog(null,
“You entered an incorrect truck number.”,
“Incorrect Truck Number Message”,
JOptionPane.INFORMATION_MESSAGE);
}
else
{
weight=Integer.parseInt(JOptionPane.showInputDialog(
“Please enter the truck weight: “));
JOptionPane.showMessageDialog(null,”All tr ucks have weighted-in.”,
“Truck Weigh-in Complete Message”, JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}//end main
}//end class
June 4th, 2007 at 10:50 am
import javax.swing.JOptionPane;
public class Trucks
{
public static void main(String[]args)
{
int index, weight, count=0;
String outputStr;
int[] maxWeight={50000,25000,20000,35000,40000,25000,30000};
outputStr= (”This program asks the user for the truck number\n”
+ “and the weigh-in value for each truck in a fleet.\n\n”
+”The weigh-in value is compared to the established\n”
+ ” maximum weight limit. A message is displayed to tell\n”
+ ” the user whether the truck is or is not within weight”
+ “limits.\n\n”);
do
{
index= Integer.parseInt(JOptionPane.showInputDialog( “Please enter the truck”
+” number: “));
if(index maxWeight.length)
{
JOptionPane.showMessageDialog(null,
“You entered an incorrect truck number.”,
“Incorrect Truck Number Message”,
JOptionPane.INFORMATION_MESSAGE);
}
else
{
weight=Integer.parseInt(JOptionPane.showInputDialog(
“Please enter the truck weight: “));
if (weight
June 4th, 2007 at 10:50 am
if (weight
June 4th, 2007 at 10:51 am
JOptionPane.showMessageDialog(null,
“You entered an incorrect weight number.” ,
“Incorrect Truck Weight Message”,
JOptionPane.INFORMATION_MESSAGE);
else
{
if(maxWeight[index-1]
June 4th, 2007 at 10:53 am
JOptionPane.showMessageDialog(null,
“You have exceeded your allowable weight allowance.”,
“Truck Excess Weight Message”,
JOptionPane.INFORMATION_MESSAGE);
count++;
}
}
}while (count
June 4th, 2007 at 10:53 am
maxWeight.length);
JOptionPane.showMessageDialog(null,”All tr ucks have weighted-in.”,
“Truck Weigh-in Complete Message”, JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}//end main
}//end class
June 19th, 2007 at 7:15 pm
Well done boys! Great news!
September 3rd, 2007 at 8:25 am
For penis enlargement visit http://www.hqpicture.com