Question: To modify this Tip Calculator app (App codes are below) to allow the user to enter the number of people at the party. Calculate and

To modify this Tip Calculator app (App codes are below) to allow the user to enter the number of people at the party.


Calculate and display the amount owed by each person if the bill were to be split evenly among the party members. 

 

// Fig.: TipCalculator.java
// Main application class that loads and displays the Tip Calculator's GUI.
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class TipCalculator extends Application {
  @Override
  public void start(Stage stage) throws Exception {
     Parent root =
        FXMLLoader.load(getClass().getResource("TipCalculator.fxml"));

     Scene scene = new Scene(root); // attach scene graph to scene
     stage.setTitle("Tip Calculator"); // displayed in window's title bar
     stage.setScene(scene); // attach scene to stage
     stage.show(); // display the stage
  }

  public static void main(String[] args) {
     // create a TipCalculator object and call its start method
     launch(args);
  }
}

 


 









 
     
     
 

 
     
     
     
     
     
 

 
     

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure I can help you modify the Tip Calculator app to include the number of people at the party and c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!