Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class methods
- {
- int add2Value1;
- int add2Value2;
- int total;
- double tempC;
- double tempF;
- public void add2 (int add2Value1, int add2Value2)
- {
- this.add2Value1 = add2Value1;
- this.add2Value2 = add2Value2;
- }
- public void convertToF (double tempC)
- {
- this.tempC = tempC;
- }
- public int add2Result ()
- {
- return this.total;
- }
- public double convertToF ()
- {
- return this.tempF;
- }
- }
- public class JAssess {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- System.out.println("This is my main method with all sorts of random methods");
- System.out.println("Testing add2");
- System.out.println("Testing convertToF");
- System.out.println("Testing isPalindrome");
- System.out.println("Testing isInOrder");
- System.out.println("Testing addAll");
- System.out.println("Testing countA");
- System.out.println("Testing chooseRandom");
- System.out.println("Testing factorial");
- }
- public static int add2(int add2Value1, int add2Value2, int total)
- {
- System.out.println("Give 2 values");
- add2Value1 = TextIO.getInt();
- add2Value2 = TextIO.getInt();
- total = add2Value1 + add2Value2;
- return total;
- }
- public static double convertToF(double tempC, double tempF)
- {
- System.out.println("Give the temperature in degrees Celsius");
- tempC = TextIO.getDouble();
- tempF = tempC*9/5+32;
- return tempF;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement