Question: Write a MATLAB script called question2.m that takes in, as input, the population of a city and makes an estimate about the total daily water
Write a MATLAB script called question2.m that takes in, as input, the population of a city and makes an estimate about the total daily water use of that city measured in kilolitres. The input is only the total population of the city, and you will need to define variables* for the mean daily household water use and the mean household size and set these to appropriate values** . *Note that you will want to define variables with meaningful names representing things like the number of people per-household and the average household water use.
**Note that there is no one correct solution to your program but you can compare your estimate to real data from published sources for real cities. Make sure your comments state your assumptions about your estimate.
Make sure that you save and submit all of the files that you created while developing your solution. Also
In a text file, write down the test inputs and expected outputs you used to test your code works. Submit this as tests2.txt. For example, one test case you would want to check is a population of 0. The total water use of such a city should be 0. Think of other cases you want to include to ensure your program is working correctly.
Question 3:
Take your solution to question 2 above and save it in question3.m modify your code so that it can estimate the percentage of daily use for the city of Adelaide (population 1.3 million) that can be covered by the desalination plant (daily capacity 300,000 kilolitres). For example, if the daily water use of the city is 300,000 kilolitres, then you should output: desalination can cover 100% of the daily water use.
In a text file, write down the test inputs and expected outputs you used to test your code works. Submit this as tests3.txt
Question 4:
Write a MATLAB script called question4.m that reads in the population of a city and estimates the daily cost of transport for those people driving a car. There are many ways you could get the other values you need. You could set them as constants or you could choose to ask the user to input them. Think of what additional information you need and how you want to get that information.
Note you should build up from a very simple model e.g. start with the assumption that everyone owns a car, drives 10kms a day, and only pays the cost of fuel. You can add details as you go. Each time you modify the script you should save a copy. Each time you test you should have a rough estimate of what you expect the result should be (write this estimate in the comments before you run the script). As before, hand in all of your intermediate files.
In a text file, write down the test inputs and expected outputs you used to test your code works. Submit this as tests4.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
