Answer:
B:2 should be the first answer
C: 14 the second
Answer:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double num1, num2, num3, num4, num5, sum = 0;
cout << "Input: ";
cin >> num1 >> num2 >> num3 >> num4 >> num5;
sum = num1 + num2 + num3 + num4 + num5;
cout << "Output: " << static_cast<int>(round(sum)) << endl;
return 0;
}
Explanation:
Include cmath to use the round function
Declare the variables
Get the five numbers from the user
Sum them and assign the result to the sum
Round the sum using the round function, and convert the sum to an integer using static_cast statement
Print the sum
Answer:
SELECT WarehouseID, SUM(QuantityOnHand) AS TotalItemsOnHandLT3
FROM INVENTORY
WHERE QuantityOnHand < 3
GROUP BY WarehouseID
ORDER BY TotalItemsOnHandLT3 DESC;
Explanation:
SELECT statement is used to select the columns from the table. Here the columns displayed by SELECT are WareHouseID, Sum of QuantityOnHand which is named as TotalItemsOnHandLT3 using AS which is called alias which is a temporary name to represent one or columns. WHERE clause here depicts a condition that omits all SKU items that have three or more items on hand from the sum. GROUP BY is used to group the resultant set by one or more columns like here it is grouped by WarehouseID. ORDER BY is used to display the result of TotalItemsOnHandLT3 column in descending order.
Answer:
Following are the code to method calling
backwardsAlphabet(startingLetter); //calling method backwardsAlphabet
Output:
please find the attachment.
Explanation:
Working of program:
- In the given java code, a class "RecursiveCalls" is declared, inside the class, a method that is "backwardsAlphabet" is defined, this method accepts a char parameter that is "currLetter".
- In this method a conditional statement is used, if the block it will check input parameter value is 'a', then it will print value, otherwise, it will go to else section in this block it will use the recursive function that prints it's before value.
- In the main method, first, we create the scanner class object then defined a char variable "startingLetter", in this we input from the user and pass its value into the method that is "backwardsAlphabet".