Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using matlab write the code for all these questions. 2. Using estimates of rainfall, evaporation, and water consumption, the town engineer developed the following model

Using matlab write the code for all these questions. image text in transcribed

2. Using estimates of rainfall, evaporation, and water consumption, the town engineer developed the following model of the water volume in the reservoir as a function of time where V is the water volume in liters, t is time in days, and r is the town's consumption rate in liters per day. Write two user-defined functions. The first function should compute the volume of water for a given r and The second function should compute how long it will take for the water volume to decrease to x percent of its initial value of 109 L. The inputs to the second function should be x and r. Test your functions for the case where x = 50 percent and r-107 L/day 3. Write a program that accepts a year and determines whether the year is a leap year. Use the mod function. The output should be variable extra day, which should be lif the year is a leap year and 0 otherwise. The rules for the leap years in the Gregorian calendar are as follows: -All years even divisible by 400 are leap years. Years evenly divisible by 100 but not by 400 are not leap years. -Years divisible by 4 but not by 100 are leap years. All other years are not leap years 4. a. Write a script to display stars in the following order 289 b. Use a for loop to determine the sum of the first 20 terms in the series 3k2+2k. 5. Write a script that will: Generate a random integer in the inclusive range from 10 to 15 Loop that many times to -prompt the user for a number -print the sum of the numbers entered so far with one decimal place

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Vi Special Issue On Database And Expert Systems Applications Lncs 7600

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2012th Edition

3642341780, 978-3642341786

More Books

Students also viewed these Databases questions

Question

Types of cultural maps ?

Answered: 1 week ago

Question

Discuss the various types of leasing.

Answered: 1 week ago

Question

Define the term "Leasing"

Answered: 1 week ago

Question

What do you mean by Dividend ?

Answered: 1 week ago

Question

a valuing of personal and psychological privacy;

Answered: 1 week ago