Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solve these two Questions by solving using MatLab coding... I need help! Thank you b) Write a MATLAB code that calculates the

Please help me solve these two Questions by solving using MatLab coding... I need help! Thank you image text in transcribed
b) Write a MATLAB code that calculates the cost of internet usage depending on the number of Megabytes used, if the number of Megabytes entered is negative, the program should print "Wrong entry": (User entered values are indicated in bold) (3 marks) Megabytes 0 to 500 500+ to 1,000 1,000+ to 2,500 2,500+ Cost 4 Dhs 7 Dhs 11 Dhs 17 Dhs Sample output: Please enter Megabytes used: 600 The cost is: 7 Dhs c) Write a MATLAB program that reads a 4-digit integer and checks if the sum of the individual digits is divisible by 3 number or not. (Hint: use the remainder (rem) and the division operations to separate numbers). For example: 2136 2+13+6 12 DIVISABLE BY 3. (User entered values are indicated in bold) (5 marks): Example Enter a 4-digit integer: 2136 The sum of the frur digits is DIVISABLE BY 3

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

Step: 3

blur-text-image

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions