Create a GUI application in C# that calculates and displays the total travel expenses of a...

90.2K

Verified Solution

Question

Programming

Create a GUI application in C# that calculates and displays thetotal travel expenses of a business person on a trip. Here is theinformation that the user must provide:

• Number of days on the trip

• Amount of airfare, if any

• Amount of car rental fees, if any

• Number of miles driven, if a private vehicle was used

• Amount of parking fees, if any

• Amount of taxi charges, if any

• Conference or seminar registration fees, if any

• Lodging charges, per night

The company reimburses travel expenses according to thefollowing policy:

• $37 per day for meals

• Parking fees, up to $10.00 per day

• Taxi charges up to $20.00 per day

• Lodging charges up to $95.00 per day

• If a private vehicle is used, $0.27 per mile driven.

The application should calculate and display the following:

• Total expenses incurred by the businessperson

• The total allowable expenses for the trip

• The excess that must be paid by the businessperson, if any

• The amount saved by the businessperson if the expenses wereunder the total allowed

Answer & Explanation Solved by verified expert
4.3 Ratings (1062 Votes)
Here is the code and please let me know if any errors occurs import javaawt import javaawtevent import javaxswing import javaxswingJOptionPane import javatextDecimalFormat public class TravelExpenses extends JFrame 013 private JPanel travelInfoPanel private JPanel buttonPanel private JLabel numDaysOnTripLabel private JLabel amountAirfairLabel private JLabel amountCarRentalLabel private JLabel milesDrivenLabel private JLabel parkingFeesLabel private JLabel taxiFeesLabel private JLabel confRegLabel private JLabel lodgingChargesPerNightLabel private JTextField numDaysOnTripTextField private JTextField amountAirfairTextField private JTextField amountCarRentalTextField private JTextField milesDrivenTextField private JTextField parkingFeesTextField private JTextField taxiFeesTextField private JTextField confRegTextField private JTextField lodgingChargesPerNightTextField private JButton resetButton private JButton calcButton private double mealsAmount 3700 private    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students