Answer:
int x;
indata.open("lottowins");
indata >> x;
cout << x << endl;
indata >> x;
cout << x << endl;
indata >> x;
cout << x << endl;
indata.close();
Answer:
The Matlab code is as given in the explanation, paste the code in the new script file, save it and run.
Explanation:
The code is as follows
Code:
<em>%% Initialization of the code</em>
<em>% The code takes an array of six AIS scores of the form [AIS1 AIS2 AIS3</em>
<em>% AIS4 AIS5 AIS6] of order 1x6.</em>
<em>AIS=input('Please enter the AIS array of the form [AIS1 AIS2 AIS3 AIS4 AIS5 AIS6]');%taking input of the array</em>
<em>AISs=sort(AIS,'descend');%sorting the array in the descending order</em>
<em>iss=(AISs(1,1)^2)+(AISs(1,2)^2)+(AISs(1,3)^2);%Calculating the ISS</em>
<em>disp(['The injury severity score (ISS) for the entered array is ', num2str(iss)])%Displaying the output</em>
Output:
<u><em>Please enter the AIS array of the form [AIS1 AIS2 AIS3 AIS4 AIS5 AIS6][3 0 4 5 3 0];</em></u>
<u><em>The injury severity score (ISS) for the entered array is 50</em></u>
<u><em /></u>
Answer:
int calculate_cost(int quantity) {
double cost = 0;
if (quantity <= 20)
cost = quantity * 23.45;
else if (quantity >= 21 && quantity <= 100)
cost = quantity * 21.11;
else if (quantity > 100)
cost = quantity * 18.75;
return cost;
}
Explanation:
Create a function called calculate_cost that takes one parameter, quantity
Initialize the cost as 0
Check the quantity using if else structure. Depending on the quantity passed, calculate the cost. For example, if the quantity is 10, the cost will be $234.5
Return the cost
Answer:
The answer is C
Explanation
She should sign an annual maintenance contract (AMC) with her vendor