In C# The problem is Dorm and Meal Calculator A university has the following dor
ID: 3695813 • Letter: I
Question
In C#
The problem is Dorm and Meal Calculator A university has the following dormitories: Allen Hall $1,500 per semester Pike Hall $1,600 per semester Farthing Hall $1,200 per semester University Suites $1,800 per semester The university also offers the following meal plans: 7 meals per week $560 per semester 14 meals per week $1,095 per semester Unlimited meals $1,500 per semester Create an application with two forms. The startup form allows the user to select a dormitory and a meal plan. The application should show the total charges on the second form. I have the forms designed but need some guidance on a program plan. I'm supposed to try to use classes and methods
Explanation / Answer
I have started my code to create an application with two combo boxes. One that holds the names of the dormitories and the other holds the meal plans. The user should select a dormitory and a meal plan, and the application should show the total charges for the semester. I have the GUI and the combo boxes. I was trying to add the calc button and I cant get past the :
Main.java:23: cannot find symbol
symbol : class JButton
location: class Main
private JButton calcButton;
^
Community Member
java
1
I found some errors in your code:
class Dorm {
int fPrice;
String fName
public Dorm(String name, int price){
fName = name;
fPrice = price;
}
public int getPrice() {
return fPrice;
}
public String toString() {
return fName;
}
}