Explore BrainMass
Share

PHP script that defines two integers as constants

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

I need some major help here. I have never written a PHP script where the values did not come from a form. So I am asking for some assistance in providing me with an example. I am not sure how many credits to post, so I am going to start out with 5. If you need more, let me know. The reason I am asking for an example is with specific requirements is because then I can look at the example and see how it works. The example I am asking for has to have the following.

Write a script that defines two integers as constants.
For instance, one of the constants could be the distance from New York City to Los Angeles.

Using arithmetic operators, write five expressions that:
1) Add the two operands
2) Subtract one operand from the other
3) Multiply the two operands
4) Divide one operand by the other and
5) Divide one operand by the other and return the remainder.

Next, take a result value from one of the previous arithmetic expressions and use an increment operator to increase its value by 1.

Next, use five comparison operators of your choice to determine how the operands and results compare to one another.

Finally, display the full path and filename of your file using a magic constant on the bottom of your web page.

© BrainMass Inc. brainmass.com October 25, 2018, 1:15 am ad1c9bdddf
https://brainmass.com/computer-science/php/php-script-that-defines-two-integers-as-constants-257227

Solution Summary

To define constants, use the define() function. To print out the value of a variable or constant, use the echo() function. The solution combines these and other PHP operators together and provides an actual PHP file that satisfies the requirements of the problem. Comments are placed throughout the code so that you can better understand what the code is for.

$2.19
See Also This Related BrainMass Solution

dementia patients dental care

Hello
I need to have a 5 page paper talking about Dementia. It should talk about the disease the effect on the brain and nervous system, patient's function,.....
There are 7 questions need to be covered within 5 pages. (Ideally all 7 questions)
references are needed to be addressed at the end of the paper.

The questions are:

1. What are the major symptoms, prognosis and dental implications of this patient's primary conditions?
2. What are the major actions, side effects, and dental implications of the medications this patient is taking?
3. What other information would you want to obtain about this patient prior to treatment? Why would the information you want to gather be useful?
4. How would this patient's ability to have dental treatment be different if her conditions were more or less severe? What if she was younger or older?
5. What alternative treatment plans are possible for this patient?
6. What general approach do you recommend for providing treatment and maintaining good oral health for this patient? Include information about how you would modify a normal treatment plan to best treat this patient, what setting would be best for treatment, would any medications be advised in addition to her normal medications, any other considerations for providing optimum prevention and treatment services.
7. Can this patient realistically maintain the restorative treatment planned? What steps could you take to ensure the best possible chance that the patient can maintain the treatment they receive given their specific risk/problems?

View Full Posting Details