function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Simple code help!!!

I am new at writing APEX code and I need some help.   I want to write the following Excel logic in APEX CODE:

My organization has three products….let's call them "Product 1" , "Product 2", and "Product 3"

For Each Product I have a field called "Product 1 Rate", "Product 2 Rate" and "Product 3 Rate"

I want to declare a variable called "PriceDaily" and have it equal one of the product rates.

So I want to say:  If Product name is  "Product 1" than "Price Daily" is "Product 1 Rate",
                                    If Product name is  "Product 2" than "Price Daily" is "Product 2 Rate",
                                    If Product name is  "Product 3" than "Price Daily" is "Product 3 Rate"

How is this written in an APEX Class? 

Thank you for you help!!!!!!!!!
No one is going to boil and serve here - mimic what you want to do in a well structured psudocode to make your requirement self explanatory.