Inside the main folder, create another folder labelled as part_two. This folder should contain the following...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Inside the main folder, create another folder labelled as part_two. This folder should contain the following files: main.m Add.m Subtract.m Multiply.m Divide.m Menu.m The aim is to create a menu driven Matlab program that will carry out the 4 basic arithmetic operations on 2 numbers. Take note that division by 0 results in an error. The file Menu.m is a function file aimed to display a menu where you select the 4 operations and an operation to exit the program. The files Add.m, Subract.m, Divide.m and Multiply.m are function files aimed to carry out the addition, subtraction, division and multiplication operations respectively. The file main.m is the script file where you assemble the menu driven program and to call the functions in order to carry out the operation on 2 numbers that are to be requested from the user inside main.m. Below is a sample execution of main.m: ****MENU***** 1. ADD 2. SUB 3. DIV 4. MULT ЕXIT Please a number next to a menu item to select operation above: 1 You have Selected Addition. Please enter the first number: 1 Please enter the second number: 3 Answer: 1 + 3 - 4 Thank you. ****MENU***** 1. ADD SUB 3. DIV MULT O EXIT 4. Please a number next to a menu item to select operation above: 2 You have Selected Subtraction. Please enter the first number: 3 Please enter the second number: 1 Answer: 3 - 1 = 2 Thank vou. ****MENU***** 1. ADD SUB 3. DIV MULT EXIT Please a number next to a menu item to select operation above: 0 You are closing the program. Goodbye. The program should make use of fprintf, for loops or while loops, if statements, break, switch-case structures to carry out this programming exercise. Finally, when everything is in their respective folder, and the two folders part_one and part two are inside the main folder labelled as astudentnumber_cset1, zip the main folder and this is what you will submit on google classroom. Inside the main folder, create another folder labelled as part_two. This folder should contain the following files: main.m Add.m Subtract.m Multiply.m Divide.m Menu.m The aim is to create a menu driven Matlab program that will carry out the 4 basic arithmetic operations on 2 numbers. Take note that division by 0 results in an error. The file Menu.m is a function file aimed to display a menu where you select the 4 operations and an operation to exit the program. The files Add.m, Subract.m, Divide.m and Multiply.m are function files aimed to carry out the addition, subtraction, division and multiplication operations respectively. The file main.m is the script file where you assemble the menu driven program and to call the functions in order to carry out the operation on 2 numbers that are to be requested from the user inside main.m. Below is a sample execution of main.m: ****MENU***** 1. ADD 2. SUB 3. DIV 4. MULT ЕXIT Please a number next to a menu item to select operation above: 1 You have Selected Addition. Please enter the first number: 1 Please enter the second number: 3 Answer: 1 + 3 - 4 Thank you. ****MENU***** 1. ADD SUB 3. DIV MULT O EXIT 4. Please a number next to a menu item to select operation above: 2 You have Selected Subtraction. Please enter the first number: 3 Please enter the second number: 1 Answer: 3 - 1 = 2 Thank vou. ****MENU***** 1. ADD SUB 3. DIV MULT EXIT Please a number next to a menu item to select operation above: 0 You are closing the program. Goodbye. The program should make use of fprintf, for loops or while loops, if statements, break, switch-case structures to carry out this programming exercise. Finally, when everything is in their respective folder, and the two folders part_one and part two are inside the main folder labelled as astudentnumber_cset1, zip the main folder and this is what you will submit on google classroom.
Expert Answer:
Related Book For
Introduction to Business Law
ISBN: 9780324826999
3rd Edition
Authors: Jeff rey F. Beatty, Susan S. Samuelson
Posted Date:
Students also viewed these programming questions
-
Inside the folder created above, create another folder labelled as part_one. This folder should contain the following file: part_one.m In this file, you will have to solve the following problem....
-
Select [ Export ] from the drop down [File] menu to create an Excel worksheet of the General Fund post-closing trial balance as of December 31, 2020. Use Excel to prepare in good form a balance sheet...
-
Carry out the following arithmetic operations: (a) The sum of the measured values 756, 37.2, 0.83, and 2.5; (b) The product 0.003 2 X 356.3; (c) The product 5.620 X .
-
The equity profolio of a company is thus 31/12/2001. Nature: Actions A, Quantity = 350, Unit cost = 36000, Purchase dates = 03/1999, 2000 = 37000, 2001= 34000. Nature: Actions B, Qauntity = 125, Unit...
-
You are required to create a conceptual data model of the data requirements for a company that specializes in IT training. The Company has 30 instructors and can handle up to 100 trainees per...
-
Revenue estimates and appropriations enacted are standards against which performance is subsequently measured. What implications can be drawn at year end if variances from these standards occur? If...
-
Identify the four components of an ecosystem. After you do this try to visualize the interactions of these four components of an ecosystem as illustrated by Figure 2. 2 in the textbook. Does this...
-
Accounting for Goodwill Fred Graf, owner of Graf Interiors, is negotiating for the purchase of Terrell Galleries. The balance sheet of Terrell is given in an abbreviated form below. Graf and Terrell...
-
Let X be a binomial random variable with the probability distribution f(x) shown below. Find the probability distribution of the random variable Y=x. f(x)= Bere 3-x x=0,1,2,3 elsewhere Complete the...
-
James Davis owns a small Internet service provider business. Recently, customers have been complaining that they are overcharged and are not receiving timely customer service. Billing rates seem to...
-
Please collect 3 years of financial statements (from 2019. 2020 and 2021) and prepare a typed written report for the trend analysis for Disney, and competitive analysis in two key Competitors from...
-
what is the work rate in kgm / min and how much total work ( Watts ) is completed for a person cycling on a Monark cycle at 2 kg , at 6 0 rpm for 5 minutes?
-
Solve: 4(2y + 4) = 52 The solution(s) are y to separate the solutions) (If there is more than one real solution, use commas
-
What is the basic connection to a mySQL database with python.
-
(x+4) if x <3 (2x - 1 if x 3 Find the value of each. If a limit does not exist, state DNE. # 59 Consider the function f(x) a) lim f(x) = 1-3 f(x) = lim f(x)= I-3 lim I 3+ b) f(3) = = = c) Is f(x)...
-
What is the routing part of a source ip 172.16.100.1
-
what is communications and why do we study it? for real, like why?
-
(a) How far away can a human eye distinguish two ear headlights 2.0 m apart? Consider only diffraction effects and assume an eye pupil diameter of 5.0 mm and a wavelength of 550 nm. (b) What is the...
-
Lonnie Hippen moved to Long Island, Kansas, to work at an insurance company owned by Griffiths. After he moved there, Griffiths offered to sell Hippen a house he owned and Hippen agreed in writing to...
-
True or False: 1. A gift is unenforceable unless both parties give consideration. 2. A gift causa mortis is automatically revoked if the donor dies shortly after making it. 3. A bailee always has the...
-
Make an argument in favor of the parents negligent design case.
-
As shown in Exhibit 5, LOral reported an operating margin of 16% in 2011, which makes it the most profitable company among beauty companies. However, the average operating margin of 18% for home and...
-
The consumer goods company Unilever reported an overall operating margin of 14.9% in 2011. As shown in Exhibit 7, the operating margin is higher in the slower growing Western European and Americas...
-
Dutch grocer Ahold has a debt structure with a relatively high amount of cash on its balance sheet. i. Calculate the interest expense on the average gross debt and interest rate on the average cash...
Study smarter with the SolutionInn App