-1
import java.util.Scanner;
public class RentalDemo
{
     public static void main (String[] args)
   {
     Scanner input = new Scanner (System.in);
     String cnumber;
     String outnumber;
     Rental first=new Rental();
     System.out.print("Enter the contract number: ");
     cnumber = input.next();
     first.setContractNumber(cnumber);
     outnumber=first.getContractNumber();
     System.out.println("The contract number is: "+outnumber);
     Rental Hours = new Rental();
    double Hourss = Hours.getHours();
     Rental Minutes = new Rental();
     double Minutess = Minutes.getMinutes();
     SammysRentalPriceWithMethods motto = new SammysRentalPriceWithMethods();
     motto.companyMotto();
   }
     ****public static void AlmostThere(double Minutess, double Hourss)
  {   double Total_Cost = Hourss * 40 + Minutess; 

    System.out.println("You rented our equipment for " + Hourss + "complete hours and "+ Minutess + " extra minutes!");
    System.out.println("The total cost of a " + Hourss + " hour rental, with " + Minutess + "extra minutes is " + Total_Cost + "at a $40 rate/hr with a $1 rate/extramin!");** 
 }

This last section here is the part that isn't printing out when I run it, any ideas why? I'm sorry if I wasn't thorough,** I was expecting it to take the correct numbers and show it to the reader but it just gets through the Main method and stops.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Michael
  • 3
  • 3

3 Answers3

1

You're never calling the AlmostThere() method. That's what's going to print out everything for you.

At the end of your main() method do something like:

AlmostThere(Hourss, Minutess);
Bono
  • 4,757
  • 6
  • 48
  • 77
0

You need to call the AlmostThere method or it will never be run.

Try adding

 AlmostThere(Minutess,Hourss);

at the end of your Main method.

barna10
  • 177
  • 1
  • 9
0

Its because you are not calling the method AlmostThere. Any method after the main method has to be called in order for you to see the output.

For example, to call you method you could write.

AlmostThere(45.0, 7.0));
Eridanis
  • 410
  • 1
  • 6
  • 19