Need help with school project
Hi everyone, I am working on a school project and I am having a lot of difficulties with the switch statement.
I have created part of the switch statement but I can't figure out of to call the variable.
Here is my switch statement block:
switch (m) // m represent rating
case (A): cost = basicMovie * RATING_A;
case (B): cost = basicMovie * RATING_B;
case (C): cost = basicMovie * RATING_C;
case (D): cost = basicMovie * RATING_D;
case (F): cost = basicMovie * RATING_F;
Now, I am suppose to get the rating from the following method:
public String getMovieRating()
how can I convert that movieRating into the m variable I need in my switch statement?