Answer:
Pseudocode is as follows:
// below is a function that takes two parameters:1. An array of items 2. An integer for weight W
// it returns an array of selected items which satisfy the given condition of sum <= max sum.
function findSubset( array items[], integer W)
{
initialize:
maxSum = 0;
ansArray = [];
// take each "item" from array to create all possible combinations of arrays by comparing with "W" and // "maxSum"
start the loop:
// include item in the ansArray[]
ansArray.push(item);
// remove the item from the items[]
items.pop(item);
ansArray.push(item1);
start the while loop(sum(ansArray[]) <= W):
// exclude the element already included and start including till
if (sum(ansArray[]) > maxSum)
// if true then include item in ansArray[]
ansArray.push(item);
// update the maxSum
maxSum = sum(ansArray[items]);
else
// move to next element
continue;
end the loop;
// again make the item[] same by pushing the popped element
items.push(item);
end the loop;
return the ansArray[]
}
Explanation:
You can find example to implement the algorithm.
Answer:
a mobile app that only accepts wagers based on the user's location.
Explanation:
One effective Cloud Solution would be a mobile app that only accepts wagers based on the user's location. This app would allow the clients to safely and effectively place any wagers which are sent to the gambling company's cloud servers which would be third-party Cloud services. These services will make sure that the gambling company can handle any number of wages at any given time. The mobile app would also only accept wagers from individuals in specific locations in which the law does not prohibit gambling. Therefore, preventing the gambling company from being liable for any losses.
Answer:
Explanation:
The code provided had many errors. I fixed the errors and changed the userAgeCheck function as requested. Checking the age of that the user has passed as an input and changing the variables as needed depending on the age. The background color that was changed was for the form field as the question was not very specific on which field needed to be changed. The piece of the code that was created can be seen in the attached image below.
var validColor = "LightGreen";
var invalidColor = "Orange";
var userAgeInput = document.getElementById("userAge");
var formWidget = document.getElementById("userForm");
var userAgeValid = false;
function userAgeCheck(event) {
if ((userAgeInput >= 25) && (userAgeInput <= 35)) {
document.getElementById("userForm").style.backgroundColor = validColor;
userAgeValid = true;
} else {
document.getElementById("userForm").style.backgroundColor = invalidColor;
userAgeValid = false;
}
};
function formCheck(event) {};
if (!userAgeValid) {
userAgeInput.addEventListener("input", userAgeCheck);
formWidget.addEventListener('submit', formCheck);
event.preventDefault();
}
As far as windows 7 and below it was control panel, but in windows 8 and higher, microsoft added, a new app which was called settings, control panel was still there but with a few features removed
Answer:
public class Date{
Public Date(int month,int day,int year){
}
}
void main(){
Date datep=new Date(3,12,2006);
}
Explanation:
Here we declared a class "Date" and defined one public constructor which will take month,day and year. In main we created an object to that Date class by invoking this parameterized constructor and assigned that object to "dateap" Date variable