Think of one of your Math homework. How can you use program to reveal the answer? Write a calculation program with atleast ten(10) variable statements calculating a problem..Your program should include:Variables for each part of problem. See example below:Eg. $apple = 10, $orange = 15, $discount = 0.2<!DOCTYPE html><html><body><?php$apple = 10;$orange = 15;$discount = 0.2;echo ($apple + $orange) * $discount;?></body></html>

Asked Nov 3, 2019

Think of one of your Math homework. How can you use program to reveal the answer? Write a calculation program with atleast ten(10) variable statements calculating a problem..

Your program should include:

  • Variables for each part of problem. See example below:

Eg. $apple = 10, $orange = 15, $discount = 0.2

<!DOCTYPE html>




$apple = 10;

$orange = 15;

$discount = 0.2;

echo ($apple + $orange) * $discount;





Expert Answer

Step 1

Take a math problem.

Create a program to reveal the answer to that math problem.

The program must have at least ten variables.

Step 2

Let’s take a weekly sell report and generate total sell in a week, calculate the average of the sell, find minimum sell, and find the maximum sell.

Create a PHP program to reveal the answer.

take seven variables that hold per day sell, the seven variables are:

$monday, $tuesday, $wednesday, $thursday, $friday, $saturday, $sunday

Take a variable to store total sell of the week


Take a variable to store average sell of the week


Take a variable to store minimum sell of the week


Take a variable to store maximum sell of the week


The variable in PHP starts with a dollar($) sign.

Step 3


<!DOCTYPE html>

<!--html start tag-->


  <!--html body start tag-->



<!--php start tag-->


/*lets take weekly sell from monday to sunday*/

$monday = 4530;

$tuesday = 1200;

$wednesday = 2560;

$thursday = 3210;

$friday = 2530;

$saturday = 3420;

$sunday = 1000;

//calculate total sell of a week

$totalSell = ($monday + $tuesday + $wednesday + $thursday + $friday + $saturday + $sunday);

//calculate average sell of a week

$averageSell = ($totalSell/7);

//find minimum sell of a week

$minimumSell = min($monday, $tuesday, $wednesday, $thursday, $friday, $saturday, $sunday);

//find maximum sell of a week


Image Transcriptionclose

Total sell is: 18450 Average sell is: 2635.7142857143 Minimum sell is: 1000 Maximum sell is: 4530


Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in


Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: Python 3.7.4: Write a loop that reads positive integers from standard input and that terminates when...

A: Following is the program code that takes input from the user all positive integer and terminates if ...


Q: A transitive dependency is equivalent to which of the following?A) A functional dependency between t...

A: Transitive dependencyA transitive dependency in a database is an indirect relationship between value...


Q: Which of the following diagrams do not contradict the current state of our knowledge about the compl...

A: P class problems can be solved in deterministic polynomial time. NP class can be verified in the pol...


Q: How do I code this on python heres the problem  Use the Design Recipe to define a function count_val...

A: Programming instructions: Define the function count_value which takes the list and a value as an arg...


Q: Write a loop that sets each array element to the sum of itself and the next element, except for the ...

A: Completing the given C++ program so, that it can follow the given rubrics:Firstly, displaying a mess...


Q: (check all that are necessary) Which Oracle server parameters do you need to know in order toset up ...

A: Oracle server parameters required for the client to connect to the server are:Host name or the IP ad...


Q: this is for python

A: Program descriptionTwo lists are created one is a 3 x 3 list and the other 4 x 4 to demonstrate the ...


Q: Using the data file capabilities of C++, create a Personnel file, personnel.dat on your drive and th...

A: Program Instructions:Use do-while loop to repeatedly present the menu.Use switch statement to opt di...


Q: Do research and write a brief report on the impact of mobile advertising on sales and marketing

A: Impact of mobile advertising on sales:A form of advertising through mobile phones is known as mobile...