Easy question here............
I have written some simple maths problems and simple logic they compile and execute properly. How should I present my work correctly?.So everything is aligned and easy to read etc.......
/**
* program to calculate amount of bolts,nuts and washers andwarn if wrog amount entered.
*
* @author (your name)
* @version (a version number or a date)
*/
public class BobsBolts
{
public static void main (String args[]){
int bolt, nut, washer;
System.out.print("Enter number of bolts ");
bolt=UserInput.readInt();
System.out.print("Enter number of nuts ");
nut=UserInput.readInt();
System.out.print("Enter number of washers ");
washer=UserInput.readInt();
System.out.println();
if (nut>bolt){
System.out.println("Check order");
}
else{
System.out.println("Order OK");
}
bolt = ( int)(bolt*5);
nut = (int)(nut*3);
washer = (int)(washer*1);
System.out.println();
System.out.println ("Total price in pence is "+(bolt+nut+washer));
}//end main
}//end class

New Topic/Question
Reply



MultiQuote














|