Reference no: EM13165059
Create a function TotalDaysMonth(intYear, intMonth, strIndOrCum) in both VB and Matlab to calculate the cumulative days or number of days in a given month, depending on inputs, by employing array vector in VB or a vector matrix in Matlab.
------------- In VB:
Function TotalDaysMonth(intYear, intMonth, strIndOrCum)
DaysInMonth = Array(31, 28, 31, 30, ...)
. . .
If strIndOrCum = "I" Then
. . .
ElseIf strIndOrCum = "C" Then
. . .
Else
. . .
End If
. . .
End Function
-------------- In Matlab:
Function TotalDays = TotalDaysMonth(intYear, intMonth, strIndOrCum)
DaysInMonth = [31, 28, 31, 30, ...];
. . .
if strIndOrCum == 'I'
. . .
elseif strIndOrCum = 'C'
. . .
else
. . .
end
. . .
end
Note:
1. Matlab: Starting index of a row vector is 1. VB: Starting index of a row vector = 0.
2. You need to call function isLeapYear(intYear) to adjust the output if necessary.
1.2. By having the input as one line of string, combining the year, month, and day; with the expected I/O: (with {xxx} is the input for the prompt)
====================
Enter date: {2012/03/15}
Total day passed in 2012 before 3/15 = 74 days
Draw an event-graph of a distributed system
: Draw an event-graph of a distributed system of three concurrent processes which are communicating messages, and synchronized by their respective logical clocks
|
Interacting with customers on a regular basis
: Social critics have maintained that marketing leads people to buy products they do not want and do not need. However, the failure rate of new products that are heavily marketed is reportedly as high as 80 percent. How can these two seemingly opposite..
|
Program calculates and displays salesperson''s commission
: The sales manager at Tompkins Company wants a program that calculates and displays each salesperson's commission, which is 10% of his or her sales. It also should display the total commission. Use a value-returning function to get the amount sold by ..
|
Identify the incorrect names or formulas
: Identify the incorrect names or formulas.
|
Vb and matlab to calculate the cumulative days
: Create a function TotalDaysMonth(intYear, intMonth, strIndOrCum) in both VB and Matlab to calculate the cumulative days or number of days in a given month, depending on inputs, by employing array vector in VB or a vector matrix in Matlab.
|
How many moles of oxygen gas were evolved
: A test tube containing a mixture of KCl, KClO3, and MnO2 having a total weight of 23.584 g was heated to compose the KClO3. After heating, the mass was found to be 22.347 g.
|
The program should allow the student
: The program should allow the student to enter the answer. If the answer is correct, a message of congratulations should be displayed. If the answer is incorrect, a message showing the correct answer should be displayed.
|
Prepare a schedule in good form
: Prepare a schedule in Good Form that determines Citrine's taxable income for State X purposes and calculate the amount of Federal income tax, if any, for Repair Habitat and for Concrete Pour. Show your calculation in good form.
|
Find the mass of sodium required to produce
: Find the mass of sodium required to produce 5.68 L of hydrogen gas at STP from the reaction described by the following equation: 2 Na + 2 H2O ® 2 NaOH + H2
|